CN111344662A - Font size control method and font size control system based on intelligent terminal - Google Patents
Font size control method and font size control system based on intelligent terminal Download PDFInfo
- Publication number
- CN111344662A CN111344662A CN201780096720.4A CN201780096720A CN111344662A CN 111344662 A CN111344662 A CN 111344662A CN 201780096720 A CN201780096720 A CN 201780096720A CN 111344662 A CN111344662 A CN 111344662A
- Authority
- CN
- China
- Prior art keywords
- font size
- contacts
- font
- distance
- display interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention provides a font size control method and a font size control system based on an intelligent terminal, wherein the font size control method comprises the following steps: detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the continuous time for the two contacts to continuously contact the display interface; when the pressure and/or the duration of the contact exceeds a pressure threshold and/or a time threshold, acquiring the initial font size of characters in the display interface; acquiring coordinates of the contacts at an initial position and a current position, and respectively calculating a scaling multiple of a first distance between the two contacts at the initial position and a second distance between the two contacts at the current position; and calculating the size of the target font according to the initial font size and the scaling multiple, and adjusting the font size to the size of the target font. By adopting the technical scheme, the text content can be arbitrarily scaled, the definition of the text content is not influenced, and the user experience is improved.
Description
The invention relates to the field of intelligent equipment, in particular to a font size control method and a font size control system based on an intelligent terminal.
With the development of intelligent terminals such as smart phones, people often need to use an amplification function when using the intelligent terminal, and at present, a lot of pictures have the amplification function, but characters in a simple text form cannot be arbitrarily amplified or reduced according to gestures.
According to the method and the device, a trigger event is set, the font size of the text is recorded after the trigger event is detected, so that the font size of the text is changed according to the distance change proportion of fingers between the contacts of the screen, and the text characters are enlarged and reduced.
Disclosure of Invention
In order to overcome the technical defects, the invention aims to provide a font size control method and a font size control system based on an intelligent terminal, which can record the font size of a text after detecting a trigger event through the trigger event so as to change the font size of the text according to the change proportion of the distance between the touch points of a finger on a screen, thereby realizing the amplification and the reduction of text characters.
The invention discloses a font size control method based on an intelligent terminal, which comprises the following steps:
detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the continuous contact duration of the two contacts on the display interface;
when the pressure and/or the duration of the contact exceeds a pressure threshold and/or a time threshold, acquiring the font size of the characters in the display interface as an initial font size;
obtaining the coordinates of the initial positions and the current positions of the motion tracks of the two contacts on the display interface, and respectively calculating the zoom multiple of a first distance between the two contacts when the two contacts are located at the initial positions and a second distance between the two contacts when the two contacts are located at the current positions;
and calculating the size of a target font according to the size of the initial font and the scaling multiple, and adjusting the size of the characters from the size of the initial font to the size of the target font.
Preferably, the step of detecting the number of contacts simultaneously received by the display interface of the intelligent terminal, and when the number of contacts is two, detecting the pressure of the two contacts on the display interface and/or the duration of time for which the two contacts continuously contact the display interface includes:
calling a touch screen event function in the intelligent terminal, and detecting the number of contacts simultaneously received by a display interface of the intelligent terminal;
when the situation that the display interface receives two contacts at the same time is detected, the pressure sensor of the intelligent terminal is called, the pressure of the two contacts on the display interface is detected, and/or the duration time of the two contacts continuously contacting the display interface is recorded.
Preferably, the step of obtaining the coordinates of the initial position and the current position of the motion trajectory of the two touch points on the display interface, respectively calculating a first distance between the two touch points when the two touch points are located at the initial position, and a scaling multiple of a second distance between the two touch points when the two touch points are located at the current position includes:
obtaining coordinates of the initial positions of the two contacts, calculating the distance between the initial positions of the two contacts, and recording the distance as a first distance;
obtaining the coordinates of the current positions of the two contacts, calculating the distance between the current positions of the two contacts, and recording the distance as a second distance;
and dividing the second distance by the first distance to calculate a scaling factor.
Preferably, the step of calculating a target font size according to the initial font size and the scaling factor, and adjusting the text from the initial font size to the target font size includes:
calculating a font scaling factor according to the scaling multiple;
multiplying the initial font size by the font scaling factor to calculate a target font size;
and adjusting the current font from the initial font size to the target font size.
Preferably, between the step of multiplying the initial font size by the font scaling factor to calculate a target font size and the step of adjusting the current font from the initial font size to the target font size, the font size control method further includes:
presetting a maximum font size and a minimum font size in the intelligent terminal;
and when the target font size exceeds the maximum font size, controlling the target font size to be the maximum font size, and when the target font size is lower than the minimum font size, controlling the target font size to be the minimum font size.
The invention also discloses a font size control system based on the intelligent terminal, which comprises the following components:
the detection module is used for detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the continuous contact duration time of the two contacts on the display interface;
the initial font size acquisition module is connected with the detection module, and when the pressure and/or the duration time of the contact exceeds a pressure threshold and/or a time threshold, the font size of the characters in the display interface is acquired as the initial font size;
a zoom factor obtaining module, connected to the initial font size obtaining module, for obtaining coordinates of an initial position and a current position of the motion trajectory of the two contacts on the display interface, and respectively calculating a zoom factor of a first distance between the two contacts when the two contacts are located at the initial position and a second distance between the two contacts when the two contacts are located at the current position;
and the font scaling module is connected with the scaling multiple acquisition module, calculates the size of a target font according to the size of the initial font and the scaling multiple, and adjusts the size of the characters from the size of the initial font to the size of the target font.
Preferably, the detection module comprises:
the touch point number detection unit is used for calling a touch screen event function in the intelligent terminal and detecting the number of touch points simultaneously received by a display interface of the intelligent terminal;
and the pressure and time detection unit is connected with the contact number detection unit, and when the display interface is detected to simultaneously receive two contacts, the pressure sensor of the intelligent terminal is taken, the pressure of the two contacts on the display interface is detected, and/or the duration time of the two contacts continuously contacting the display interface is recorded.
Preferably, the scaling factor obtaining module includes:
the first distance acquisition unit is used for acquiring the coordinates of the initial positions of the two contacts, calculating the distance between the initial positions of the two contacts and recording the distance as a first distance;
the second distance acquisition unit is used for acquiring the coordinates of the current positions of the two contacts, calculating the distance between the current positions of the two contacts and recording the distance as a second distance;
and the scaling factor calculation unit is connected with the first distance acquisition unit and the second distance acquisition unit, divides the second distance by the first distance and calculates the scaling factor.
Preferably, the font scaling module comprises:
a font scaling factor calculation unit for calculating a font scaling factor according to the scaling factor;
the target font size calculating unit is connected with the font scaling coefficient calculating unit and is used for multiplying the initial font size by the font scaling coefficient to calculate the target font size;
and the font size adjusting unit is connected with the target font size calculating unit and is used for adjusting the current font from the initial font size to the target font size.
Preferably, between the target font size calculating unit and the font size adjusting unit, the font scaling module further includes:
the font size presetting unit is used for presetting the maximum font size and the minimum font size in the intelligent terminal;
and the target font size control unit is connected with the font size presetting unit, controls the target font size to be the maximum font size when the target font size exceeds the maximum font size, and controls the target font size to be the minimum font size when the target font size is lower than the minimum font size.
After the technical scheme is adopted, compared with the prior art, the method has the following beneficial effects:
1. misoperation can be prevented through the setting of the trigger event;
2. the gesture track of the user is not limited, the text content can be arbitrarily scaled, and the user experience is improved;
3. the definition of the text content is not affected.
FIG. 1 is a flow chart illustrating a font size control method in accordance with a preferred embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for detecting the number of contacts, the contact pressure and/or the duration received at the same time by the display interface of the intelligent terminal according to the font size control method in a preferred embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for obtaining zoom factors according to a font size control method in an embodiment of the present invention;
FIG. 4 is a flow chart illustrating the process of adjusting the font size of the font size control method according to a preferred embodiment of the present invention;
FIG. 5 is a flow chart illustrating a font size control method in accordance with another preferred embodiment of the present invention;
fig. 6 is a schematic diagram of a font size control system according to a preferred embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a detection module of a font size control system according to a preferred embodiment of the present invention.
Fig. 8 is a schematic structural diagram of a scaling factor obtaining module of the font size control system according to a preferred embodiment of the present invention.
FIG. 9 is a block diagram of a font scaling module of the font size control system according to a preferred embodiment of the present invention.
FIG. 10 is a block diagram of a font scaling module of the font size control system according to another preferred embodiment of the present invention.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
In the description of the present invention, unless otherwise specified and defined, specific meanings of the above terms may be understood as specific circumstances by one of ordinary skill in the art.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
The smart terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like.
Fig. 1 is a schematic flow chart of a font size control method based on an intelligent terminal in a preferred embodiment of the present invention. In this embodiment, the font size control method specifically includes the following steps:
s100: detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the duration of continuous contact of the two contacts with the display interface
To implement zooming of text content, a trigger event needs to be set first to prevent the user experience from being reduced due to misoperation of the user. The method comprises the steps of firstly detecting the number of touch points simultaneously received by a display interface of the intelligent terminal, wherein the number of touch points is the number of positions where touch screen events occur at different positions of the display interface by a user, and when the situation that the display interface simultaneously receives 2 touch points is detected, the user is considered to possibly zoom in and out a text. The trigger event may be that the user presses the screen for more than a certain pressure, or the user touches the screen for more than a certain duration, or the two conditions are in a logical or relationship, where the user presses the screen for more than a certain pressure or the user touches the screen for more than a certain duration to trigger the text zooming operation, either one of the two conditions may be selected, or the two conditions are in a logical and relationship, and the user presses the screen for more than a certain pressure and the user touches the screen for more than a certain duration to trigger the text zooming operation, preferably, the user presses the screen for more than a certain pressure for more than a certain duration to trigger the text zooming operation. Therefore, according to the above manner, when two contacts are detected, it is necessary to detect the pressure of the two contacts on the display interface and/or the duration of time for which the two contacts continuously contact the display interface. Whether the pressure of the contact is detected or the continuous contact duration is detected, the contact should continuously contact the display interface, and once the contact is stopped, the contact should be detected again.
S200: when the pressure and/or the duration of the contact exceeds a pressure threshold and/or a time threshold, acquiring the font size of the characters in the display interface as the initial font size
And after the pressure of the two contacts on the display interface and/or the duration of continuous contact of the two contacts on the display interface are detected, the zooming operation is triggered according to different trigger events. When the trigger event is that the user presses the screen to exceed a certain pressure, setting a pressure threshold, and when the pressure exceeds the pressure threshold, reading the font size of characters in the display interface as the initial font size, wherein the subsequent font size scaling is based on the initial font size; when the trigger event is that the touch screen of the user exceeds a certain duration, a time threshold is set, and when the duration exceeds the time threshold, the font size of characters in the display interface is read to serve as the initial font size. When the two conditions are in a logical OR relationship, when the pressure is detected to exceed the pressure threshold or the duration time exceeds the time threshold, the zooming operation can be triggered, and the font size of characters in the display interface is read as the initial font size; when the two conditions are in a logical AND relationship, when the pressure is detected to exceed the pressure threshold value and the touch screen duration time exceeds the time threshold value, the zooming operation can be triggered, and the font size of characters in the display interface is read to serve as the initial font size; when the trigger event is that the duration of the pressure exceeding a certain pressure value exceeds a certain threshold value, the scaling operation can be triggered, and the font size of the characters in the display interface is read as the initial font size.
S300: obtaining the coordinates of the initial position and the current position of the motion tracks of the two contacts on the display interface, and respectively calculating the zoom multiple of the first distance between the two contacts when the two contacts are located at the initial position and the second distance between the two contacts when the two contacts are located at the current position
After the scaling operation is triggered and the font size of the characters in the display interface is read as the initial font size, the scaling multiple needs to be calculated according to the change proportion of the distance between the touch points. Therefore, it is necessary to read coordinates of initial positions and current positions of the movement traces of the two touch points on the display interface, and it is clear that the movement traces of the touch points need to be continuous, that is, when the interruption of the touch point touch event is detected, the positions of the two touch points are final positions, zooming cannot be continued, and detection needs to be performed again until the trigger event is detected again. After the coordinates of the initial position and the current position of the motion track of the display interface of the two contacts are read, the distance between the two contacts at the initial position needs to be calculated as a first distance, the distance between the two contacts at the current position needs to be calculated as a second distance, and the second distance is divided by the first distance to obtain a zoom factor, wherein the zoom factor is not necessarily greater than 1, and can also be less than or equal to 1. The scaling factor is not a multiple of the final scaling of the font size, but a scaling factor of the font size needs to be calculated according to the scaling factor, for example, when the first distance is 2 and the second distance is 4, the scaling factor is 4/2 ═ 2, and the scaling factor of the font size does not necessarily equal 2, and needs to be adjusted according to the font size.
S400: calculating the target font size according to the initial font size and the zoom multiple, and adjusting the characters from the initial font size to the target font size
After the scaling factor is calculated, the target font size needs to be calculated by combining the initial font size, and firstly, the scaling factor needs to be calculated according to the scaling factor and the initial font size. The zoom factor is equal to the zoom multiple multiplied by a certain adjustment factor, the setting of the adjustment factor is related to the size of the zoom multiple, firstly, the zoom multiple needs to be divided into three conditions of being more than 1, being equal to 1 and being less than 1, when the zoom factor is equal to 1, the adjustment factor is 1, and the zoom factor is equal to 1; when the zoom factor is larger than 1, the adjusting coefficient should be larger than the reciprocal of the zoom factor, which may be a preset value, or may be set by the user, or may be obtained by the system through calculation, and when the preset or user-set adjusting coefficient is smaller than the reciprocal of the zoom factor, the adjusting coefficient is set to be a number slightly larger than the reciprocal of the zoom factor; when the zoom factor is smaller than 1, the adjustment coefficient should be smaller than the reciprocal of the zoom factor and larger than 0, which may be a preset value, or may be set by the user, or may be calculated by the system, and when the preset or user-set adjustment coefficient is smaller than the reciprocal of the zoom factor, the adjustment coefficient is set to a number slightly smaller than the reciprocal of the zoom factor. The scaling factor is the scaling multiple multiplied by the adjustment factor, after the scaling factor is obtained, the target font size is equal to the initial font size multiplied by the scaling factor, then the characters are reloaded, the characters are adjusted to the target font size from the initial font size, the adjustment of the font size of the characters can be updated from time to time, and the characters can also be directly adjusted to the final size when the touch screen event is finished.
After the configuration is adopted, the font size of the text can be recorded after a trigger event is detected by setting the trigger event, so that the font size of the text can be changed according to the change proportion of the distance between the touch points of the finger on the screen, and the text characters can be amplified and reduced.
Referring to fig. 2, in a preferred embodiment, the step of detecting the number of contacts simultaneously received by the display interface of the intelligent terminal, and when the number of contacts is two, detecting the pressure of the two contacts on the display interface and/or the duration of time for which the two contacts continuously contact the display interface includes:
s101: calling a touch screen event function in the intelligent terminal, and detecting the number of contacts simultaneously received by a display interface of the intelligent terminal
To finish the scaling of the size of the characters in the text, the display interface must have two contacts at the same time, and therefore, the number of the contacts received by the display interface of the intelligent terminal at the same time needs to be detected. And detecting the number of the contacts received by the display interface of the intelligent terminal at the same time, calling a touch screen event function in the intelligent terminal, reading position parameters of the contacts in the touch screen event function, wherein different positions represent different contacts, and the number of the positions is recorded as the number of the contacts.
S102: when the situation that the display interface receives two contacts at the same time is detected, a pressure sensor of the intelligent terminal is called, the pressure of the two contacts on the display interface is detected, and/or the duration time of the two contacts continuously contacting the display interface is recorded
The method comprises the steps of reading position parameters of contacts in a touch screen event function, when two different position parameter values exist at the same time, receiving the two contacts by a display interface at the same time, detecting different parameters according to set different trigger events, calling a pressure sensor of the intelligent terminal when the trigger events contain a pressure condition, detecting the pressure of the two contacts on the display interface, reading a pressure value, and recording the continuous contact duration time of the two contacts on the display interface when the trigger events contain a touch screen duration time condition.
Referring to fig. 3, in a preferred embodiment, the step of obtaining coordinates of an initial position and a current position of the motion trajectory of the two touch points on the display interface, and respectively calculating a zoom multiple of a first distance between the two touch points when the two touch points are located at the initial position and a second distance between the two touch points when the two touch points are located at the current position includes:
s301: obtaining the coordinates of the initial positions of the two contact points, calculating the distance between the initial positions of the two contact points, and recording as a first distance
When the zoom factor is calculated, firstly, the coordinates of the initial positions of the two touch points are acquired, and the distance between the two coordinates is calculated according to the coordinate values, namely the distance between the initial positions of the two touch points, and the distance is recorded as a first distance.
S302: obtaining the coordinates of the current positions of the two contacts, calculating the distance between the current positions of the two contacts, and recording as a second distance
After the distance between the initial positions of the two contacts is obtained, the distance between the current positions of the two contacts needs to be obtained in real time, so that the scaling multiple is calculated according to the proportion between the two distances. Obtaining the distance between the current positions of the two touch points also requires obtaining coordinates of the current positions of the two touch points, calculating the distance between the two coordinates, and recording the distance as a second distance.
S303: dividing the second distance by the first distance to calculate a zoom factor
After the first distance and the second distance are obtained, the scaling factor is equal to the second distance divided by the first distance, and thus the scaling factor is calculated.
Referring to fig. 4, in a preferred embodiment, the step of calculating a target font size according to the initial font size and the scaling factor and adjusting the text from the initial font size to the target font size specifically includes:
s401: calculating font scaling factor according to the scaling factor
After the zoom factor is obtained, the system can calculate an adjustment coefficient according to the zoom factor and the initial font size through a set algorithm, and the zoom factor is multiplied by the adjustment coefficient to calculate the zoom factor. When the scaling multiple is greater than 1, the scaling multiple is Ks, the adjustment coefficient is Kt, the scaling coefficient is K, the initial font size is X1, a font library in the intelligent terminal is read, the maximum font size is Xmax, the first distance is L1, the second distance is L2, the diagonal length of the measurement display interface is Lmax, the ratio of the diagonal length of the measurement display interface to the first distance is calculated to be K1-Lmax/L1, meanwhile, the scaling multiple is L2/L1, the ratio of the maximum font size to the initial font size is K2-Xmax/X1, the adjustment coefficient Kt K2/K1, the scaling coefficient K-Ks-Kt-Ks (L2/L1) (K2/K1) -Ks 2)/(X1-lmmax), and meanwhile, that is, when Kt > 1/L > 8656, i.e., K8642 is slightly greater than K8642 + K8642, and K8642 is K8642 + K8642, can be set in advance, prevent the zoom multiple Ks > 1 and the zoom factor K < 1; when the scaling factor is equal to 1, the adjusting coefficient is 1, the scaling factor is equal to the scaling factor multiplied by the adjusting coefficient, and the scaling factor is 1; when the scaling multiple is less than 1, the scaling multiple is also denoted as Ks, the adjustment coefficient is Kt, the scaling coefficient is K, the initial font size is denoted as X1, a font library in the intelligent terminal is read, the minimum font size is Xmin, the first distance is L1, the second distance is L2, the minimum distance between two touch points is set as Lmin, the minimum distance is the limit minimum distance of a touch point which can be touched by a human finger on a display interface, the ratio of the minimum distance between the two touch points to the first distance is calculated as K1 Lmin/L1, meanwhile, the scaling multiple is L2/L1, the ratio of the minimum font size to the initial font size is K2 > -Xmin/X1, the adjustment coefficient Kt ═ K2/K1, the scaling coefficient K ═ Kt ═ 1 (L638) (K1)/(xxmin/K1), namely, K ═ 27 ═ K ═ 2 ≦ K ≦ 2, and when K ≦ K1 is equal to K ≦, let Kt be L1/L2-K3, K3 be a value slightly larger than 0, and K3 < L1/L2, which can be set in advance to prevent the scaling factor Ks < 1 and the scaling factor K > 1.
To make the scaling smoother, preferably, when the scaling multiple is not equal to 1, let Lmax/Lmin, K2 be Xmax/Xmin, the adjustment coefficient be Kt be K2/K1, and the scaling coefficient be Ks Kt.
S402: multiplying the initial font size by the font scaling factor to calculate a target font size
After the scaling factor is calculated, the target font size is the original font size multiplied by the font scaling factor. Marking the target font size as X, and when the zoom multiple is larger than 1, marking the target font size as X-1-K-X1-Ks-Kt; when the scaling multiple is equal to 1, the scaling coefficient is equal to 1, and the target font size is equal to the current font size; when the zoom factor is smaller than 1, the target font size is X-X1-K-X1-Ks-Kt.
S403: adjusting the current font from the initial font size to the target font size
After the target font size is obtained, the current character needs to be adjusted from the initial font size to the target font size, and the text content is reloaded, wherein the character font size of the text content is the target font size.
Fig. 5 is a schematic flow chart of a font size control method based on an intelligent terminal according to another preferred embodiment of the present invention. In this embodiment, between the step of multiplying the initial font size by the font scaling factor to calculate the target font size and the step of adjusting the current font from the initial font size to the target font size, the font size control method further includes the following steps:
s404: presetting the maximum font size and the minimum font size in the intelligent terminal
In order to limit the size of the target font within a certain range and avoid the size from being too large or too small, the maximum font size and the minimum font size can be preset in the intelligent terminal, the maximum font size should not exceed the maximum font size in the font library of the intelligent terminal, and the minimum font size should not be lower than the minimum font size in the font library of the intelligent terminal.
S405: when the target font size exceeds the maximum font size, controlling the target font size to be the maximum font size, and when the target font size is lower than the minimum font size, controlling the target font size to be the minimum font size
When the calculated target font size exceeds the preset maximum font size, the target font size is changed to be the maximum font size, and when the calculated target font size is lower than the preset minimum font size, the target font size is changed to be the minimum font size.
Referring to fig. 6, a font size control system based on an intelligent terminal according to a preferred embodiment of the present invention specifically includes the following components:
the detection module needs to set a trigger event to realize the zooming of the text content, so as to prevent the reduction of user experience caused by the misoperation of the user. The method comprises the steps of firstly detecting the number of touch points simultaneously received by a display interface of the intelligent terminal, wherein the number of touch points is the number of positions where touch screen events occur at different positions of the display interface by a user, and when the situation that the display interface simultaneously receives 2 touch points is detected, the user is considered to possibly zoom in and out a text. The trigger event may be that the user presses the screen for more than a certain pressure, or the user touches the screen for more than a certain duration, or the two conditions are in a logical or relationship, where the user presses the screen for more than a certain pressure or the user touches the screen for more than a certain duration to trigger the text zooming operation, either one of the two conditions may be selected, or the two conditions are in a logical and relationship, and the user presses the screen for more than a certain pressure and the user touches the screen for more than a certain duration to trigger the text zooming operation, preferably, the user presses the screen for more than a certain pressure for more than a certain duration to trigger the text zooming operation. Therefore, according to the above manner, when two contacts are detected, it is necessary to detect the pressure of the two contacts on the display interface and/or the duration of time for which the two contacts continuously contact the display interface. Whether the pressure of the contact is detected or the continuous contact duration is detected, the contact should continuously contact the display interface, and once the contact is stopped, the contact should be detected again.
And the initial font size acquisition module is connected with the detection module, and triggers zooming operation according to different trigger events after detecting the pressure of the two contacts on the display interface and/or the duration of continuous contact of the two contacts with the display interface. When the trigger event is that the user presses the screen to exceed a certain pressure, setting a pressure threshold, and when the pressure exceeds the pressure threshold, reading the font size of characters in the display interface as the initial font size, wherein the subsequent font size scaling is based on the initial font size; when the trigger event is that the touch screen of the user exceeds a certain duration, a time threshold is set, and when the duration exceeds the time threshold, the font size of characters in the display interface is read to serve as the initial font size. When the two conditions are in a logical OR relationship, when the pressure is detected to exceed the pressure threshold or the duration time exceeds the time threshold, the zooming operation can be triggered, and the font size of characters in the display interface is read as the initial font size; when the two conditions are in a logical AND relationship, when the pressure is detected to exceed the pressure threshold value and the touch screen duration time exceeds the time threshold value, the zooming operation can be triggered, and the font size of characters in the display interface is read to serve as the initial font size; when the trigger event is that the duration of the pressure exceeding a certain pressure value exceeds a certain threshold value, the scaling operation can be triggered, and the font size of the characters in the display interface is read as the initial font size.
And the zooming multiple acquisition module is connected with the initial font size acquisition module, triggers zooming operation, reads the font size of characters in the display interface as the initial font size, and then calculates the zooming multiple according to the change proportion of the distance between the contact points. Therefore, it is necessary to read coordinates of initial positions and current positions of the movement traces of the two touch points on the display interface, and it is clear that the movement traces of the touch points need to be continuous, that is, when the interruption of the touch point touch event is detected, the positions of the two touch points are final positions, zooming cannot be continued, and detection needs to be performed again until the trigger event is detected again. After the coordinates of the initial position and the current position of the motion track of the display interface of the two contacts are read, the distance between the two contacts at the initial position needs to be calculated as a first distance, the distance between the two contacts at the current position needs to be calculated as a second distance, and the second distance is divided by the first distance to obtain a zoom factor, wherein the zoom factor is not necessarily greater than 1, and can also be less than or equal to 1. The scaling factor is not a multiple of the final scaling of the font size, but a scaling factor of the font size needs to be calculated according to the scaling factor, for example, when the first distance is 2 and the second distance is 4, the scaling factor is 4/2 ═ 2, and the scaling factor of the font size does not necessarily equal 2, and needs to be adjusted according to the font size.
And the font scaling module is connected with the scaling factor acquisition module, and after the scaling factor is calculated, the target font size needs to be calculated by combining the initial font size, and firstly, the scaling factor needs to be calculated according to the scaling factor and the initial font size. The zoom factor is equal to the zoom multiple multiplied by a certain adjustment factor, the setting of the adjustment factor is related to the size of the zoom multiple, firstly, the zoom multiple needs to be divided into three conditions of being more than 1, being equal to 1 and being less than 1, when the zoom factor is equal to 1, the adjustment factor is 1, and the zoom factor is equal to 1; when the zoom factor is larger than 1, the adjusting coefficient should be larger than the reciprocal of the zoom factor, which may be a preset value, or may be set by the user, or may be obtained by the system through calculation, and when the preset or user-set adjusting coefficient is smaller than the reciprocal of the zoom factor, the adjusting coefficient is set to be a number slightly larger than the reciprocal of the zoom factor; when the zoom factor is smaller than 1, the adjustment coefficient should be smaller than the reciprocal of the zoom factor and larger than 0, which may be a preset value, or may be set by the user, or may be calculated by the system, and when the preset or user-set adjustment coefficient is smaller than the reciprocal of the zoom factor, the adjustment coefficient is set to a number slightly smaller than the reciprocal of the zoom factor. The scaling factor is the scaling multiple multiplied by the adjustment factor, after the scaling factor is obtained, the target font size is equal to the initial font size multiplied by the scaling factor, then the characters are reloaded, the characters are adjusted to the target font size from the initial font size, the adjustment of the font size of the characters can be updated from time to time, and the characters can also be directly adjusted to the final size when the touch screen event is finished.
Referring to fig. 7, in a preferred embodiment, the detection module specifically includes:
the contact number detection unit needs to detect the number of contacts simultaneously received by the display interface of the intelligent terminal because the display interface must have two contacts at the same time to finish the scaling of the size of the characters in the text. And detecting the number of the contacts received by the display interface of the intelligent terminal at the same time, calling a touch screen event function in the intelligent terminal, reading position parameters of the contacts in the touch screen event function, wherein different positions represent different contacts, and the number of the positions is recorded as the number of the contacts.
And the pressure and time detection unit is connected with the contact number detection unit, reads the position parameters of the contacts in the touch screen event function, when two different position parameter values exist at the same time, the display interface receives the two contacts at the same time, detects different parameters according to set different trigger events, calls the pressure sensor of the intelligent terminal when the trigger events contain the condition of pressure, detects the pressure of the two contacts on the display interface and reads the pressure value, and records the continuous contact duration time of the two contacts on the display interface when the trigger events contain the condition of touch screen duration time.
Referring to fig. 8, in a preferred embodiment, the zoom factor obtaining module specifically includes:
the first distance obtaining unit is used for obtaining coordinates of initial positions of the two touch points when calculating the zoom multiple, calculating a distance between the two coordinates according to the coordinate values, namely the distance between the initial positions of the two touch points, and recording the distance as a first distance.
And the second distance acquisition unit is used for acquiring the distance between the initial positions of the two contacts and then acquiring the distance between the current positions of the two contacts in real time, so that the scaling multiple is calculated according to the proportion between the two distances. Obtaining the distance between the current positions of the two touch points also requires obtaining coordinates of the current positions of the two touch points, calculating the distance between the two coordinates, and recording the distance as a second distance.
And the scaling factor calculation unit is connected with the first distance acquisition unit and the second distance acquisition unit, and after the first distance and the second distance are acquired, the scaling factor is equal to the division of the second distance by the first distance, so that the scaling factor is calculated.
Referring to fig. 9, in a preferred embodiment, the font scaling module specifically includes:
and the font scaling factor calculating unit is used for calculating an adjusting factor according to the scaling factor and the initial font size by the system through a set algorithm after obtaining the scaling factor, and multiplying the scaling factor by the adjusting factor to obtain the scaling factor. When the scaling multiple is greater than 1, the scaling multiple is Ks, the adjustment coefficient is Kt, the scaling coefficient is K, the initial font size is X1, a font library in the intelligent terminal is read, the maximum font size is Xmax, the first distance is L1, the second distance is L2, the diagonal length of the measurement display interface is Lmax, the ratio of the diagonal length of the measurement display interface to the first distance is calculated to be K1-Lmax/L1, meanwhile, the scaling multiple is L2/L1, the ratio of the maximum font size to the initial font size is K2-Xmax/X1, the adjustment coefficient Kt K2/K1, the scaling coefficient K-Ks-Kt-Ks (L2/L1) (K2/K1) -Ks 2)/(X1-lmmax), and meanwhile, that is, when Kt > 1/L > 8656, i.e., K8642 is slightly greater than K8642 + K8642, and K8642 is K8642 + K8642, can be set in advance, prevent the zoom multiple Ks > 1 and the zoom factor K < 1; when the scaling factor is equal to 1, the adjusting coefficient is 1, the scaling factor is equal to the scaling factor multiplied by the adjusting coefficient, and the scaling factor is 1; when the scaling multiple is less than 1, the scaling multiple is also denoted as Ks, the adjustment coefficient is Kt, the scaling coefficient is K, the initial font size is denoted as X1, a font library in the intelligent terminal is read, the minimum font size is Xmin, the first distance is L1, the second distance is L2, the minimum distance between two touch points is set as Lmin, the minimum distance is the limit minimum distance of a touch point which can be touched by a human finger on a display interface, the ratio of the minimum distance between the two touch points to the first distance is calculated as K1 Lmin/L1, meanwhile, the scaling multiple is L2/L1, the ratio of the minimum font size to the initial font size is K2 > -Xmin/X1, the adjustment coefficient Kt ═ K2/K1, the scaling coefficient K ═ Kt ═ 1 (L638) (K1)/(xxmin/K1), namely, K ═ 27 ═ K ═ 2 ≦ K ≦ 2, and when K ≦ K1 is equal to K ≦, let Kt be L1/L2-K3, K3 be a value slightly larger than 0, and K3 < L1/L2, which can be set in advance to prevent the scaling factor Ks < 1 and the scaling factor K > 1.
To make the scaling smoother, preferably, when the scaling multiple is not equal to 1, let Lmax/Lmin, K2 be Xmax/Xmin, the adjustment coefficient be Kt be K2/K1, and the scaling coefficient be Ks Kt.
And the target font size calculating unit is connected with the font scaling coefficient calculating unit, and after the scaling coefficient is calculated, the target font size is obtained by multiplying the initial font size by the font scaling coefficient. Marking the target font size as X, and when the zoom multiple is larger than 1, marking the target font size as X-1-K-X1-Ks-Kt; when the scaling multiple is equal to 1, the scaling coefficient is equal to 1, and the target font size is equal to the current font size; when the zoom factor is smaller than 1, the target font size is X-X1-K-X1-Ks-Kt.
And the font size adjusting unit is connected with the target font size calculating unit, and is used for adjusting the current character from the initial font size to the target font size after the target font size is obtained, and reloading the text content, wherein the character font size of the text content is the target font size.
Referring to fig. 10, which is a schematic structural diagram of a font scaling module of a font size control system based on an intelligent terminal according to another preferred embodiment of the present invention, between a target font size calculating unit and a font size adjusting unit, the font scaling module further includes the following components:
the font size presetting unit is used for presetting a maximum font size and a minimum font size in the intelligent terminal in order to limit the size of the target font within a certain range and avoid oversize or undersize, wherein the maximum font size does not exceed the maximum font size in the font library of the intelligent terminal, and the minimum font size is not lower than the minimum font size in the font library of the intelligent terminal.
And the target font size control unit is connected with the font size presetting unit, when the calculated target font size exceeds the preset maximum font size, the target font size is changed into the maximum font size, and when the calculated target font size is lower than the preset minimum font size, the target font size is changed into the minimum font size, so that the target font size can be controlled within a certain range, and the out-of-range phenomenon is prevented.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It should be noted that the embodiments of the present invention have been described in terms of preferred embodiments, and not by way of limitation, and that those skilled in the art can make modifications and variations of the embodiments described above without departing from the spirit of the invention.
Claims (10)
- A font size control method based on an intelligent terminal is characterized by comprising the following steps:detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the continuous contact duration of the two contacts on the display interface;when the pressure and/or the duration of the contact exceeds a pressure threshold and/or a time threshold, acquiring the font size of the characters in the display interface as an initial font size;obtaining the coordinates of the initial positions and the current positions of the motion tracks of the two contacts on the display interface, and respectively calculating the zoom multiple of a first distance between the two contacts when the two contacts are located at the initial positions and a second distance between the two contacts when the two contacts are located at the current positions;and calculating the size of a target font according to the size of the initial font and the scaling multiple, and adjusting the size of the characters from the size of the initial font to the size of the target font.
- The font size control method of claim 1,the method comprises the steps of detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the continuous contact duration of the two contacts with the display interface, wherein the steps comprise:calling a touch screen event function in the intelligent terminal, and detecting the number of contacts simultaneously received by a display interface of the intelligent terminal;when the situation that the display interface receives two contacts at the same time is detected, the pressure sensor of the intelligent terminal is called, the pressure of the two contacts on the display interface is detected, and/or the duration time of the two contacts continuously contacting the display interface is recorded.
- The font size control method of claim 1,the method comprises the steps of obtaining the coordinates of the initial position and the current position of the motion tracks of the two contacts on the display interface, respectively calculating the first distance between the two contacts when the two contacts are located at the initial position, and the scaling multiple of the second distance between the two contacts when the two contacts are located at the current position, wherein the scaling multiple comprises the following steps:obtaining coordinates of the initial positions of the two contacts, calculating the distance between the initial positions of the two contacts, and recording the distance as a first distance;obtaining the coordinates of the current positions of the two contacts, calculating the distance between the current positions of the two contacts, and recording the distance as a second distance; and dividing the second distance by the first distance to calculate a scaling factor.
- The font size control method according to any one of claims 1 to 3,calculating the target font size according to the initial font size and the scaling multiple, wherein the step of adjusting the characters from the initial font size to the target font size comprises the following steps:calculating a font scaling factor according to the scaling multiple;multiplying the initial font size by the font scaling factor to calculate a target font size;and adjusting the current font from the initial font size to the target font size.
- The font size control method according to claim 4, wherein between the step of multiplying the initial font size by the font scaling factor to calculate a target font size and the step of adjusting the current font from the initial font size to the target font size, the font size control method further comprises:presetting a maximum font size and a minimum font size in the intelligent terminal;and when the target font size exceeds the maximum font size, controlling the target font size to be the maximum font size, and when the target font size is lower than the minimum font size, controlling the target font size to be the minimum font size.
- The utility model provides a typeface size control system based on intelligent terminal which characterized in that includes:the detection module is used for detecting the number of contacts simultaneously received by a display interface of the intelligent terminal, and when the number of the contacts is two, detecting the pressure of the two contacts on the display interface and/or the continuous contact duration time of the two contacts on the display interface;the initial font size acquisition module is connected with the detection module, and when the pressure and/or the duration time of the contact exceeds a pressure threshold and/or a time threshold, the font size of the characters in the display interface is acquired as the initial font size; a zoom factor obtaining module, connected to the initial font size obtaining module, for obtaining coordinates of an initial position and a current position of the motion trajectory of the two contacts on the display interface, and respectively calculating a zoom factor of a first distance between the two contacts when the two contacts are located at the initial position and a second distance between the two contacts when the two contacts are located at the current position;and the font scaling module is connected with the scaling multiple acquisition module, calculates the size of a target font according to the size of the initial font and the scaling multiple, and adjusts the size of the characters from the size of the initial font to the size of the target font.
- The font size control system of claim 6,the detection module comprises:the touch point number detection unit is used for calling a touch screen event function in the intelligent terminal and detecting the number of touch points simultaneously received by a display interface of the intelligent terminal;and the pressure and time detection unit is connected with the contact number detection unit, and when the display interface is detected to simultaneously receive two contacts, the pressure sensor of the intelligent terminal is taken, the pressure of the two contacts on the display interface is detected, and/or the duration time of the two contacts continuously contacting the display interface is recorded.
- The font size control system of claim 6,the zoom factor obtaining module comprises:the first distance acquisition unit is used for acquiring the coordinates of the initial positions of the two contacts, calculating the distance between the initial positions of the two contacts and recording the distance as a first distance;the second distance acquisition unit is used for acquiring the coordinates of the current positions of the two contacts, calculating the distance between the current positions of the two contacts and recording the distance as a second distance;and the scaling factor calculation unit is connected with the first distance acquisition unit and the second distance acquisition unit, divides the second distance by the first distance and calculates the scaling factor.
- The font size control system of any one of claims 6-8,the font scaling module comprises:a font scaling factor calculation unit for calculating a font scaling factor according to the scaling factor;the target font size calculating unit is connected with the font scaling coefficient calculating unit and is used for multiplying the initial font size by the font scaling coefficient to calculate the target font size;and the font size adjusting unit is connected with the target font size calculating unit and is used for adjusting the current font from the initial font size to the target font size.
- The font size control system of claim 9, wherein between the target font size calculation unit and the font size adjustment unit, the font scaling module further comprises:the font size presetting unit is used for presetting the maximum font size and the minimum font size in the intelligent terminal;and the target font size control unit is connected with the font size presetting unit, controls the target font size to be the maximum font size when the target font size exceeds the maximum font size, and controls the target font size to be the minimum font size when the target font size is lower than the minimum font size.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/101590 WO2019051674A1 (en) | 2017-09-13 | 2017-09-13 | Font size control method and font size control system based on intelligent terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111344662A true CN111344662A (en) | 2020-06-26 |
Family
ID=65723400
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201780096720.4A Pending CN111344662A (en) | 2017-09-13 | 2017-09-13 | Font size control method and font size control system based on intelligent terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111344662A (en) |
WO (1) | WO2019051674A1 (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120110438A1 (en) * | 2010-11-03 | 2012-05-03 | Microsoft Corporation | Proportional Font Scaling |
CN103455267A (en) * | 2012-06-04 | 2013-12-18 | 联想(北京)有限公司 | Information processing method and electronic device |
CN105100609A (en) * | 2015-07-10 | 2015-11-25 | 努比亚技术有限公司 | Mobile terminal and shooting parameter adjusting method |
CN105159567A (en) * | 2015-08-27 | 2015-12-16 | 广东欧珀移动通信有限公司 | Character processing method and terminal |
CN105159527A (en) * | 2015-08-26 | 2015-12-16 | 美国掌赢信息科技有限公司 | Method for changing font size in instant message sending process and electronic equipment |
CN105912519A (en) * | 2016-05-27 | 2016-08-31 | 北京京东尚科信息技术有限公司 | Electronic document typesetting method and typesetting device |
CN106227389A (en) * | 2016-08-12 | 2016-12-14 | 乐视控股(北京)有限公司 | A kind of RichText Edition control call method based on screen pressure sensitive and device |
CN106227403A (en) * | 2016-07-14 | 2016-12-14 | 广东欧珀移动通信有限公司 | The method of adjustment of font size and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7366995B2 (en) * | 2004-02-03 | 2008-04-29 | Roland Wescott Montague | Combination tool that zooms in, zooms out, pans, rotates, draws, or manipulates during a drag |
-
2017
- 2017-09-13 CN CN201780096720.4A patent/CN111344662A/en active Pending
- 2017-09-13 WO PCT/CN2017/101590 patent/WO2019051674A1/en active Application Filing
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120110438A1 (en) * | 2010-11-03 | 2012-05-03 | Microsoft Corporation | Proportional Font Scaling |
CN103455267A (en) * | 2012-06-04 | 2013-12-18 | 联想(北京)有限公司 | Information processing method and electronic device |
CN105100609A (en) * | 2015-07-10 | 2015-11-25 | 努比亚技术有限公司 | Mobile terminal and shooting parameter adjusting method |
CN105159527A (en) * | 2015-08-26 | 2015-12-16 | 美国掌赢信息科技有限公司 | Method for changing font size in instant message sending process and electronic equipment |
CN105159567A (en) * | 2015-08-27 | 2015-12-16 | 广东欧珀移动通信有限公司 | Character processing method and terminal |
CN105912519A (en) * | 2016-05-27 | 2016-08-31 | 北京京东尚科信息技术有限公司 | Electronic document typesetting method and typesetting device |
CN106227403A (en) * | 2016-07-14 | 2016-12-14 | 广东欧珀移动通信有限公司 | The method of adjustment of font size and device |
CN106227389A (en) * | 2016-08-12 | 2016-12-14 | 乐视控股(北京)有限公司 | A kind of RichText Edition control call method based on screen pressure sensitive and device |
Also Published As
Publication number | Publication date |
---|---|
WO2019051674A1 (en) | 2019-03-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106843711B (en) | Apparatus and method for processing touch input based on intensity of touch input | |
CN108108100B (en) | Method and device for adjusting playing | |
CN110727496B (en) | Layout method and device of graphical user interface, electronic equipment and storage medium | |
CN106325663B (en) | Mobile terminal and its screenshotss method | |
CN102866856B (en) | Method and device for processing hand-writing input handwritings | |
CN108920066B (en) | Touch screen sliding adjustment method and device and touch equipment | |
US20160048214A1 (en) | Using distance between objects in touchless gestural interfaces | |
WO2015139469A1 (en) | Webpage adjustment method and device, and electronic device | |
CN111897476B (en) | False touch prevention setting method and device | |
CN105677226B (en) | A kind of operating method and mobile terminal to application program | |
CN103354581A (en) | Method and system for automatically adjusting mobile phone control with left or right hand | |
US20170192653A1 (en) | Display area adjusting method and electronic device | |
CN108376030B (en) | Electronic equipment control method and device and electronic equipment | |
CN112394806A (en) | User interface display method and device, electronic equipment and storage medium | |
CN103699331A (en) | Gesture method for controlling screen zooming | |
CN105302459B (en) | Single-hand control method and device for terminal | |
CN104850585A (en) | Method and device for displaying interface while loading information | |
WO2016197743A2 (en) | Touch screen control method and device, and terminal | |
CN111176601B (en) | Processing method and device | |
CN112269481A (en) | Method and device for controlling friction force adjustment and electronic equipment | |
CN111344662A (en) | Font size control method and font size control system based on intelligent terminal | |
CN113311984A (en) | Touch screen track data processing method and device, mobile terminal and electronic equipment | |
CN109416599B (en) | Apparatus and method for processing touch input | |
CN105653016A (en) | Method and device for automatically adjusting presentation style | |
CN107291344A (en) | A kind of method of content selection, device and terminal device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |