Text selection method, device, terminal equipment and readable storage medium
By displaying the start and end marks on the terminal device and adjusting the text character size according to the sliding speed, the problem of users being difficult to accurately select target text is solved, improving selection efficiency and accuracy.
Patent Information
- Application Number
- CN202010239917.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2040-03-30
AI Technical Summary
When a user selects the target text on the terminal device, it is difficult to accurately identify it, resulting in errors in the selection content and inefficient efficiency.
By displaying the start point mark and the end point mark on the display interface of the terminal device, in response to the user's sliding operation, the character size of the text to be selected is adjusted according to the sliding speed, so that the target text is different from the character size of the unselected area.
Improves the accuracy and efficiency of users when selecting target text, reduces the probability of misoperation, and enhances the user experience.
Smart Images

Figure CN113467671B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of terminal control technology, and in particular, relates to a text selection method, apparatus, terminal device and readable storage medium. Background Art
[0002] When using a terminal device, a user often needs to select a target text from the text displayed on the terminal device to perform operations such as copying, cutting, pasting or moving. However, due to the limited display interface of the terminal device, the user may not be able to accurately select the target text when selecting the target text, resulting in errors in the selected content and low efficiency in selecting text. Summary of the invention
[0003] The embodiments of the present application provide a text selection method, apparatus, terminal device and readable storage medium, which can improve the problem that when a user selects a target text, the target text cannot be accurately identified, resulting in easy errors in the selected content and low efficiency in text selection.
[0004] In a first aspect, an embodiment of the present application provides a text selection method, which is applied to a terminal device, wherein a text to be selected is displayed on a display interface of the terminal device, and a starting point mark and an end point mark are displayed on the text to be selected, wherein the starting point mark is used to indicate the starting position of a target text selected in the text to be selected, and the end point mark is used to indicate the end position of the target text, and the text to be selected is displayed in a vector font. The text selection method includes: responding to a sliding operation on a first mark, moving the first mark according to the sliding operation, and the first mark is a starting point mark or an end point mark. According to the moving speed of the first mark, the character size of the text to be selected is adjusted so that the character size of the target text is different from the character size of the first area, and the first area is located in the text area that is not selected in the text to be selected.
[0005] Exemplarily, the terminal device implementing the method of the first aspect may be a device that can be used for text editing, such as a smart phone, a tablet computer, a laptop computer, a wearable device, etc.
[0006] In the above implementation, the size of the characters of the text to be selected is adjusted by the moving speed of the first mark, so that the character size of the selected target text is different from the character size of the unselected first area, thereby highlighting the difference between the target text and the unselected first area. Therefore, to a certain extent, it can make it easier for the user to accurately select the correct target text, reduce the probability of misoperation, improve the efficiency of selection, and enhance the user experience.
[0007] In some embodiments, the character size of the selected text is adjusted according to the moving speed of the first mark so that the character size of the target text is different from the character size of the first area, including: if the moving speed is less than a speed threshold and the number of characters in the target text is less than a word count threshold, the character size of the target text is enlarged and the character size of the first area is reduced, the first area is the first n lines of the line where the starting point mark is located and the last m lines of the line where the end point mark is located, n≥1, m≥1, n and m are both integers.
[0008] In some other embodiments, the character size of the selected text is adjusted according to the moving speed of the first mark so that the character size of the target text is different from the character size of the first area, including: if the moving speed is greater than a speed threshold, or the number of characters in the target text is greater than a word count threshold, the character size of the target text is reduced, the character size of the first area remains unchanged, and the first area is located in the opposite direction of the moving direction of the first mark.
[0009] In a possible implementation, reducing the character size of the target text includes: if the number of characters in the target text is greater than a character number threshold, determining a reduction ratio of the character size of the target text according to the number of characters in the target text, and reducing the character size of the target text according to the reduction ratio.
[0010] In another possible implementation, reducing the character size of the target text includes: if the moving speed is greater than a speed threshold, determining a reduction ratio of the character size of the target text according to the moving speed, and reducing the character size of the target text according to the reduction ratio.
[0011] In some implementations, reducing the character size of the target text and keeping the character size of the first region unchanged includes: keeping the character size of the first region unchanged and reducing the character size of the remaining regions of the selected text except the first region.
[0012] In some embodiments, a function area is also displayed on the display interface of the terminal device, and the function area is used to respond to user operations and execute corresponding functions. The second mark includes a starting point mark and / or an end point mark. If the position of the second mark overlaps with the function area, then before responding to the sliding operation on the first mark, the method also includes: adjusting the character size of the target text so that the position of the second mark does not overlap with the function area.
[0013] In some embodiments, after determining the target text, the method further comprises: in response to a drag operation on the target text, displaying a third mark. In the process of the third mark moving following the drag operation, reducing the size of a plurality of characters adjacent to the third mark. When the drag operation is terminated, moving the target text to the position indicated by the third mark.
[0014] In the second aspect, the embodiment of the present application provides a text selection device, which is applied to a terminal device, wherein the display interface of the terminal device displays a text to be selected, and a starting mark and an end mark are displayed on the text to be selected, wherein the starting mark is used to indicate the starting position of the target text selected in the text to be selected, and the end mark is used to indicate the end position of the target text, and the text to be selected is displayed in a vector font, and the text selection device includes: a response module, which is used to respond to a sliding operation on a first mark, and move the first mark according to the sliding operation, and the first mark is a starting mark or an end mark. An adjustment module is used to adjust the character size of the text to be selected according to the moving speed of the first mark, so that the character size of the target text is different from the character size of the first area, and the first area is located in the text area that is not selected in the text to be selected.
[0015] In some embodiments, the adjustment module is specifically used to enlarge the character size of the target text and reduce the character size of the first area if the moving speed is less than the speed threshold and the number of characters of the target text is less than the word count threshold. The first area is the first n lines before the line where the starting point mark is located and the last m lines after the line where the end point mark is located, n≥1, m≥1, n and m are both integers.
[0016] In some other embodiments, the adjustment module is specifically used to reduce the character size of the target text if the moving speed is greater than a speed threshold, or the number of characters in the target text is greater than a word count threshold, and the character size of the first area remains unchanged, and the first area is located in the opposite direction of the moving direction of the first mark.
[0017] In a possible implementation, the adjustment module is specifically configured to determine a reduction ratio of the character size of the target text according to the number of characters in the target text if the number of characters in the target text is greater than the character number threshold, and reduce the character size of the target text according to the reduction ratio.
[0018] In another possible implementation, the adjustment module is specifically configured to determine a reduction ratio of the target text character size according to the moving speed if the moving speed is greater than the speed threshold, and reduce the target text character size according to the reduction ratio.
[0019] In some implementations, the adjustment module is specifically configured to keep the character size of the first region unchanged and reduce the character size of the remaining regions of the selected text except the first region.
[0020] In some embodiments, a function area is also displayed on the display interface of the terminal device, and the function area is used to respond to user operations and execute corresponding functions. The second mark includes a starting point mark and / or an end point mark. If the position of the second mark overlaps with the function area, the adjustment module is also used to adjust the character size of the target text so that the position of the second mark does not overlap with the function area.
[0021] In some implementations, the response module is further configured to display a third mark in response to a drag operation on the target text. The adjustment module is further configured to reduce the size of a plurality of characters adjacent to the third mark as the third mark moves following the drag operation. When the drag operation is terminated, the target text is moved to the position indicated by the third mark.
[0022] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the methods provided in the first aspect when executing the computer program.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any method provided in the first aspect.
[0024] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to implement any of the methods provided in the first aspect.
[0025] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1 It is a schematic diagram of an application scenario of a text selection method;
[0028] Figure 2 is a flowchart of a text selection method provided in an embodiment of the present application;
[0029] Figure 3 is a schematic diagram of an implementation of the text selection method provided in an embodiment of the present application;
[0030] Figure 4 is a schematic diagram of another implementation of the text selection method provided in an embodiment of the present application;
[0031] Figure 5 is a schematic diagram of another implementation of the text selection method provided in an embodiment of the present application;
[0032] Figure 6 is a schematic diagram of another implementation of the text selection method provided in an embodiment of the present application;
[0033] Figure 7 is a schematic diagram of another implementation of the text selection method provided in an embodiment of the present application;
[0034] Figure 8 is a flowchart of a text selection method provided by another embodiment of the present application;
[0035] Fig. 9 is a schematic diagram of another implementation of the text selection method provided in an embodiment of the present application;
[0036] Fig.10 is a schematic diagram of another implementation of the text selection method provided in an embodiment of the present application;
[0037] Fig.11 is a structural schematic diagram of a text selection device provided in an embodiment of the present application;
[0038] Fig.12 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0040] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0041] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0042] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context.
[0043] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0044] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0045] It should be noted that the text selection method provided in the present application can be applied to terminal devices that support text editing, such as smart phones, tablet computers, wearable devices, vehicle-mounted devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of terminal devices.
[0046] Figure 1 A schematic diagram of an application scenario of a text selection method is shown, in which a terminal device is a smart phone as an example for explanation. The screen of the smart phone displays the text to be selected, wherein an X represents a character in the text to be selected. When the smart phone detects the user's mode switching operation (such as a long press operation) and determines that the user needs to select text, the smart phone switches to the editing mode and displays the starting point mark 11 and the end point mark 12 on the text to be selected. Then, after the user's click position is detected, the mark selected by the user to move is determined, and the mark is moved with the user's sliding operation. For example, if it is detected that the user clicks the end point mark 12, the end point mark 12 is moved along the trajectory of the user's sliding operation on the mobile phone screen. Among them, the starting point mark 11 is used to indicate the starting position of the selected target text, and the end point mark 12 is used to indicate the end position of the target text. As the end point mark 12 moves, the content of the target text also changes accordingly.
[0047] In the above process of selecting text, the starting mark 11 and the end mark 12 will block part of the text to be selected, and when the user slides the starting mark 11 or the end mark 12, the finger will also block part of the text to be selected. Since the character size of all the texts to be selected is the same, it is easy to cause misoperation. For example, when the user selects the target text, if the end mark 12 is dragged, the user may not be able to see the text near the end mark due to the finger blocking, and the end mark may be left in the wrong position during dragging, resulting in the target text selection error. In addition, when the user selects a large amount of text in multiple consecutive pages, it is necessary to perform a long-term sliding operation across pages on the screen to select the text, and it is also easy to cause misoperation and selection errors during the period. For example, if you slide to the bottom of the current page during the sliding operation, you need to wait for the page to slide to continue to select text. If the finger touches other areas or leaves the display area by mistake, it will cause the wrong target text to be selected, and the efficiency and accuracy of the selection will be affected.
[0048] In this regard, the present application provides a text selection method: in response to a sliding operation on a first mark, the first mark is moved according to the sliding operation, and the first mark is a starting mark or an end mark. According to the moving speed of the first mark, the character size of the selected text is adjusted so that the character size of the target text is different from the character size of the first area. The first area is located in the unselected text area of the selected text.
[0049] In the method, the size of the characters of the to-be-selected text is adjusted by the moving speed of the first mark, so that the character size of the selected target text is different from the character size of the unselected first area, thereby highlighting the difference between the target text and the unselected first area. Therefore, to a certain extent, it can make it easier for the user to accurately select the correct target text, reduce the probability of misoperation, improve the efficiency of selection, and thus enhance the user experience.
[0050] The method provided in this application is exemplarily described below in conjunction with specific embodiments.
[0051] It should be noted that, in the present application, the text to be selected is displayed using a vector font, and the size of each character in the text to be selected (such as parameters such as character width, character height, and character weight) can be adjusted.
[0052] Figure 2 A flowchart of a text selection method provided in an embodiment of the present application is shown. As an example but not a limitation, the method can be applied to the above-mentioned terminal devices. Here, a smart phone is taken as an example for explanation.
[0053] S21. In response to a sliding operation on the first mark, move the first mark according to the sliding operation.
[0054] Among them, the first mark is a starting point mark or an end point mark.
[0055] In some embodiments, reference Figure 1 In the example of , the smartphone first responds to the selection mode switching operation to enter the selection mode. The selection mode switching operation is not limited to long pressing the text to be selected, but can also be a click operation, a double-click operation, a preset gesture trajectory, etc.
[0056] After entering the selection mode, if a sliding operation is received, the sliding operation object is determined to be the starting point mark or the end point mark according to the area where the sliding operation is applied. Figure 1 , the area covered by the starting mark 11 or the end mark 12 is the response area of the starting mark 11 or the end mark 12, which can respond to the sliding operation acting on the response area. When the user clicks on the mark pattern, the smart phone can determine which mark the user clicked through the corresponding response area. Then when the user's sliding operation is detected, the smart phone can move the first mark according to the sliding operation to achieve text selection. The setting of the response area may not be limited to the area covered by the mark. For example, it may also be a larger area including the mark coverage area, or other areas associated with the mark but not overlapping with the mark coverage area, which are not limited here.
[0057] Since the trajectory of the sliding operation changes in real time, after the sliding operation acts on the first mark, the moving speed of the first mark also changes in real time. To determine the moving speed of the first mark, the sliding speed at each moment of the sliding operation can be obtained first, where the sliding speed includes the sliding rate and the sliding direction. The smartphone can determine the moving speed of the first mark at that moment based on the sliding speed in the vertical direction (i.e., the direction perpendicular to the line in the text to be selected) and the sliding speed in the vertical direction (i.e., the direction parallel to the line in the text to be selected).
[0058] For example, when the sliding speed of the sliding operation in the vertical direction is greater than the first speed threshold, the sliding operation indicates that the first mark moves in the vertical direction (i.e., moves across rows), and the moving direction of the first mark is the vertical direction. Alternatively, when the sliding speed of the sliding operation in the horizontal direction is greater than the second speed threshold, the sliding operation indicates that the first mark moves in the horizontal direction (i.e., moves to the front or back of the first mark within the row), and the moving direction of the first mark is the horizontal direction. It should be noted that the sliding operation can satisfy the above two conditions at the same time, and in this case, the moving direction of the first mark can include the vertical direction and the horizontal direction.
[0059] S22, determine whether the moving speed of the first mark is greater than the speed threshold, if so, execute S23, otherwise execute S24.
[0060] In a possible implementation, since the speed threshold is only used to determine whether the magnitude of the moving speed of the first mark meets the threshold. Therefore, when the moving speed of the first mark is greater than the speed threshold, it can be determined that the moving speed of the first mark is greater than the speed threshold. The moving speed of the first mark should be the sum of the moving speed of the first mark in the vertical direction and the moving speed in the horizontal direction. Assuming that the moving speed is measured by the number of characters added per second, if each line of the selected text displayed by the smartphone includes 20 characters, and one line is moved in the vertical direction every second, the moving speed in the vertical direction can be recorded as 20 characters / second. If one character is moved in the horizontal direction every second, the moving speed in the horizontal direction can be recorded as 1 character / second. For example, if two lines are moved in the vertical direction every second, the moving speed in the vertical direction is 40 characters / second. If two characters are moved in the horizontal direction every second, the moving speed in the horizontal direction is 2 characters / second. At this time, the moving speed is the sum of the moving speed in the vertical direction and the moving speed in the horizontal direction, that is, 42 characters / second. The speed threshold can be set according to the actual application situation, such as 20 characters / second, 45 characters / second, 50 characters / second, etc., and is not limited here.
[0061] S24, determine whether the number of characters in the target text is greater than the word count threshold, if so, execute S23, otherwise execute S25.
[0062] In some other implementations, a large amount of text is selected (the number of characters of the target text is greater than the word count threshold), and the character size of the target text may be reduced to display more text to be selected in the display interface.
[0063] S23: Reduce the character size of the target text, and keep the character size of the first area unchanged.
[0064] In some implementations, if the moving speed of the first mark is greater than the speed threshold, then when executing S23, the reduction ratio of the target text character size can be first determined according to the moving speed of the first mark. Then, the target text character size can be reduced according to the determined reduction ratio. The larger the moving speed of the first mark, the smaller the character size of the target text can be set.
[0065] In a possible implementation, when the moving speed of the first mark is greater than the speed threshold, the character height of the target text is reduced by a first preset ratio. Then, each time the preset speed is increased, the character height of the target text is reduced by the first preset ratio.
[0066] For example, if the speed threshold is 20 characters / second, the preset speed is 2 characters / second, and the first preset ratio is 1%, that is, after the moving speed of the first mark is greater than 20 characters / second, the character height of the target text is reduced by 1%. After that, the character height of the target text is reduced by 1% for every 2 characters / second increase in the moving speed of the first mark. For example, if the moving speed of the first mark is 21 characters / second, the character height of the target text is adjusted to 99% of the original character height; if the moving speed of the first mark is 30 characters / second, the character height of the target text is adjusted to 95% of the original character height.
[0067] In another possible implementation, if the moving speed of the first mark meets the preset speed range, the character height of the target text is reduced by the corresponding proportion. For example, if the preset speed range includes: 20 characters / second (speed threshold) < moving speed ≤ 70 characters / second, 70 characters / second < moving speed ≤ 120 characters / second. When the moving speed is greater than 20 characters / second and less than or equal to 70 characters / second, the corresponding ratio is 20%, and the character height of the target text can be set to 80% of the original character height. When the moving speed is greater than 70 characters / second and less than or equal to 120 characters / second, the corresponding ratio is 40%, and the character height of the target text can be set to 60% of the original character height. There can be multiple corresponding relationships between the preset moving speed range and the reduction ratio of the character size, which are not limited here.
[0068] It should also be noted that during the movement, the character size in the first area can be kept unchanged, and the first area is located in the opposite direction of the movement direction of the first mark. For example, if the first mark is the end mark, and the end mark moves downward in response to the sliding operation, the first area can be all the text to be selected before the starting mark.
[0069] In one implementation, the character size of the remaining area of the selected text except the first area can also be reduced. For example, if the first mark is an end mark, and the end mark moves downward in response to the sliding operation, the character size after the end mark can also be reduced, and the reduction ratio can be the same as that of the target text, but is not limited thereto.
[0070] Figure 3 A schematic diagram of an implementation of a text selection method is shown. Figure 3 As shown, the speed threshold can be set to 20 characters / second, and the end mark 12 can be slid downward from the dotted line position. If the moving speed is 60 characters / second, the height of the target text and the characters of the selected text except the first area can be set to 80% of the original character height (the reduced "X" shown in the figure). If the moving speed is 80 characters / second, the height of the target text and the characters of the selected text except the first area can be set to 60% of the original character height (not shown in the figure).
[0071] In some implementations, the line spacing of the characters after the reduction can also be reduced so that more text to be selected can be displayed in the display interface. The reduction method of the line spacing can refer to the reduction method of the character height, which will not be described in detail here.
[0072] In this embodiment, the character size of the target text is reduced according to the movement rate of the first mark, so that more text to be selected can be displayed in the display interface. When the user quickly selects a large amount of text, there is no need to wait for the page of text to be selected, which improves the efficiency of text selection.
[0073] In some other implementations, if the number of characters in the target text is greater than the character number threshold, when executing S23, the reduction ratio of the character size of the target text may be first determined according to the number of characters in the target text, and then the character size of the target text may be reduced according to the determined reduction ratio.
[0074] As an example only and not a limitation, during the movement of the first mark, the number of characters of the selected target text also changes accordingly. The more characters of the selected target text, the smaller the character size of the target text can be set.
[0075] In a possible implementation, when the number of characters in the target text is greater than the word count threshold, the character height of the target text is reduced by a second preset ratio. Then, after each increase in the preset number of characters, the character height of the target text is reduced by the second preset ratio.
[0076] For example, if the character count threshold is 50 characters, the preset character count is 50 characters, and the second preset ratio is 5%. That is, after the number of characters in the target text is greater than 50 characters, the height of the characters in the target text is reduced by 5%. After that, the height of the characters in the target text is reduced by 5% for every 50 characters in the target text. For example, if the number of characters in the target text is 51 characters, the character height of the target text is adjusted to 95% of the original character height; if the moving speed of the first mark is 178 characters, the character height of the target text is adjusted to 85% of the original character height.
[0077] In another possible implementation, if the number of characters in the target text meets the preset word count interval, the character height of the target text is reduced by the corresponding ratio. For example, if the preset word count interval includes: 50 characters (word count threshold) < number of characters in the target text ≤ 150 characters, 150 characters < number of characters in the target text ≤ 250 characters. When the number of characters is greater than 50 characters and less than or equal to 150 characters, the corresponding ratio is 20%, and the height of the target text characters can be set to 80% of the original character height. If the number of characters is greater than 150 characters and less than or equal to 250 characters, the corresponding ratio is 40%, and the height of the target text characters can be set to 60% of the original character height. There can be multiple corresponding relationships between the preset word count interval and the ratio of reducing the character size, which are not limited here.
[0078] It should be noted that during the movement, the character size in the first area can be kept unchanged. The character size of the remaining area of the selected text except the first area can also be reduced. The reduction method is the same as the method of reducing the target text, which will not be repeated here.
[0079] Figure 4 A schematic diagram of an implementation of a text selection method is shown. Figure 4 As shown, the word count threshold can be set to 50 characters. Slide the starting point mark 11 from the dotted line position to the upper right. If the moving speed of the starting point mark 11 is less than the speed threshold (20 characters / second) during the movement, but the number of characters in the target text is greater than 50 characters and less than or equal to 150 characters. Then the height of the target text and the characters of the text to be selected except the first area can be set to 80% of the original character height (the reduced "X" shown in the figure). If the movement continues, when the number of characters in the target text is greater than 150 characters and less than or equal to 250 characters, the height of the target text and the characters of the text to be selected except the first area can be set to 60% of the original character height (not shown in the figure).
[0080] Similarly, the line spacing of the characters after the reduction can also be reduced so that more text to be selected can be displayed in the display interface. The method of reducing the line spacing can refer to the method of reducing the character height, which will not be described in detail here.
[0081] In this embodiment, the character size of the target text is reduced according to the number of characters in the target text, so that more text to be selected can be displayed in the display interface. When the user selects a large amount of text at a slow speed, there is no need to wait for the page of text to be selected, which improves the efficiency of selecting text.
[0082] S25: Enlarging the character size of the target text and reducing the character size of the first area.
[0083] In some implementations, when the moving speed of the first mark does not exceed the speed threshold and the number of characters in the target text does not exceed the word count threshold, it indicates that the user's sliding operation has made a more accurate selection. At this time, the character size of the target text can be enlarged and the character size of the first area can be reduced. The first area is the first n rows of the row where the starting mark is located and the last m rows of the row where the end mark is located, n≥1, m≥1, and n and m are both integers.
[0084] Figure 5 A schematic diagram of an implementation of a text selection method is shown. Figure 5 As shown, the end point mark 12 is slid rightward from the dotted line position. During the movement, if the moving speed of the end point mark 12 is less than the speed threshold (such as 20 characters / second) and the number of characters in the target text is less than the word number threshold (such as 50 characters), the size of the target text characters can be set to 120% of the original character size (each character is represented by an enlarged "X" shown in the figure).
[0085] At the same time, the multiple characters before the starting point mark and the multiple characters after the end point mark can also be enlarged, so that the user can select the target text more accurately. Figure 5 , you can set the two characters before the start mark and the two characters after the end mark to 120% of the original character size.
[0086] Since some characters are enlarged, the original position of the paragraph or page may also change. In this case, the width or size of the characters in the first area can be adjusted. The adjustment range and the number of characters are based on the original position of the selected text in the paragraph or page. For example, Figure 5 In the figure, the character size of the line before the line where the starting point mark 11 is located and the line after the line where the end point mark 12 is located is reduced to 80% of the original character size (each character is represented by a reduced "X" shown in the figure). This ensures that the entire paragraph of text in the page remains in its original position, making the page complete and beautiful.
[0087] If the end mark 12 continues to move, when the number of characters in the target text is greater than the character threshold, the method in S23 may be referred to for processing.
[0088] In this embodiment, the character size of the target text is enlarged so that the user can more clearly and accurately view the text to be selected displayed on the display interface, so that the user's sliding operation can act more accurately on the first mark, reducing the probability of user misoperation and improving the efficiency of text selection.
[0089] In some implementations, after the sliding operation on the first mark is completed (ie, after the target text is determined), the characters whose sizes have been adjusted and the line spacing between the characters may be restored.
[0090] In some other embodiments, at least one functional area may be displayed on the display interface of the smartphone, and the functional area is used to respond to user operations and perform corresponding functions. The second mark includes a starting point mark and / or an end point mark. If the position of the second mark overlaps with the functional area, then before responding to the sliding operation on the first mark, the text selection method further includes: adjusting the character size of the target text so that the position of the second mark does not overlap with the functional area.
[0091] Reference Figure 6 , the position of the second mark (starting point mark 11 and / or ending point mark 12) may overlap with the first functional area 13 or the second functional area 14. It should be noted that Figure 6 The figure is only a schematic diagram of the overlap between the second mark and the functional area, and does not limit the starting mark 11 to overlap with the first functional area 13 or the end mark 12 to overlap with the second functional area 14. It is also possible that the starting mark 11 overlaps with the functional area 14 or the end mark 12 overlaps with the second functional area 13. The position of the second mark is not limited by the shape and size of the mark shown in the figure, and can also be a larger area including the second mark, or other areas associated with the second mark but not overlapping with the area covered by the second mark, etc. The position, shape and corresponding function of the functional area are also not limited here.
[0092] exist Figure 6 In the example, a sliding operation on the second mark position may be misjudged as being applied to functional area 13 or functional area 14, resulting in an erroneous operation.
[0093] To do this, you can adjust the character size of the target text so that the position of the second mark does not overlap with the functional area. Figure 6 and Figure 7 In a possible implementation, when the position of the starting mark 11 overlaps with the first functional area 13, the character width of the line where the starting mark 11 is located can be adjusted so that the position of the starting mark 11 does not overlap with the first functional area 13. It should be noted that when adjusting the character width of the line where the starting mark 11 is located, the entire line can be adjusted, or part of the characters can be adjusted, so as to achieve that the position of the starting mark 11 does not overlap with the first functional area 13. For example, Figure 7 In the example, the character width of the character in the row where the start mark 11 is located is adjusted to 80% of the original character width, so that the position of the start mark 11 does not overlap with the first functional area 13. When the position of the end mark 12 overlaps with the second functional area 14, a similar adjustment can be made. Alternatively, the character sizes of all target texts can be adjusted so that the position of the second mark does not overlap with the functional area, which is not limited here.
[0094] In this embodiment, when the position of the second mark overlaps with the functional area, the character size of the target text is adjusted so that the position of the second mark does not overlap with the range of the functional area. This can effectively reduce the possibility of the user misoperating the functional area when performing a sliding operation, and improve the accuracy and efficiency of text selection.
[0095] In some embodiments, Figure 8 As shown, after obtaining the selected text, the method further includes:
[0096] S31. In response to a drag operation on a target text, a third mark is displayed.
[0097] Please refer to Fig. 9 ,Each character of the target text is represented by a “Y” in the figure, and the drag operation acts on the target text.
[0098] For example only and not limitation, please refer to Fig.10 After responding to the drag operation, the target text can be displayed in the form of a floating window 16, and a third mark 15 can be displayed at the position of the original target text to clearly indicate that the target text should be inserted at the position of the third mark 15.
[0099] S32. When the third mark moves following the drag operation, reduce the sizes of a plurality of characters adjacent to the third mark.
[0100] In some implementations, the sizes of the multiple characters adjacent to the third mark may be reduced so that the third mark can be clearly identified in the text to be selected. Fig.10 As an example only and not a limitation, the width of the 6 characters before and the 4 characters after the third mark 15 can be set to 60% of the original width, so that there is a gap before and after the third mark 15, which is convenient for users to identify and drag the third mark 15.
[0101] When the third mark 15 responds to the dragging operation, after the third mark is dragged, the character width settings of the characters above and below the third mark 15 can still be maintained, so that the user can accurately identify the position of the third mark 15 even after the third mark 15 is dragged.
[0102] S33. When the dragging operation is terminated, move the target text to the position indicated by the third mark.
[0103] In some implementations, please refer to Fig.10 When the dragging operation is terminated, the target text in the floating window 16 is inserted to the position of the third mark 15. For example, after the dragging operation is completed, the target text can be inserted into the position indicated by the third mark 15, and the shrunk characters can be restored to their original state.
[0104] In this embodiment, by reducing the size of characters above and / or below the third mark, the third mark can be more clearly identified in the selected text, so that the user can perform the drag operation more accurately, reduce misoperations, and improve operation efficiency.
[0105] In a possible implementation, before responding to the drag operation on the selected text, the selected text may also be edited in response to an edit operation on the selected text. The edit operation may include copying, cutting, pasting, moving, etc. For example, after determining the selected text, a floating box including the edit operation may be displayed on the selected text, and the user operation on the floating box may be responded to to determine the edit operation on the selected text.
[0106] If the drag operation is not responded to within the preset time after the editing operation is completed, the selected text is deselected. As an example only and not a limitation, assuming that the preset time is 2 seconds, the selected text can be copied or cut first. After the selected text is pasted to the target location, if the drag operation on the selected text is not responded to within 2 seconds, the selected text can be deselected and the editing is completed.
[0107] It should also be noted that the sliding operation, long press operation and other operations on the selected text or target text mentioned in this application can be operations received through a touch screen. For example, operations are performed on the touch screen by fingers or a touch device (such as a stylus). It can also be an operation input by other control devices. Other control devices may include a mouse, a keyboard, a trackball, a touchpad, and the like. For example, when the other control device is a mouse, a long press operation can be achieved by keeping the left button of the mouse clicked, and a sliding operation can be achieved by keeping the left button of the mouse clicked and sliding the mouse. There is no restriction on the implementation method of sliding operations, long press operations and the like in this application.
[0108] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0109] Corresponding to the text selection method of the above embodiment, Fig.11 A schematic diagram of the structure of a text selection device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0110] In some embodiments, the text selection device is applied to a terminal device, and a text to be selected is displayed on a display interface of the terminal device. A starting mark and an end mark are displayed on the text to be selected. The starting mark is used to indicate the starting position of the target text selected in the text to be selected, and the end mark is used to indicate the end position of the target text. The text to be selected is displayed in a vector font. Fig.11 As shown, the text selection device includes:
[0111] The response module 41 is used to respond to a sliding operation on a first mark and move the first mark according to the sliding operation, where the first mark is a starting point mark or an end point mark.
[0112] The adjustment module 42 is used to adjust the character size of the text to be selected according to the moving speed of the first mark so that the character size of the target text is different from the character size of the first area, and the first area is located in the unselected text area of the text to be selected.
[0113] In some embodiments, the adjustment module 42 is specifically used to enlarge the character size of the target text and reduce the character size of the first area if the moving speed is less than the speed threshold and the number of characters of the target text is less than the word count threshold. The first area is the first n lines of the line where the starting point mark is located and the last m lines of the line where the end point mark is located, n≥1, m≥1, and n and m are both integers.
[0114] In some other embodiments, the adjustment module 42 is specifically used to reduce the character size of the target text if the moving speed is greater than a speed threshold, or the number of characters in the target text is greater than a word count threshold, and the character size of the first area remains unchanged, and the first area is located in the opposite direction of the moving direction of the first mark.
[0115] In a possible implementation, the adjustment module 42 is specifically configured to determine a reduction ratio of the character size of the target text according to the number of characters in the target text if the number of characters in the target text is greater than the character number threshold, and reduce the character size of the target text according to the reduction ratio.
[0116] In another possible implementation, the adjustment module 42 is specifically configured to determine the reduction ratio of the target text character size according to the moving speed if the moving speed is greater than the speed threshold, and reduce the target text character size according to the reduction ratio.
[0117] In some implementations, the adjustment module 42 is specifically configured to keep the character size of the first region unchanged, and reduce the character size of the remaining regions of the selected text except the first region.
[0118] In some embodiments, a function area is also displayed on the display interface of the terminal device, and the function area is used to respond to user operations and execute corresponding functions. The second mark includes a starting point mark and / or an end point mark. If the position of the second mark overlaps with the function area, the adjustment module 42 is also used to adjust the character size of the target text so that the position of the second mark does not overlap with the function area.
[0119] In some implementations, the response module 41 is further configured to display a third mark in response to a drag operation on the target text. The adjustment module 42 is further configured to reduce the size of a plurality of characters adjacent to the third mark as the third mark moves following the drag operation. When the drag operation is terminated, the target text is moved to the position indicated by the third mark.
[0120] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0121] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0122] Fig.12 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig.12 As shown, the terminal device 5 includes: at least one processor 51 ( Fig.12 Only one is shown in the figure), a memory 52, and a computer program 53 stored in the memory 52 and executable on at least one processor 51, wherein the processor 51 implements the steps of any of the above-mentioned text selection method embodiments when executing the computer program 53.
[0123] The terminal device 5 can be a smart phone, a notebook, a tablet computer, a PDA, or other device capable of selecting and editing text. Those skilled in the art will appreciate that Fig.12It is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, touch devices, etc.
[0124] The processor 51 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0125] In some embodiments, the memory 52 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. In other embodiments, the memory 52 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 5. Further, the memory 52 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 52 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program, etc. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0126] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0127] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0128] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0131] In the embodiments provided in the present application, it should be understood that the disclosed terminal device and method can be implemented in other ways. For example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A text selection method, applied to a terminal device, wherein a text to be selected is displayed on a display interface of the terminal device, and a starting mark and an end mark are displayed on the text to be selected, wherein the starting mark is used to indicate the starting position of a target text selected from the text to be selected, and the end mark is used to indicate the end position of the target text, characterized in that: The text to be selected is displayed in a vector font, and the text selection method includes: In response to a sliding operation on a first mark, the first mark is moved according to the sliding operation, and the first mark is the starting point mark or the end point mark; According to the moving speed of the first mark, the character size of the text to be selected is adjusted so that the character size of the target text is different from the character size of the first area, and the first area is located in the unselected text area of the text to be selected; wherein, the character size of the text to be selected is adjusted according to the moving speed of the first mark, including: if the moving speed is greater than a speed threshold, or the number of characters in the target text is greater than a word count threshold, the character size of the target text is reduced, the character size of the first area remains unchanged, and the first area is located in the opposite direction of the moving direction of the first mark; if the moving speed is less than the speed threshold, and the number of characters in the target text is less than the word count threshold, the character size of the target text is enlarged, and the character size of the first area is reduced, and the first area is the first n rows of the row where the starting point mark is located and the last m rows of the row where the end point mark is located, n≥1, m≥1, n and m are both integers; In response to a drag operation on the target text, displaying a third mark; In the process that the third mark moves following the drag operation, reducing the sizes of a plurality of characters adjacent to the third mark; When the dragging operation is terminated, the target text is moved to the position indicated by the third mark.
2. The method according to claim 1, characterized in that The step of reducing the character size of the target text comprises: If the number of characters in the target text is greater than the character number threshold, determining a reduction ratio of the character size of the target text according to the number of characters in the target text; The character size of the target text is reduced according to the reduction ratio.
3. The method according to claim 1, characterized in that The step of reducing the character size of the target text comprises: If the moving speed is greater than a speed threshold, determining a reduction ratio of the target text character size according to the moving speed; The character size of the target text is reduced according to the reduction ratio.
4. The method according to claim 1, characterized in that The step of reducing the character size of the target text while keeping the character size of the first area unchanged includes: The character size of the first area is kept unchanged, and the character size of the remaining area of the text to be selected except the first area is reduced.
5. The method according to any one of claims 1 to 4, characterized in that: The display interface of the terminal device also displays a function area, and the function area is used to respond to user operations and perform corresponding functions. The second mark includes the starting point mark and / or the end point mark. If the position of the second mark overlaps with the function area, before responding to the sliding operation acting on the first mark, the method further includes: The character size of the target text is adjusted so that the position of the second mark does not overlap with the functional area.
6. A text selection device, applied to a terminal device, wherein a text to be selected is displayed on a display interface of the terminal device, and a starting mark and an end mark are displayed on the text to be selected, wherein the starting mark is used to indicate the starting position of a target text selected from the text to be selected, and the end mark is used to indicate the end position of the target text, characterized in that: The text to be selected is displayed in a vector font, and the text selection device includes: a response module, configured to respond to a sliding operation on a first mark and move the first mark according to the sliding operation, wherein the first mark is the starting mark or the end mark; An adjustment module, used for adjusting the character size of the text to be selected according to the moving speed of the first mark, so that the character size of the target text is different from the character size of the first area, and the first area is located in the unselected text area of the text to be selected; the adjustment module is specifically used for reducing the character size of the target text if the moving speed is greater than a speed threshold, or the number of characters in the target text is greater than a word count threshold, and keeping the character size of the first area unchanged, and the first area is located in the opposite direction of the moving direction of the first mark; if the moving speed is less than the speed threshold, and the number of characters in the target text is less than the word count threshold, then enlarging the character size of the target text and reducing the character size of the first area, the first area being the first n rows of the row where the starting point mark is located and the last m rows of the row where the end point mark is located, n≥1, m≥1, and n and m are both integers; The response module is also used to respond to the drag operation on the target text and display the third mark; the adjustment module is also used to reduce the size of multiple characters adjacent to the third mark while the third mark moves following the drag operation; when the drag operation is terminated, the target text is moved to the position indicated by the third mark.
7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Processing method of text and touch panel equipment
CN103718149A
Method and device for editing text and terminal
CN104834433A
Text selection method and mobile terminal
CN105373309A