Marking method and electronic device

By adjusting the font and paragraph format of the document file and using preset operations to generate blank areas for annotation, the problem of annotation content covering the original content is solved, and the user reading experience is improved.

CN113591432BActive Publication Date: 2025-09-26HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010366858.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-30
Publication Date
2025-09-26
Estimated Expiration
2040-04-30

AI Technical Summary

Technical Problem

Since the display screen size of electronic devices such as mobile phones and tablets is limited, the blank area of ​​document files is also limited. If there is too much annotation content, the content of the original document file will be covered, resulting in a poor reading experience for users.

Method used

By adjusting the font format and/or paragraph format of part of the content in the document file, more blank area is reserved to avoid overlap between the annotation content and the document file content, and using preset operations such as sliding tracks to compress the text, a second area is generated for the annotation content.

Benefits of technology

Without reducing the content displayed on the current page, more blank space is provided for annotation, which improves the user's reading experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113591432B_ABST
    Figure CN113591432B_ABST
Patent Text Reader

Abstract

The present application provides a marking method and electronic device, which relate to the field of terminal technology and can adjust the font format and / or paragraph format of at least part of the content in a document file to reserve more blank areas for marking, so that the marked content does not overlap with the content of the document file, thereby improving the user's reading experience. The method includes: the electronic device displays the content of the first file on a first interface. The electronic device detects a preset operation on the first interface and displays a second interface including a first area and a second area. The first area is used to display the content of the first file, and the second area is used to display the marked content; at least part of the text in the first area is different from the font format and / or paragraph format of the text in the first file in the first interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a marking method and electronic equipment. Background Art

[0002] Currently, electronic devices such as mobile phones and tablets are equipped with a feature for annotating document files (such as Word files and PDF files). Users can add annotations such as text and images to blank areas of document files. Due to the limited display screen size of electronic devices such as mobile phones and tablets, the blank areas of document files are also limited. Excessive annotations can cause the annotations to cover the original content of the document file, resulting in a poor reading experience for users. Summary of the Invention

[0003] The annotation method and electronic device provided in this application can adjust the font format and / or paragraph format of at least part of the content in a document file to reserve more blank area for annotation, so that the annotation content does not overlap with the content of the document file, thereby improving the user's reading experience.

[0004] To achieve the above objectives, this application adopts the following technical solutions:

[0005] In a first aspect, the present application provides a method for annotation, which may include: an electronic device displaying a first interface; the first interface displaying the contents of a first file; and in response to detecting a preset operation on the first interface, the electronic device displaying a second interface. The second interface includes a first area and a second area, the first area being used to display the contents of the first file, and the second area being used to display annotation content. At least some of the text in the first area has a different font format and / or paragraph format than the text in the first file on the first interface.

[0006] Among them, the first interface is the interface of the first application, and the first application is an application that can edit or display document files. The first interface can be used to display the content of the document file, that is, the first file is a document file (such as a word file, a PDF file, a web page, etc.). For example, the first interface is an interface displayed after detecting that the user performs an operation to enter the annotation mode, or the first interface is a reading interface of the document file. The second interface is an interface displayed in the annotation mode of the mobile phone, and the electronic device detects the annotation content on the second interface. Among them, the operation of executing the annotation mode may include, for example, the operation of clicking the stylus button, the user's specific operation on the reading interface of the document file (such as manipulating a certain control, long pressing, double-clicking, etc.), voice commands, floating gestures, etc.

[0007] In this way, the electronic device can adjust the font format and / or paragraph format of at least part of the content in the document file to reserve more blank area for annotation, so that the annotation content does not overlap with the content of the document file, thereby improving the user's reading experience.

[0008] In addition, by adjusting the font format and / or paragraph format of at least part of the content in the document file to achieve a larger blank area for annotation, the content displayed in the document file on the current page is not reduced, and the addition of annotation content will not cause inconvenience to the user in reading the original document file.

[0009] In a possible implementation, the preset operation is a sliding operation performed by the user along a preset trajectory, where the preset trajectory includes one or more of the following: a slash segment, a closed figure, and a preset symbol.

[0010] The sliding operation of the preset trajectory may be a sliding of the user's finger on the mobile phone screen, or a sliding of the user's stylus on the mobile phone screen.

[0011] In this way, the electronic device can determine the portion of text in the first file that needs to be compressed and the corresponding compression strategy based on the different sliding tracks of the detected preset operation. Subsequently, the electronic device compresses the portion of text in the first file that needs to be compressed using the compression strategy to obtain the corresponding second area.

[0012] In a possible implementation, the font format of the text includes one or more of the following: character height, character width, and character weight; the paragraph format of the text includes character spacing and / or line spacing.

[0013] The compression strategy may include a strategy for adjusting the font format and / or paragraph format of some text in the first file. Different compression strategies corresponding to different sliding trajectories of preset operations may be pre-configured in the electronic device, and the electronic device may adaptively match different compression strategies after detecting different sliding trajectories.

[0014] In one possible implementation, in response to detecting a preset operation on a first interface, the electronic device displays a second interface, including: in response to detecting a preset operation on the first interface, the electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding trajectory of the preset operation to obtain a second area; the electronic device displays a second interface including the second area.

[0015] In this way, the electronic device adjusts the font format and / or paragraph format of a portion of the text in the first file to obtain a second area near the adjusted text. For example, the electronic device compresses the font height and line spacing of a portion of the text in the first file downward, and a corresponding second area is obtained above the compressed text.

[0016] In one possible implementation, the electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding trajectory of a preset operation to obtain a second area, including: when the sliding trajectory of the preset operation is a slash segment and the width of the slash segment is greater than a first threshold, the electronic device compresses the character height and / or line spacing of the line where the text covered by the slash segment is located to obtain the second area; or, when the sliding trajectory of the preset operation is a slash segment and the width of the slash segment is less than or equal to the first threshold, the electronic device compresses the character width and / or character spacing of the line where the text covered by the slash segment is located, or compresses the character width and / or character spacing of the text covered by the slash segment to obtain the second area.

[0017] The width of the oblique line segment is the width of the text content displayed on the second display page covered by the oblique line segment. The mobile phone can determine the portion of text content that needs to be compressed based on this width. The first threshold value can be a custom threshold value, such as the first threshold value being 50% of the width of the text content displayed on the first interface. Oblique line segments can be divided into long oblique line segments and short oblique line segments. The electronic device can determine whether the currently detected oblique line segment is a long oblique line segment based on the first threshold value. If the width of the oblique line segment is greater than the first threshold value, the oblique line segment is a long oblique line segment.

[0018] In some embodiments, different compression strategies can be configured for long oblique line segments and short oblique line segments, and correspond to different parts of the first text that need to be compressed. Then, the electronic device can obtain different second areas according to the width of the oblique line segments.

[0019] For example, if the electronic device detects that a diagonal line segment input on the first interface has a width exceeding a preset width and an inclination angle exceeding a preset inclination angle, the electronic device may determine that the current diagonal line segment is a sliding trajectory corresponding to a preset operation. The preset width and preset angle may be pre-configured in the electronic device by the manufacturer based on empirical values ​​or user habits; alternatively, the mobile phone may directly receive custom values ​​set by the user.

[0020] Then, the electronic device determines whether the currently detected sliding track corresponds to a long or short slash segment according to the preset operation of the slash segment based on the first threshold, and then compresses the parts of the first file corresponding to the different sliding tracks using the corresponding compression strategy to obtain the second area.

[0021] In one possible implementation, when the width of the oblique line segment is greater than a first threshold and the oblique line segment is tilted upward, the compressed text is located above or below the second area; when the width of the oblique line segment is greater than the first threshold and the oblique line segment is tilted downward, the compressed text is located below or above the second area; when the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted upward, the compressed text is located on the left or right side of the second area; when the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted downward, the compressed text is located on the right or left side of the second area.

[0022] Among them, the mobile phone can determine the inclination direction of the current oblique line segment based on the detected positions of the left endpoint and the right endpoint of the oblique line segment. For example, if the left endpoint is higher than the right endpoint, the inclination direction of the oblique line segment is downward. If the left endpoint is lower than the right endpoint, the inclination direction of the oblique line segment is upward. Alternatively, the mobile phone can determine the inclination direction of the current oblique line segment based on the inclination angle of the oblique line segment. For example, if the inclination angle is less than 90 degrees, the inclination direction of the oblique line segment is upward, and if the inclination angle is greater than 90 degrees, the inclination direction of the oblique line segment is downward.

[0023] Illustratively, the electronic device may compress at least part of the text in the first file according to the inclination direction of the oblique line segment.

[0024] When the width of the slash segment is greater than the first threshold value, the compression direction of the part of the content that needs to be compressed in the first file is determined according to the inclination direction of the slash segment. For example, if the inclination direction of the slash segment is downward, the text in the row where the text covered by the slash segment is located is compressed downward, and the corresponding second area is located above the compressed text. For another example, if the inclination direction of the short slash segment is upward, the text in the row where the text covered by the short slash segment is located is compressed upward, and the corresponding second area is located below the compressed text. For another example, if the compression direction of the pre-configured upwardly or downwardly inclined short slash segments is the same, such as both are compressed upwardly or both are compressed downwardly, the corresponding second area is located below or above the compressed text.

[0025] When the width of the slash segment is less than or equal to the first threshold value, the part of the content that needs to be compressed in the first file and the corresponding compression direction are determined based on the inclination direction of the slash segment, and the position of the left endpoint and / or the position of the right endpoint. For example, if the inclination direction of the slash segment is downward, the text to the right of the left endpoint in the row where the text covered by the slash segment is located is compressed to the right, and the corresponding second area obtained is located on the left side of the compressed text. For another example, if the inclination direction of the slash segment is upward, the text to the left of the right endpoint in the row where the text covered by the slash segment is located is compressed to the left, and the corresponding second area obtained is located on the right side of the compressed text. For another example, the compression direction of the pre-configured upwardly or downwardly inclined slash segments is the same, such as both are compressed to the left or both are compressed to the right, the text to be compressed is the text to the left of the right endpoint or the text to the right of the left endpoint in the row where the text covered by the slash segment is located, and the corresponding second area obtained is located on the right side or left side of the compressed text.

[0026] In one possible implementation, the electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding trajectory of a preset operation to obtain a second area, including: when the sliding trajectory of the preset operation is a closed graphic, the electronic device compresses the character width and / or character spacing of the line of text covered by the closed graphic to obtain the second area.

[0027] The closed graphic may include, for example, a completely closed closed graphic or a closed graphic that is closed to the edge of the display page. A completely closed closed graphic means that the starting position and the end position of the preset operation coincide with each other. A closed graphic that is closed to the edge of the display page means that the sliding track of the preset operation itself is not closed, but forms a closed graphic with the edge of the text displayed on the electronic device. The position of the closed graphic corresponds to the position of the second area, and the size of the closed graphic may correspond to the size of the second area.

[0028] Exemplarily, when the sliding track of the preset operation is a closed graphic, the part of the content in the first text that needs to be compressed is the text around the closed graphic or the text in the line where the text covered by the closed graphic is located. For example, the part of the content in the first text that needs to be compressed is the text on the left side of the closed graphic, the corresponding compression method is the character width and / or character spacing, and the compression direction is left compression. For another example, the part of the content in the first text that needs to be compressed is the text on the right side of the closed graphic, the corresponding compression method is the character width and / or character spacing, and the compression direction is right compression. For another example, the part of the content in the first text that needs to be compressed is the text above the closed graphic, such as the text in the upper line, the corresponding compression method is the character height and / or line spacing, and the compression direction is upward compression. For another example, the part of the content in the first text that needs to be compressed is the text below the closed graphic, such as the text in the lower line, the corresponding compression method is the character height and / or line spacing, and the compression direction is downward compression.

[0029] It should be noted that the embodiment of the present application does not limit the shape of the closed figure. The closed figure can be a regular closed shape or an irregular closed shape.

[0030] In one possible implementation, the electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding trajectory of a preset operation to obtain a second area, including: when the sliding trajectory of the preset operation is a preset symbol, the electronic device compresses the character height and / or line spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain the second area; or, the electronic device compresses the character width and / or character spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain the second area.

[0031] The preset symbols may include preset symbols without directions and preset symbols with directions. The specific shape of the preset symbols may be a shape pre-configured by the manufacturer or a shape customized by the user.

[0032] For example, if the preset symbol is a non-directional preset symbol, the portion of the first text that needs to be compressed is the line containing the text covered by the preset symbol and / or adjacent lines. If the portion of the first text that needs to be compressed is text to the left and right of the preset symbol, the compression method is character width and / or character spacing, and the compression direction is leftward compression or rightward compression. If the portion of the first text that needs to be compressed is text above and below the preset symbol, the compression method is character height and / or line spacing, and the compression direction is upward compression or downward compression.

[0033] In one possible implementation, when the preset symbol is a preset symbol with direction, the electronic device compresses the line of text covered by the preset symbol with direction to obtain a second area; the second area is located in the first direction of the preset symbol with direction, and the first direction is the direction indicated by the preset symbol with direction.

[0034] For example, if the preset symbol is a directional symbol, the portion of the first text to be compressed is the text in the direction indicated by the directional symbol. The compression direction is the direction indicated by the directional symbol. That is, after the mobile phone compresses the content to be compressed, the resulting second region is located in the direction indicated by the preset symbol. The compression method is the compression method corresponding to the direction indicated by the directional symbol.

[0035] In a possible implementation, the electronic device receives annotation content input by the user on the second interface, and adjusts the size of the second area according to the number of characters and / or font size of the annotation content.

[0036] Optionally, the mobile phone displays a second interface and detects annotation content entered by the user using a stylus, finger, or keyboard on the second interface. The mobile phone may detect the annotation content entered by the user on the second interface, or detect the annotation content entered by the user in the second area. The mobile phone then displays the received annotation content in the second area of ​​the second interface.

[0037] Optionally, the area of ​​the second area obtained by the mobile phone according to the preset operation may not meet the area requirement for the annotated content, such as being smaller than or exceeding the area requirement for the annotated content. The size of the second area can be adjusted according to the number of characters and / or font size of the annotated content, such as by expanding or reducing the second area, so that the second area meets the area requirement for the annotated content.

[0038] In some embodiments, the mobile phone continues to compress the compressed text and expand the second area by adopting a compression strategy corresponding to the sliding trajectory of a preset operation according to the number of characters and / or font size of the annotated content. The compression stops until the compression upper limit of the compressed text is reached. The compression upper limit includes one or more of the following: minimum character height, narrowest character width, minimum font weight, narrowest character spacing, and narrowest line spacing. The compression upper limit threshold can be determined based on an empirical value or based on the size of the display interface. Alternatively, if the compressed text has been compressed to the compression upper limit, and the electronic device still detects annotation content that needs to be displayed in the current second area on the second interface, the electronic device can expand the second area by compressing the text near the second area to display more received annotation content. For example, if the uncompressed text in the nearby M lines is compressed, the compression stops after the nearby M lines are also compressed to the compression upper limit.

[0039] In some further embodiments, if the electronic device does not receive further annotation content that needs to be displayed in the current second area within a preset period of time after receiving and displaying annotation content, i.e., the annotation content displayed in the second area is not updated. Furthermore, if there is a corresponding portion of blank area in the current second area, and the area of ​​the blank area is greater than a first threshold, the electronic device may reduce the current second area to achieve a better display effect. The first threshold may be a preconfigured empirical value.

[0040] In other embodiments, when the electronic device detects a modification to the saved annotation content, such that the original annotation content increases or decreases, the electronic device correspondingly expands or contracts the original second area to obtain a second area size that matches the current annotation content. This optimizes the interface display and further improves the user experience.

[0041] In one possible implementation, after the electronic device displays the second interface in response to detecting a preset operation on the first interface, the method also includes: when no annotation content input by the user is received within a preset time period after detecting the preset operation, or when the user is detected to perform an operation to delete the annotation or exit the annotation mode, the electronic device displays the first interface.

[0042] For example, if a user mistakenly operates the phone and displays the second area, the user currently has no annotation requirements. Alternatively, the user's preset operation applies to the wrong location, resulting in the second area being a non-ideal annotation area. Alternatively, after performing the preset operation, the user no longer has an annotation requirement. In this case, the electronic device may not receive the annotation content within the preset time period. In this case, the electronic device determines that the second area needs to be deleted and automatically restores the compressed text to its initial state, that is, displays the display interface before the current preset operation is obtained, ensuring the normal display of the electronic device.

[0043] In one possible implementation, the compression strategy includes one or more of a compression method, a compression direction, and a compression ratio; the compression method includes one or more of the following: character height compression, character width compression, character weight compression, character spacing compression, and line spacing compression; the compression direction includes one or more of the following: upward compression, downward compression, left compression, and right compression; the compression ratio is determined by the electronic device according to the coverage width and / or length of the sliding track of a preset operation, or is determined according to the execution time of the preset operation, or is a default value.

[0044] The compression in each direction can be compression in the positive direction or compression in the oblique direction. For example, upward compression can be compression in the upward direction or compression in the oblique direction. The angle of the oblique direction can be determined based on empirical values ​​or the size of the electronic device display.

[0045] Exemplarily, the electronic device can determine the compression ratio by detecting the last pressing time of the stylus or finger at the end of the sliding track when performing a preset operation. This process can be a dynamic process, and the changes in the marked area can be seen during the last stop of the user performing the preset operation. For example, after the electronic device detects a long oblique line segment, it displays a second interface containing the second area. If the electronic device currently detects that the stylus or the user's finger has not left the second interface, and keeps long pressing at the end of the long oblique line segment, it can continue to compress the text that needs to be compressed according to the compression strategy until the stylus or the user's finger leaves the second interface, or the text that needs to be compressed is compressed to the upper limit of compression. In this way, the user can expand the area of ​​the second area according to the size of the second area displayed on the second interface by long pressing the display screen, etc., until it is considered that the size of the currently displayed second area meets the needs, thereby improving the user experience.

[0046] In a possible implementation, in response to a detected erasing operation, the electronic device does not display a sliding trace of a preset operation, or does not display a sliding trace of the preset operation and the annotation content.

[0047] In this case, the electronic device displays the sliding track of the preset operation, which will cover the compressed part of the text, affecting the user's ability to view this part of the text. The user can then delete or hide the sliding track of the current preset operation by erasing. Alternatively, if the user does not want to retain the annotation content in the current second area, the user can also delete or hide the current annotation content by erasing. Alternatively, the user can delete or hide the sliding track and annotation content of the current preset operation by erasing.

[0048] Exemplarily, the electronic device deletes or hides the sliding track and the annotated content in response to a detected operation of erasing the sliding track.

[0049] In a second aspect, the present application provides an electronic device, which includes: a display unit and a detection unit. The display unit is used to display a first interface; the first interface displays the content of a first file. The detection unit is used to detect a preset operation on the first interface. The display unit is also used to display a second interface in response to the detection unit detecting a preset operation on the first interface. The second interface includes a first area and a second area, the first area is used to display the content of the first file, and the second area is used to display the annotated content. At least part of the text in the first area is different from the font format and / or paragraph format of the text in the first file in the first interface.

[0050] In a possible implementation, the preset operation is a sliding operation performed by the user along a preset trajectory, where the preset trajectory includes one or more of the following: a slash segment, a closed figure, and a preset symbol.

[0051] In a possible implementation, the font format of the text includes one or more of the following: character height, character width, and character weight; the paragraph format of the text includes character spacing and / or line spacing.

[0052] In one possible implementation, the electronic device further includes a processing unit. The processing unit is configured to, in response to the detection unit detecting a preset operation on the first interface, compress at least a portion of the text in the first file using a compression strategy corresponding to a sliding trajectory of the preset operation to obtain a second area. The detection unit is specifically configured to display a second interface including the second area.

[0053] In one possible implementation, the processing unit is specifically used to compress the character height and / or line spacing of the line where the text covered by the slash segment is located when the sliding trajectory of the preset operation is a slash segment and the width of the slash segment is greater than a first threshold value to obtain a second area; or, when the sliding trajectory of the preset operation is a slash segment and the width of the slash segment is less than or equal to the first threshold value, compress the character width and / or character spacing of the line where the text covered by the slash segment is located, or compress the character width and / or character spacing of the text covered by the slash segment to obtain a second area.

[0054] In one possible implementation, when the width of the oblique line segment is greater than a first threshold and the oblique line segment is tilted upward, the compressed text is located above or below the second area. When the width of the oblique line segment is greater than the first threshold and the oblique line segment is tilted downward, the compressed text is located below or above the second area. When the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted upward, the compressed text is located to the left or right of the second area. When the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted downward, the compressed text is located to the right or left of the second area.

[0055] In a possible implementation, the processing unit is specifically configured to compress the character width and / or character spacing of a line of text covered by the closed graphic to obtain the second area when the sliding track of the preset operation is a closed graphic.

[0056] In one possible implementation, the processing unit is specifically used to compress the character height and / or line spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain a second area when the sliding track of the preset operation is a preset symbol; or, compress the character width and / or character spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain a second area.

[0057] In one possible implementation, the processing unit is specifically used to compress the line of text covered by the directional preset symbol to obtain a second area when the preset symbol is a directional preset symbol; the second area is located in the first direction of the directional preset symbol, and the first direction is the direction indicated by the directional preset symbol.

[0058] In a possible implementation, the processing unit is further configured to receive annotation content input by the user on the second interface, and adjust the size of the second area according to the number of characters and / or font size of the annotation content.

[0059] In one possible implementation, the detection unit is further configured to detect a user performing an operation of deleting a annotation or exiting an annotation mode. The display unit is further configured to display the first interface when the processing unit does not receive annotation content input by the user within a preset time period after the detection unit detects a preset operation, or when the detection unit detects a user performing an operation of deleting an annotation or exiting an annotation mode.

[0060] In addition, the technical effects of the electronic device described in the second aspect can refer to the technical effects of the marking method described in the first aspect, and will not be repeated here.

[0061] In a third aspect, the present application provides an electronic device comprising: a processor, a memory, and a touch screen; the memory and the touch screen are coupled to the processor, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor reads the computer instructions from the memory, causing the electronic device to perform the following operations: displaying a first interface; the first interface displaying the contents of a first file. In response to detecting a preset operation on the first interface, displaying a second interface; the second interface comprising a first area and a second area, the first area being used to display the contents of the first file, and the second area being used to display annotated content; wherein at least some of the text in the first area has a different font format and / or paragraph format than the text in the first file on the first interface.

[0062] In a possible implementation, the preset operation is a sliding operation performed by the user along a preset trajectory, where the preset trajectory includes one or more of the following: a slash segment, a closed figure, and a preset symbol.

[0063] In a possible implementation, the font format of the text includes one or more of the following: character height, character width, and character weight; the paragraph format of the text includes character spacing and / or line spacing.

[0064] In one possible implementation, the electronic device performs the following operations: in response to detecting a preset operation on the first interface, compressing at least a portion of the text in the first file using a compression strategy corresponding to a sliding track of the preset operation to obtain a second area, and displaying a second interface including the second area.

[0065] In one possible implementation, the electronic device performs the following operations: when the sliding trajectory of the preset operation is a slanted line segment and the width of the slanted line segment is greater than a first threshold, compressing the character height and / or line spacing of the line where the text covered by the slanted line segment is located to obtain a second area; or, when the sliding trajectory of the preset operation is a slanted line segment and the width of the slanted line segment is less than or equal to the first threshold, compressing the character width and / or character spacing of the line where the text covered by the slanted line segment is located, or compressing the character width and / or character spacing of the text covered by the slanted line segment to obtain a second area.

[0066] In one possible implementation, when the width of the oblique line segment is greater than a first threshold and the oblique line segment is tilted upward, the compressed text is located above or below the second area. When the width of the oblique line segment is greater than the first threshold and the oblique line segment is tilted downward, the compressed text is located below or above the second area. When the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted upward, the compressed text is located to the left or right of the second area. When the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted downward, the compressed text is located to the right or left of the second area.

[0067] In a possible implementation, the electronic device performs the following operation: when the sliding track of the preset operation is a closed graphic, compressing the character width and / or character spacing of the line where the text covered by the closed graphic is located to obtain the second area.

[0068] In one possible implementation, the electronic device performs the following operations: when the sliding track of the preset operation is a preset symbol, compressing the character height and / or line spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain a second area; or, compressing the character width and / or character spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain a second area.

[0069] In one possible implementation, the electronic device also performs the following operations: when the preset symbol is a preset symbol with a direction, compressing the line of text covered by the preset symbol with a direction to obtain a second area; the second area is located in the first direction of the preset symbol with a direction, and the first direction is the direction indicated by the preset symbol with a direction.

[0070] In a possible implementation, the electronic device further performs the following operations: the electronic device receives annotation content input by the user on the second interface, and adjusts the size of the second area according to the number of characters and / or font size of the annotation content.

[0071] In one possible implementation, after displaying the second interface in response to detecting a preset operation on the first interface, the electronic device also performs the following operation: when no annotation content input by the user is received within a preset time period after detecting the preset operation, or when it is detected that the user performs an operation to delete the annotation or exit the annotation mode, the first interface is displayed.

[0072] In a possible implementation, the electronic device further includes a stylus pen, which is used to input preset operations and annotation content into the touch screen.

[0073] In addition, the technical effects of the electronic device described in the third aspect can refer to the technical effects of the marking method described in the first aspect, and will not be repeated here.

[0074] In a fourth aspect, the present application provides a terminal device having the functionality to implement the annotation method described in the first aspect and any possible implementation thereof. This functionality can be implemented via hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functionality.

[0075] In a fifth aspect, the present application provides a computer storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the labeling method as described in the first aspect and any possible implementation thereof.

[0076] In a sixth aspect, the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the marking method as described in the first aspect and any possible implementation thereof.

[0077] In a seventh aspect, a circuit system is provided, the circuit system including a processing circuit, the processing circuit being configured to execute the marking method as described in the first aspect and any possible implementation thereof.

[0078] In the eighth aspect, an embodiment of the present application provides a chip system comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes the labeling method described in the first aspect above and any possible implementation method thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0080] Figure 2A Schematic diagram of the structure of the electronic device provided in the embodiment of the present application Figure 1 ;

[0081] Figure 2B A schematic diagram of the software structure block diagram of the electronic device provided in an embodiment of the present application;

[0082] Figure 3 A schematic diagram of an application scenario of a prior art annotation method provided in an embodiment of the present application;

[0083] Figure 4 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 1 ;

[0084] Figure 5 Schematic diagram of the marking method provided in the embodiment of the present application Figure 1 ;

[0085] Figure 6 Schematic diagram 2 of the interface of the electronic device provided in an embodiment of the present application;

[0086] Figure 7 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 3 ;

[0087] Figure 8 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 4 ;

[0088] Figure 9 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 5 ;

[0089] Figure 10 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 6 ;

[0090] Figure 11 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 7 ;

[0091] Figure 12 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 8 ;

[0092] Figure 13 Schematic diagram of the interface of the electronic device provided in the embodiment of the present application Figure 9 ;

[0093] Figure 14 Schematic diagram 2 of the flow chart of the marking method provided in the embodiment of the present application;

[0094] Figure 15 A second structural diagram of an electronic device provided in an embodiment of the present application;

[0095] Figure 16 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application Figure 3 . DETAILED DESCRIPTION

[0096] The marking method and electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0097] The terms "including," "having," and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.

[0098] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being more preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0099] In this application, unless otherwise specified, "plurality" means two or more. "And / or" in this document is simply a description of an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.

[0100] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown in , the annotation method provided in the embodiment of the present application can be applied to an electronic device 100 installed with a first application. Among them, the first application is an application that can edit or display document files, including but not limited to slide (PowerPoint, PPT) applications, portable document format (portable document format, PDF) applications, word processing software (such as word, WPS), notepad, browser (can display web pages), reader, e-book, email, etc. Among them, the document file in the document application is editable or non-editable. For example, PDF files, web pages, e-books, etc. are non-editable. PPT, word, notepad, etc. are editable. In some examples, word or PPT in read-only mode is non-editable.

[0101] In some embodiments, the display screen of the electronic device 100 is a touch screen, and the user can slide a finger on the display screen of the electronic device 100 to input text or patterns, etc.

[0102] In other embodiments, Figure 1 As shown, the electronic device 100 can also be equipped with a stylus 200. For example, the stylus 200 can establish communication with the electronic device 100 via a wired or wireless method (such as Bluetooth, Wi-Fi). The user can use the stylus 200 to write text and other information on the display screen of the electronic device 100. The electronic device 100 can display the motion track formed by the stylus 200 on the display screen. In addition, the electronic device 100 can record the motion track formed by the stylus 200 on the display screen and then recognize the corresponding text.

[0103] Optional, such as Figure 1As shown, one or more buttons 201 may be set on the stylus 200, and the button 201 may be a physical button or a virtual button. In some examples, each button 201 corresponds to a key value. When the user operates a button 201, the stylus 200 may send the key value (key) corresponding to the button 201 to the electronic device 100 via a wireless method such as Bluetooth. The electronic device 100 performs a corresponding operation based on the received key value. In other examples, different key values ​​are set for different operations of each button 201. When the stylus 200 detects different operations of the user on the button 201, it sends the key value corresponding to the operation to the electronic device 100, and the electronic device 100 performs a corresponding operation based on the received key value.

[0104] For example, suppose that a button 201 pre-configured in the stylus 200 corresponds to the key value 001, and the key value 001 pre-configured in the electronic device 100 corresponds to starting the annotation mode. If the stylus 200 detects that the user has performed a single-click operation on the button 201, the stylus 200 can send the key value 001 corresponding to the single-click of the button 201 to the electronic device 100. After receiving the key value 001, the electronic device 100 starts the annotation mode. Then, the application being displayed by the electronic device 100 enters the handwriting mode, and in the handwriting mode, the user can use the stylus 200 to handwrite content in the display interface. For example, in the annotation mode, the electronic device 100 can identify the annotation content handwritten by the user based on the movement trajectory of the stylus 200 in the display interface.

[0105] The stylus pen 200 may be a resistive stylus pen, an electromagnetic stylus pen, or a capacitive stylus pen, and the present embodiment does not impose any limitation thereto.

[0106] Exemplarily, the electronic device 100 can be, for example, a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart TV, a netbook, a wearable electronic device, a vehicle-mounted device, an artificial intelligence (artificial intelligence) terminal, or other electronic device with a touch-sensitive display screen. This application does not impose any special restrictions on the specific form of the electronic device.

[0107] Figure 2A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0108] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a camera 193 and a display screen 194, etc.

[0109] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0110] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0111] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0112] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0113] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0114] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 can receive input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. In other embodiments, the power management module 141 can also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be provided in the same device.

[0115] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0116] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0117] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include one or more filters, switches, power amplifiers, low noise amplifiers (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0118] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0119] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate one or more communication processing modules. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0120] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0121] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0122] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0123] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0124] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0125] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras, where N is a positive integer greater than 1. The camera 193 may be a front-facing camera or a rear-facing camera.

[0126] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0127] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0128] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0129] The internal memory 121 can be used to store one or more computer programs, each of which includes instructions. The processor 110 can execute the above instructions stored in the internal memory 121, thereby enabling the electronic device 100 to perform the contact intelligent recommendation method provided in some embodiments of the present application, as well as various functional applications and data processing. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system; the program storage area may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created during the use of the electronic device 100 (such as photos, contacts, etc.). In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, universal flash storage (UFS), etc. In other embodiments, the processor 110 executes the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor, thereby enabling the electronic device 100 to execute the labeling method provided in the embodiments of the present application, as well as various functional applications and data processing.

[0130] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0131] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0132] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0133] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0134] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with one or more microphones 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0135] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0136] The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc., and the embodiments of the present application do not impose any restrictions on this.

[0137] Of course, the electronic device 100 provided in the embodiment of the present application may also include one or more devices such as buttons, motors, indicators, and SIM card interfaces, and the embodiment of the present application does not impose any restrictions on this.

[0138] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0139] Figure 2B It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0140] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0141] The application layer can include a range of applications.

[0142] like Figure 2B As shown, the application program may include APPs (applications) such as call, memo, browser, contact, camera, gallery, calendar, map, Bluetooth, music, video, short message, etc. These applications may be pre-installed when the electronic device 100 leaves the factory, or may be downloaded and installed from an application market when the user uses the electronic device 100. This embodiment of the application does not impose any limitation on this.

[0143] In an embodiment of the present application, the application includes a first application, which is an application that can edit or display document files, including but not limited to slide (PowerPoint, PPT) applications, portable document format (portable document format, PDF) applications, word processing software (such as Word, WPS), notepad, browser (can display web pages), reader, e-book, email, etc.

[0144] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0145] like Figure 2B As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, and the like.

[0146] The window manager manages windowed applications. It can obtain the display size, determine whether a status bar exists, lock the screen, and take screenshots. A content provider stores and retrieves data and makes it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those for displaying text or images. The view system is used to build applications. The display interface can consist of one or more views. The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager enables applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, requiring no user interaction. For example, the notification manager is used to notify users of download completions and message reminders. The notification manager can also display notifications in the system's top status bar as icons or scrolling text, such as notifications from background applications. It can also display notifications in the form of dialog windows. Examples include displaying text messages in the status bar, emitting beeps, vibrating electronic devices, or flashing indicator lights.

[0147] In some embodiments of the present application, the framework layer may further include a labeling module, which may be used to identify the sliding trajectory of the user when performing a preset operation, and determine a corresponding compression strategy based on the sliding trajectory and the document file currently displayed by the electronic device. For example, the font height of all text in the line where the text covered by the preset operation sliding trajectory is located is reduced. For another example, the line spacing of all text in the line where the text covered by the preset operation sliding trajectory is reduced.

[0148] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0149] The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of various common audio and video formats, as well as static image files. The media library supports a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D drawing.

[0150] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0151] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0152] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0153] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, etc., which are not limited in this embodiment of the present application.

[0154] The technical solutions provided in the following embodiments can be applied to Figure 2A The electronic device of the structure shown, and / or Figure 2B An electronic device with the structure described above.

[0155] Taking a mobile phone as an example of the electronic device 100, the marking method provided in the embodiment of the present application is specifically introduced with reference to the accompanying drawings.

[0156] In the prior art, mobile phones usually add annotations to blank spaces in documents. Figure 3 As shown in (a) in FIG, text content is displayed on the interface 301. When the mobile phone detects that the user has added annotation content, it can only choose to display the annotation content in the blank area of ​​the interface 301. Figure 3 As shown in (b) in FIG, when the user annotates too much content or there is less blank space in the mobile phone interface, the annotation 31 can easily cover the original content of the document file, causing difficulty for the user to read.

[0157] To this end, an embodiment of the present application provides a method for adding annotations, which can adaptively adjust the blank area in the mobile phone interface according to the annotation content, avoid overlapping of the annotation with the original document content, and improve the user reading experience.

[0158] In some embodiments of the present application, the annotation method can be applied to an annotation scenario for an editable document file. In this scenario, when the mobile phone is in annotation mode, the mobile phone can adjust the size of the blank area in the editable document file by changing the font format and / or paragraph format of the text in the editable document file, that is, adjusting the area used to display the annotation.

[0159] In a specific and feasible method, variable fonts can be used to adjust the size of the blank area in the document file by adjusting the font format of the variable font. The adjusted blank area is used as the annotation area. Among them, a variable font is different from the original fixed, static and immutable font form. It allows a certain degree of randomness and user input in a flexible format to obtain the final presentation result. A variable font includes a typographic design space composed of one or more design axes. For example, a variable font can include two variables: font height and font width. For another example, a variable font can include two variables: font weight and font width. Among them, font weight refers to the thickness of the font. For another example, a variable font can include multiple variables such as font height, font weight and font width. These variables are controlled by coordinates in a two-dimensional space. Changes in any coordinate in the space will show a different typographic experience.

[0160] In this way, by changing the values ​​of one or more of these variables, font variability can be achieved to reserve more blank space for annotations. For example, reducing the height of certain lines of text in a document file can create more blank space above or below these lines of variable font for annotations. For another example, reducing the width of certain lines of text in a document file can create more blank space to the left or right of these lines of variable font for annotations.

[0161] In another specific achievable method, the size of the blank area in the document file can be adjusted by adjusting the paragraph format, and the adjusted blank area is used as the annotation area. For example, the mobile phone can obtain more blank area for annotation by reducing the line spacing and / or word spacing. For another example, the mobile phone can obtain more blank area for annotation by moving part of the displayed content in the document file. For example, Figure 4 As shown in (a) of FIG, the mobile phone displays interface 401, and the content displayed in interface 401 is the content of the document file. If the mobile phone detects that the user selects certain text by using a stylus or finger, it will display the following Figure 4 In the interface 402 shown in (b), a mark 41, such as a horizontal line mark, is displayed under the selected text in the interface 402. The user judges whether the currently selected text is correct by the mark 41. If the mobile phone does not receive the operation of reselecting text within the preset time period, the display content below the mark 41 is moved down by a preset length, and the display is as shown below. Figure 4 The interface 403 shown in (c) in FIG. The interface 403 includes the annotation area 42 obtained after the display content is moved down. If the mobile phone detects the user's operation of adding an annotation, the mobile phone displays the following Figure 4 In the interface 404 shown in (d), the annotation area 42 in the interface 404 displays the annotation content 43.

[0162] Of course, the above two specific implementation methods can also be combined to reserve more marking areas, which is not limited in the embodiments of the present application.

[0163] In other embodiments of the present application, the annotation method is applied to the annotation scenario of a non-editable document file. In this scenario, when the mobile phone is in annotation mode, the mobile phone can convert part of the content of the document file into an image format, and compress the converted image to adjust the size of the blank area in the document file, that is, adjust the area used to display the annotation.

[0164] Optionally, in the aforementioned annotation scenario for editable document files or the annotation scenario for non-editable document files, after the annotation area is displayed on the mobile phone interface, the annotation content entered by the user using a stylus or finger can be detected. Alternatively, the annotation content entered by the user using the keyboard can be received. The mobile phone displays the corresponding annotation content in the annotation area. In particular, if the input is handwritten, the mobile phone can also display the annotation content in the user's handwriting.

[0165] Of course, the method used in this embodiment can also be applied to the annotation scenario of editable document files. That is, without changing the font format and paragraph format of the original document, the text content to be adjusted is directly compressed as a whole. This embodiment of the application does not limit this.

[0166] The following is a detailed description of the marking method provided in the embodiments of the present application with reference to the accompanying drawings.

[0167] Figure 5 FIG. 5 is a flow chart of a marking method provided in an embodiment of the present application. The method may include S501 to S503:

[0168] S501. The mobile phone displays the first interface.

[0169] S502: In response to a preset operation detected on the first interface, the mobile phone displays a second interface, which includes a marked area.

[0170] Among them, the first interface is the interface of the first application, and the first application can be used to display the content of the document file. For example, the first interface is an interface displayed after detecting that the user performs an operation to enter the annotation mode, or the first interface is a reading interface of the document file. Among them, the document file in the first interface is an editable file or a non-editable file. If the document file in the first interface is an editable file, the annotation area can be obtained by compressing the text content displayed in the first interface. Alternatively, the annotation area can be obtained by converting part or all of the text content in the first interface into an image and compressing it. If the document file in the first interface is a non-editable file, the annotation area can be obtained by converting part or all of the text content in the first interface into an image and compressing it.

[0171] The above-mentioned preset operation is a sliding operation performed by the user along a preset trajectory, and the preset trajectory may include, for example, a slash segment, a closed figure, a preset symbol, etc. The sliding operation along the preset trajectory may be a sliding of the user's finger on the mobile phone screen, or a sliding of the user using a stylus on the mobile phone screen. After the mobile phone detects the sliding operation along the preset trajectory on the first interface, it displays the second interface. The second interface is an interface displayed in the annotation mode of the mobile phone, and the second interface includes a first area and a second area. The first area is used to display the content of the first document file, and the second area is used to display the annotation content. The mobile phone can receive the annotation content input by the user on the second interface, and display the annotation content in the annotation area of ​​the second interface. The annotation area is also the second area. At least part of the text in the first area is different from the font format and / or paragraph format of the text in the document file in the first interface.

[0172] In some embodiments of the present application, the first interface is an interface displayed after detecting that the user has executed an operation to enter the annotation mode. After the mobile phone detects that the user has executed an operation to enter the annotation mode in the reading interface of the document file, it enters the annotation mode and displays the first interface. Afterwards, after the mobile phone detects that the user has executed a preset sliding operation on the first interface, it determines the content to be compressed based on the specific pattern and action position of the sliding. Finally, after compressing the content to be compressed, a blank area is reserved at the corresponding position as the annotation area. Among them, the operation of executing the entry into the annotation mode may, for example, include the operation of clicking the stylus button, the user's specific operation on the reading interface of the document file (such as manipulating a certain control, long pressing, double-clicking, etc.), voice commands, floating gestures, etc.

[0173] For example, Figure 6 The interface 601 shown in (a) is a reading interface of a document file. After the mobile phone detects the operation of entering the annotation mode performed by the user on the interface 601, it enters the annotation mode and displays the following Figure 6 The interface 602 shown in (b) is the first interface.

[0174] The mobile phone detects the preset operation performed by the user in the interface 602, such as the sliding track corresponding to the preset operation. After that, the mobile phone determines and compresses the content to be compressed according to the preset operation, and displays the following Figure 6 The interface 603 shown in (c) is the second interface, and the interface 603 includes a marked area 62.

[0175] In other embodiments of the present application, the first interface is a document reading interface. Upon detecting a preset operation performed by a user on the first interface, the mobile phone enters a marking mode. Furthermore, based on the specific sliding pattern and location, the content to be compressed is determined. After compressing the content to be compressed, a blank area is reserved at the corresponding location as a marking area.

[0176] For example, Figure 6 The interface 601 shown in (a) is the first interface. After the mobile phone detects the preset operation performed by the user on the interface 601, it enters the annotation mode. After that, the mobile phone determines and compresses the content to be compressed according to the preset operation, and displays the following Figure 6 The interface 603 shown in (c) is the second interface, and the interface 603 includes a marked area 62.

[0177] Optionally, the mobile phone detects that a user has entered annotation mode and displays an interface, such as interface 602, which may include a toolbar 64. The mobile phone can edit the annotation content by detecting the user's operation of a tool in the toolbar. For example, if the mobile phone detects that a user has clicked the "Picture" option in toolbar 64, it can insert an image into the annotation area. For another example, if the mobile phone detects that a user has clicked the "Eraser" option in toolbar 64, it can determine whether to delete the annotation content and / or the sliding track of the preset operation in response to the user's erase operation.

[0178] In a specific implementation, in response to detecting a preset operation on the first interface, the mobile phone can determine the compression object and the compression strategy based on the specific pattern (such as a slash segment, a closed figure, a preset symbol) and the action position of the preset operation sliding track. The compression object is the content to be compressed. The compression strategy may include a compression method, a compression direction, and a compression ratio. Afterwards, the mobile phone compresses the compression object using the determined compression strategy to obtain a second area. That is, after the mobile phone compresses the content to be compressed according to the compression method, the compression direction, and the compression ratio, it can obtain the corresponding annotation area and display the second interface containing the annotation area. The sliding track of the preset operation may not be displayed in the second interface, or the sliding track of the preset operation may be displayed. If the sliding track is displayed on the second interface, a preset time period may be configured, and the sliding track disappears automatically after the preset time period. Alternatively, the sliding track disappears automatically after the annotation is completed. Alternatively, in response to the user's operation of deleting the sliding track, the sliding track is not displayed.

[0179] Among them, the content to be compressed is the part of the display content that the user has determined to be weakened. The mobile phone determines the part of the display content to be compressed based on the sliding trajectory of the preset operation. After compression, the marked area can be obtained. If the mobile phone displays the content in a variable font, the compression method includes one or more of the following: font height compression, font width compression, font weight compression, font spacing compression, and line spacing compression. If the mobile phone displays the content in a non-variable font, the compression method is font spacing compression and / or line spacing compression. The compression direction includes one or more of the following: upward compression, downward compression, left compression, and right compression. The compression ratio is the ratio of the content to be compressed when the mobile phone detects the preset operation and initially compresses it. For example, compressing 20% ​​of the font height of the text in the content to be compressed.

[0180] Optionally, the compression ratio of the content to be compressed by the mobile phone can be pre-configured in the mobile phone and set as a default value; it can also be determined based on the coverage width and / or length of the sliding track of a preset operation; or it can be determined based on the execution time of a preset operation. After the mobile phone detects the preset operation, it compresses the content to be compressed according to the compression ratio corresponding to the preset operation to obtain the marked area.

[0181] In some examples, the mobile phone pre-configures compression ratios, and can set the same or different compression ratios for preset operations with different sliding trajectories. After detecting the preset operation, the mobile phone determines the corresponding compression ratio based on the sliding trajectory and compresses the content to be compressed according to the compression ratio.

[0182] In other examples, the mobile phone can determine the compression ratio based on the width and / or length of the sliding track. For example, the mobile phone can pre-configure compression ratios corresponding to sliding tracks of different lengths. The compression ratio can correspond to the area of ​​the marked area. For example, a larger compression ratio results in a larger marked area after the initial compression of the content to be compressed.

[0183] For example, taking a long diagonal line as the default sliding trajectory, Table 1 below shows the corresponding relationship between the ratio of the long diagonal line's coverage width to the width of the displayed content and the compression ratio. Thus, when the phone detects long diagonal lines of varying coverage widths, it compresses the content to be compressed according to the corresponding compression ratio. As can be seen, the wider the coverage width of the long diagonal line, the greater the compression ratio, and thus, the larger the corresponding annotation area.

[0184] Table 1

[0185]

[0186] In some other examples, the mobile phone can determine the compression ratio by detecting the last pressing time of the stylus or finger at the end of the sliding track when performing a preset operation. This process can be a dynamic process, and the changes in the marked area can be seen during the last stop of the user performing the preset operation. For example, after the mobile phone detects a long oblique line segment, it displays the second interface containing the marked area. If the mobile phone currently detects that the stylus or the user's finger has not left the second interface, and keeps long pressing at the end of the long oblique line segment, the content to be compressed can be continuously compressed according to the compression method and compression direction until the stylus or the user's finger leaves the second interface, or the content to be compressed is compressed to the compression upper limit.

[0187] In this way, the user can expand the area of ​​the annotation area according to the size of the annotation area displayed on the second interface by long pressing the display screen, etc., until the user believes that the current displayed annotation area size meets the needs, thereby improving the user experience.

[0188] Optionally, the sliding trajectory of the preset operation is a diagonal line segment. The diagonal line segment may include, for example, a long diagonal line segment, a short diagonal line segment, etc. When the mobile phone detects that the coverage width of the diagonal line segment input on the first interface exceeds the preset width, and the inclination angle of the current diagonal line segment exceeds the preset inclination angle, it can determine that the current diagonal line segment is the sliding trajectory corresponding to the preset operation. The preset width and preset angle can be set by the manufacturer based on empirical values ​​or user habits and pre-configured in the mobile phone; alternatively, the mobile phone can directly receive custom values ​​set by the user.

[0189] For example, suppose the preset width is 30% of the width of the text displayed on the current page, and the preset tilt angle is 10 degrees. Then, when the mobile phone detects a slash segment on the first interface with a coverage width greater than or equal to 30% of the width of the text displayed on the current page and a tilt angle greater than or equal to 10 degrees, it determines that the operation corresponding to the slash segment is the preset operation. After determining and compressing the content to be compressed based on the slash segment, the second interface is displayed. That is, based on the coverage width and tilt angle of the detected slash segment, it is determined whether the current slash segment is the sliding track corresponding to the preset operation. For example, if the mobile phone detects a slash segment with a coverage width equal to the width of the text displayed on the current page and a tilt angle of 30 degrees, the mobile phone determines that the current slash segment is the sliding track of the preset operation and switches to display the second interface. For another example, if the mobile phone detects a slash segment with a tilt angle less than 10 degrees, it determines that the preset operation is not detected at present, and the content displayed on the original interface is still displayed, that is, the first interface is displayed.

[0190] Among them, the mobile phone can determine whether the current oblique line segment is a long oblique line segment or a short oblique line segment based on whether the ratio of the width of the oblique line segment covering the text displayed on the first interface to the width of the displayed text is greater than a first threshold. Assume that the first threshold is 50% of the width of the text displayed on the first interface. If the width covered by the oblique line segment is greater than 50% of the width of the text displayed on the current page, it is a long oblique line segment; if the width covered by the oblique line segment is less than or equal to 50% of the width of the text displayed on the current page, it is a short oblique line segment. For example, Figure 6 The sliding track 61 of the preset operation displayed in the interface 602 shown in (b) of FIG. 1 shows that the sliding track corresponding to the current preset operation is a long oblique line segment. Figure 9 From the sliding track 91 of the preset operation displayed in the interface 901 shown in (a), it can be seen that the sliding track corresponding to the current preset operation is a short oblique line segment.

[0191] Among them, the mobile phone can determine the inclination direction of the current oblique line segment based on the detected positions of the left endpoint and the right endpoint of the oblique line segment. For example, if the left endpoint is higher than the right endpoint, the inclination direction of the oblique line segment is downward. If the left endpoint is lower than the right endpoint, the inclination direction of the oblique line segment is upward. Alternatively, the mobile phone can determine the inclination direction of the current oblique line segment based on the inclination angle of the oblique line segment. For example, if the inclination angle is less than 90 degrees, the inclination direction of the oblique line segment is upward, and if the inclination angle is greater than 90 degrees, the inclination direction of the oblique line segment is downward.

[0192] In one possible implementation, if the sliding trajectory corresponding to the preset operation is a long oblique line segment, the content to be compressed is the display content covered by the long oblique line segment. The compression method is character height compression and / or line spacing compression. The compression direction corresponds to the tilt direction of the long oblique line segment. If the mobile phone detects a long oblique line segment tilted downward, the compression direction is downward, that is, the content to be compressed is compressed downward. If the mobile phone detects a long oblique line segment tilted upward, the compression direction is upward, that is, the content to be compressed is compressed upward. Alternatively, the compression direction is preconfigured in the mobile phone, and after the mobile phone detects the preset operation of the sliding trajectory being a long oblique line segment, it determines that the compression direction is upward compression or downward compression. Then, after compressing the content to be compressed, a marking area is reserved above or below the content to be compressed covered by the long oblique line operation.

[0193] For example, Figure 6 The interface 602 shown in (b) is the interface displayed after the user is detected to have entered the annotation mode. The mobile phone detects a preset operation of a long oblique line segment in the sliding track on the interface 602. Based on the sliding track 61, the mobile phone determines that the content to be compressed is the three lines of display content covered by the long oblique line segment, that is, the three lines of text covered by the sliding track 61. The sliding track 61 is a long oblique line segment slanting downward, and the compression direction is downward compression. Then, if the text content displayed on the interface 602 is editable, the mobile phone will compress the font height and / or line spacing of the content to be compressed downward, and display the following. Figure 6 In the second interface, interface 603 is shown in (c). As shown in interface 603, a marking area 62 is displayed above the compressed content to be compressed. A sliding track 61 can also be displayed in interface 603.

[0194] In addition, if the text content displayed on the interface 602 is not editable, the content to be compressed can be converted into a picture, and the converted picture can be compressed downward to display the content as shown in the following example. Figure 6 The interface 604 shown in (d) is the second interface, which includes a marked area 62, and the display content covered by the sliding track 61 is in picture format.

[0195] It should be noted that in the following examples of mobile phones compressing the content to be compressed according to different sliding trajectories, the text content displayed on the first interface is editable text content. For the scenario of compressing the content to be compressed with non-editable text content, please refer to the above examples and will not be repeated below.

[0196] Another example is Figure 7 In the interface 701 shown in (a) of FIG, the mobile phone detects the preset operation of the sliding track being a long oblique line segment on the interface 701. Based on the sliding track 71, the mobile phone determines that the content to be compressed is the three lines of display content covered by the long oblique line segment, that is, the three lines of text covered by the sliding track 71. If the sliding track 71 is a long oblique line segment tilted upward, the compression direction is upward compression. After the mobile phone compresses the font height and / or line spacing of the content to be compressed upward, it displays the following Figure 7 The interface 702 shown in (b) is the second interface. As shown in the interface 702, a marked area 72 is displayed below the compressed content to be compressed.

[0197] In one possible implementation, if the sliding track corresponding to the preset operation is a short oblique line segment, the content to be compressed, the compression method and the compression direction are determined according to the inclination direction of the short oblique line segment, and the left endpoint position and / or the right endpoint position.

[0198] For example, if the short oblique line segment is tilted downward, the content to be compressed is the content displayed to the right of the left endpoint of the line containing the text covered by the short oblique line segment. The compression method is character width compression and / or character spacing compression, and the compression direction is rightward. The corresponding annotation area is located to the left of the content to be compressed. The method for determining the tilt direction of the short oblique line segment can be referred to the method for determining the tilt direction of the long oblique line segment, and will not be repeated here.

[0199] For example, if the short slash line is tilted upward, the content to be compressed is the content to the left of the right endpoint of the line containing the text covered by the short slash line. The compression method is character width compression and / or character spacing compression, and the compression direction is leftward. The corresponding annotation area is located to the right of the content to be compressed.

[0200] For another example, if the compression method is character width compression and / or character spacing compression, the compression direction of the upward or downward slanted short slanted lines is the same, such as both compression to the left or both compression to the right, and the content to be compressed is the display content to the left of the right endpoint or the display content to the right of the left endpoint in the line containing the text covered by the short slanted lines. The corresponding annotation area is located to the left or right of the content to be compressed.

[0201] In another possible implementation, if the sliding track corresponding to the preset operation is a short oblique line segment, the content to be compressed, the compression method, and the compression direction are determined based on the starting position and / or the ending position of the short oblique line segment, wherein the starting position of the short oblique line segment is to the left of the ending position.

[0202] In one possible design, if the starting point of a short slash segment is at the beginning of a sentence and the slant direction of the short slash segment is downward, the content to be compressed is the display content of the line containing the text covered by the short slash segment. The compression method is character width compression and / or character spacing compression, and the compression direction is rightward. The method for determining the slant direction of a short slash segment can be referred to the method for determining the slant direction of a long slash segment and will not be repeated here.

[0203] For example, Figure 9 In the interface 901 shown in (a), the mobile phone detects a short oblique line segment input by the user through a touch pen or finger sliding on the interface 901, and displays the sliding track 91. The inclination direction of the short oblique line segment is downward, the starting position is the beginning of the sentence, and it covers three lines of text. The content to be compressed is the three lines of text that are covered, the compression method is word width compression and / or word spacing compression, and the compression direction is rightward compression. After the mobile phone compresses the content to be compressed, it displays the following Figure 9 The interface 902 shown in (b) is the second interface, and the annotation area 92 is displayed on the left side of the compressed content to be compressed in the interface 902.

[0204] In another possible design, if the end point of the short slash segment is at the end of the sentence and the inclination direction of the short slash segment is downward, the content to be compressed is the display content to the right of the starting point of the short slash segment in the line where the text covered by the short slash segment is located, the compression method is character width compression and / or character spacing compression, and the compression direction is rightward compression.

[0205] For example, the preset operation sliding track is a short oblique line segment sloping downwards, and the end position of the short oblique line segment is the end of the sentence, covering three lines of text. Then the content to be compressed is the three lines of text covered to the right of the starting position, the compression method is word width compression and / or word spacing compression, and the compression direction is rightward compression. The mobile phone compresses the content to be compressed according to the preset operation and displays the following Figure 9 The interface 903 shown in (c) is the second interface displayed after the mobile phone compresses the content to be compressed to the right in response to the sliding track being a short diagonal line operation. The interface 903 includes a marked area 92.

[0206] In another possible design, if the end point of the short slash segment is at the end of the sentence and the tilt direction of the short slash operation is upward, the content to be compressed is the display content of the line where the text covered by the short slash segment is located, the compression method is character width compression and / or character spacing compression, and the compression direction is left compression.

[0207] For example, the preset operation sliding track is a short oblique line segment that tilts upwards. The end position of the short oblique line segment is the end of the sentence, covering three lines of text. The content to be compressed is the three lines of text covered by the short oblique line segment. The compression method is word width compression and / or word spacing compression, and the compression direction is left compression. The mobile phone compresses the content to be compressed according to the preset operation and displays the following Figure 9 In the interface 904 shown in (d), the marked area 92 is displayed in the interface 904.

[0208] In another possible design, if the starting point of the short slash segment is at the beginning of a sentence and the inclination direction of the short slash segment is upward, the content to be compressed is the display content to the left of the end point of the short slash segment in the line where the text covered by the short slash segment is located. The compression method is character width compression and / or character spacing compression, and the compression direction is left compression.

[0209] For example, the preset operation sliding track is a short oblique line segment that tilts upwards. The starting position of the short oblique line segment is the beginning of the sentence, covering three lines of text. The content to be compressed is the three lines of text covered to the left of the end position of the short oblique line segment. The compression method is word width compression and / or word spacing compression, and the compression direction is leftward compression. The mobile phone compresses the content to be compressed according to the preset operation and displays the following Figure 9 In the interface 905 shown in (e), the marked area 92 is displayed in the interface 905.

[0210] In another possible design, if the starting and ending positions of the short slash segment are in the sentence and the inclination direction of the short slash segment is downward, the content to be compressed is the part of the content covered by the short slash segment in the line where the text covered by the short slash segment is located, the compression method is character height compression and / or line spacing compression, and the compression direction is downward compression.

[0211] For example, the preset operation sliding track is a short oblique line segment sloping downwards, and the starting position and the ending position of the short oblique line segment are both in the middle of the sentence, covering three lines of text. Then the content to be compressed is the part of the three lines of text where the short oblique line segment is located that is covered by the short oblique line segment. The compression method is character height compression and / or line spacing compression, and the compression direction is downward compression. The mobile phone compresses the content to be compressed according to the preset operation and displays the following Figure 9 In the interface 906 shown in (f), the marked area 92 is displayed in the interface 906.

[0212] In another possible design, if the starting and ending positions of the short slash operation are in the sentence, and the inclination direction of the short slash segment is upward, then the content to be compressed is the part of the content covered by the short slash segment in the line where the text covered by the short slash segment is located, and the compression method is character height compression and / or line spacing compression, and the compression direction is upward compression.

[0213] In another possible implementation, if the sliding trace corresponding to the preset operation is a short oblique line segment, the content to be compressed is the display content of the line where the short oblique line segment is located, the compression method is character width compression and / or character spacing compression, and the compression direction is left compression or right compression. For example, the compression direction corresponding to the preset operation of pre-configured sliding traces as short oblique line segments is pre-configured in the mobile phone, such as left compression or right compression. After the mobile phone detects the preset operation of the sliding trace as a short oblique line segment on the first interface, it compresses the display content of the line where the short oblique line segment is located to the left or to the right. For another example, the compression direction is determined according to the inclination direction of the short oblique line segment. For example, if the short oblique line segment is inclined upward, the corresponding compression direction is left compression; if the short oblique line segment is inclined downward, the corresponding compression direction is right compression.

[0214] Optionally, the sliding trajectory of the preset operation is a closed figure. A closed figure may include, for example, a completely closed figure or a closed figure that is closed to the edge of the displayed page. A completely closed figure means that the starting and ending positions of the preset operation coincide with each other. A closed figure that is closed to the edge of the displayed page means that the sliding trajectory of the preset operation itself is not closed, but forms a closed figure with the edge of the text document content displayed on the mobile phone.

[0215] Among them, when the sliding trajectory of the preset operation is a closed figure, the content to be compressed is the display content around the closed figure or the display content of the line where the text covered by the closed figure is located, that is, after the mobile phone compresses the content to be compressed according to the closed figure, the obtained annotation area is the area within the corresponding closed figure. The position of the closed figure corresponds to the position of the annotation area, and the size of the closed figure can correspond to the size of the annotation area. For example, the content to be compressed is the display content on the left side of the closed figure, the corresponding compression method is the character width and / or character spacing, and the compression direction is left compression. For another example, the content to be compressed is the display content on the right side of the closed figure, the corresponding compression method is the character width and / or character spacing, and the compression direction is right compression. For another example, the content to be compressed is the display content above the closed figure, such as the display content in the upper row, the corresponding compression method is the character height and / or line spacing, and the compression direction is upward compression. For another example, the content to be compressed is the display content below the closed figure, such as the display content in the lower row, the corresponding compression method is the character height and / or line spacing, and the compression direction is downward compression.

[0216] It should be noted that the embodiment of the present application does not limit the shape of the closed figure. The closed figure can be a regular closed shape or an irregular closed shape.

[0217] In a possible implementation, the sliding track of the preset operation is a completely closed closed figure. Figure 10As shown in (a) in the figure, the mobile phone detects the preset operation of the sliding track being a completely closed closed figure on the interface 1001, displays the sliding track 101, and determines that the content to be compressed is the display content of the line where the completely closed closed figure is located. The compression method is word width compression and / or word spacing compression. The compression direction of the content displayed on the left side of the midpoint of the sliding track 101 is leftward compression, and the compression direction of the content displayed on the right side of the midpoint of the sliding track 101 is rightward compression. After the mobile phone compresses the content to be compressed according to the preset operation, it displays as follows Figure 10 The interface 1002 shown in (b) is the second interface and includes the marked area 102.

[0218] In a possible implementation, the sliding track of the preset operation is a closed figure that is closed to the edge of the displayed page. Figure 11 As shown in (a) in the figure, the mobile phone detects the preset operation of the sliding track on the interface 1101 as a closed figure closed with the edge of the display page, displays the sliding track 111, and determines that the content to be compressed is the display content of the line where the closed figure closed with the edge of the display page is located. The compression method is word width compression and / or word spacing compression. The compression direction is left compression. After the mobile phone compresses the content to be compressed according to the preset operation, it displays the following Figure 11 The interface 1102 shown in (b) is the second interface and includes a marked area 112 .

[0219] Optionally, the sliding track of the preset operation is a preset symbol, for example, it can include a preconfigured symbol. If the mobile phone detects the preset symbol input by the user on the first interface, it confirms the switch to display the second interface. Among them, the preset symbol can include a preset symbol without direction and a preset symbol with direction. For example, Figure 12 In the interface 1201 shown in (a), the preset symbol is a V-shaped symbol, corresponding to the sliding track 121.

[0220] In one possible implementation, if the preset symbol is a non-directional preset symbol, the content to be compressed is the line containing the text covered by the preset symbol and / or adjacent lines. If the content to be compressed is the display content to the left and right of the preset symbol, the compression method is the character width and / or character spacing, and the compression direction is leftward or rightward. If the content to be compressed is the display content above and below the preset symbol, the compression method is the character height and / or line spacing, and the compression direction is upward or downward.

[0221] For example, Figure 12 As shown in (a) in FIG. 1 , the mobile phone detects on the interface 1201 that the sliding track is a preset operation of a preset symbol without a direction, and displays the sliding track 121 .

[0222] For example, the mobile phone determines that the content to be compressed is the display content of the line where the text covered by the preset symbol is located based on the sliding track 121. The compression method is word width compression and / or word spacing compression. The compression direction of the content on the left side of the preset symbol is left compression, and the compression direction of the content on the right side is right compression. After the mobile phone compresses the content to be compressed according to the preset operation, it displays the following Figure 12 The interface 1202 shown in (b) is the second interface and includes the marked area 122.

[0223] For example, the mobile phone determines that the content to be compressed is the display content of the line where the text covered by the preset symbol is located based on the sliding track 121. The compression method is character height compression and / or line spacing compression, and the compression direction is downward compression. After the mobile phone compresses the content to be compressed according to the preset operation, it displays the following Figure 12 The interface 1203 shown in (c) is the second interface and includes the marked area 123.

[0224] For another example, the mobile phone determines that the content to be compressed is the line where the text covered by the preset symbol is located and the display content of the previous line based on the sliding track 121. The compression method is character height compression and / or line spacing compression. The compression direction of the line where the preset symbol is located is downward compression, and the compression direction of the display content of the previous line is upward compression. After the mobile phone compresses the content to be compressed according to the preset operation, it displays the following Figure 12 The interface 1204 shown in (d) is the second interface and includes the marked area 124.

[0225] In another possible implementation, if the preset symbol is a directional symbol, the content to be compressed is the display content in the direction indicated by the directional symbol. The compression direction is the direction indicated by the directional annotation symbol. That is, after the mobile phone compresses the content to be compressed, the resulting annotation area is located in the direction indicated by the preset symbol. The compression method is the compression method corresponding to the direction indicated by the directional symbol.

[0226] For example, Figure 13 As shown in (a), the mobile phone detects a preset operation of a preset symbol on the interface 1301 with a sliding track, assuming that the direction of the current preset symbol is right. The mobile phone determines that the content to be compressed is the display content on the right side of the preset symbol in the row where the text covered by the preset symbol is located, or the content to be compressed is the display content of the row where the text covered by the preset symbol is located. The compression method is character width compression and / or character spacing compression, and the compression direction is rightward compression. After the mobile phone compresses the display content on the right side of the preset symbol in the row where the text covered by the compression symbol is located according to the preset operation, it displays as follows Figure 13 The interface 1302 shown in (b) is the second interface and includes the marked area 132. Alternatively, Figure 12As shown in (a) in the figure, the mobile phone detects that the sliding track on the interface 1201 is a preset operation of a preset symbol, assuming that the direction of the current preset symbol is upward. The mobile phone determines that the content to be compressed is the display content of the line where the text covered by the preset symbol is located. The compression method is character height compression and / or line spacing compression, and the compression direction is downward compression. After the mobile phone compresses the content to be compressed according to the preset operation, it displays the following Figure 13 The interface 1303 shown in (c) is the second interface and includes the marked area 133.

[0227] Optionally, the compression methods corresponding to the sliding tracks of the above-mentioned different preset operations may further include font weight compression, and the font weight compression may be combined with the change of font weight in the content to be compressed to obtain the marked area.

[0228] Optionally, if the mobile phone detects multiple preset operations and the annotation areas corresponding to the multiple preset operations are the same, it means that the user expands or reduces the current annotation area by applying multiple preset operations. The mobile phone can adjust the annotation area according to the compression method, compression direction and compression ratio corresponding to the multiple preset operations.

[0229] For example, after the phone detects that the sliding trajectory is a preset operation of a preset symbol, it determines that the display content in the row where the preset symbol is located is the content to be compressed, and the compression method is character height compression and / or line spacing compression, and the compression direction is downward compression. After compressing the content to be compressed, the phone displays the annotation area above the content to be compressed. Subsequently, the phone detects that the sliding trajectory of the display content above the annotation area is a preset operation of a long oblique line segment, and the long oblique line segment is tilted upward, then the display content covered by the long oblique line segment above the annotation area is compressed upward. Afterwards, the phone displays the expanded annotation area.

[0230] S503: The mobile phone receives the annotation content input by the user on the second interface, displays the annotation content in the annotation area, and adjusts the size of the annotation area according to the annotation content.

[0231] Optionally, the mobile phone displays a second interface and detects annotation content entered by the user using a stylus, finger, or keyboard on the second interface. The mobile phone can detect the annotation content entered by the user on the second interface, or detect the annotation content entered by the user within the annotation area. The mobile phone then displays the received annotation content within the annotation area on the second interface.

[0232] For example, Figure 6 The interface 603 shown in (c) is the second interface displayed after the mobile phone compresses the content to be compressed according to the preset operation. After the mobile phone detects the annotation content entered by the user in the interface 603, it displays the following Figure 6 In the interface 605 shown in (e), a marked area 62 is displayed in the interface 605, and marked content 63 is displayed in the marked area 62.

[0233] However, the area of ​​the annotation area obtained by the mobile phone according to the preset operation may not meet the area requirements of the annotation content, such as being smaller than or exceeding the area requirements of the annotation content. In this case, the size of the annotation area can be adjusted based on the number of characters and / or font size of the annotation content, such as by expanding or reducing the annotation area, so that the annotation area meets the area requirements of the annotation content. The operation of expanding or reducing the annotation area can be an automatic operation of the mobile phone based on the annotation content, or it can be an operation executed in response to a user operation.

[0234] For example, Figure 6 In the interface 605 shown in (e), the annotation content 63, such as "Important!", is displayed in the annotation area 62. If the mobile phone subsequently detects that more annotation content needs to be displayed in the annotation area 62, or the font size of the currently received annotation content exceeds the display upper limit of the annotation area 62, the annotation area 62 needs to be expanded. Figure 8 The interface 801 shown in (a) is the interface displayed after the mobile phone detects the increase of the annotated content, which includes the expanded annotated area 81. If the mobile phone detects that the annotated content has increased and exceeds the display upper limit of the current annotated area, it will continue to automatically compress the content to be compressed, such as compressing the content to be compressed downward to expand the annotated area 81, thereby adding more annotated content. Among them, the mobile phone can pre-configure the compression upper limit of the content to be compressed, and no compression will be performed when the compression upper limit is reached. Among them, the compression upper limit includes one or more of the following: minimum character height, narrowest character width, minimum character weight, narrowest character spacing, and narrowest line spacing. The compression upper limit threshold can be determined based on empirical values ​​or based on the display interface size, and the embodiments of the present application do not limit this.

[0235] Optionally, if the content to be compressed has been compressed to the upper limit and the annotation area cannot be further expanded, the phone may notify the user through a message or other means that the annotation content currently being entered is invalid and cannot be displayed. The user may also be advised to perform the preset operation again to create a new annotation area to display the undisplayed annotation content.

[0236] Optionally, if the mobile phone detects repeated preset operations, it will repeatedly compress the content to be compressed and expand the marked area according to the preset operations until the compression upper limit is reached, and then no further compression will be performed.

[0237] For example, Figure 6 In the interface 605 shown in (e), if the user believes that the annotation area 62 in the interface 605 does not meet the annotation requirements, the user can repeat the preset operation to expand the annotation area. Figure 8In the interface 802 shown in (b), the mobile phone detects the preset operation input repeatedly by the user. For example, the preset operation sliding trace detected for the first time is 82, and after a period of time, sliding trace 83 is detected. The preset operations corresponding to sliding trace 83 and sliding trace 82 are both downward sloping long oblique line sliding operations. Figure 6 Based on the interface 605 shown in (e), the content to be compressed is further compressed downward to obtain a marked area 84 larger than the marked area 62. When the compression upper limit is reached, no more compression is performed, thereby achieving the addition of more marked content.

[0238] Optionally, if the mobile phone does not receive any more annotation content required to be displayed in the current annotation area within a first time period after receiving and displaying the annotation content, i.e., the annotation content displayed in the annotation area is not updated. Furthermore, if there is a corresponding portion of blank area in the current annotation area, and the area of ​​the blank area is greater than a first threshold, the mobile phone may reduce the current annotation area. The first threshold may be a preconfigured empirical value.

[0239] For example, Figure 6 In the interface 605 shown in (e) of FIG, if the mobile phone does not receive the annotation content to be displayed in the annotation area 62 after a preset period of time, and there is a blank area below the annotation content 63 in the current annotation area 62, the mobile phone can expand the compressed content to be compressed upward. In other words, the character height and / or character spacing of the compressed content to be compressed can be increased until the annotation content matches, thereby optimizing the page display layout.

[0240] Optionally, if the phone detects a modification to a saved annotation, which increases or decreases the original annotation content, it will correspondingly expand or shrink the original annotation area to obtain an annotation area that matches the current annotation content. This optimizes the interface display to further enhance the user experience.

[0241] Optionally, if the content to be compressed has been compressed to the compression upper limit, and the mobile phone still detects annotation content that needs to be displayed in the current display area on the second interface, the mobile phone can expand the annotation area by compressing the display content near the annotation area to display more received annotation content.

[0242] In one possible implementation, if the sliding trajectory of the preset operation is a slanted line segment, after the content to be compressed reaches the compression upper limit, the mobile phone can compress the uncompressed display content in the preset area near the marked area as the marked content in the marked area increases, until the display content in the nearby preset area is also compressed to the compression upper limit.

[0243] For example, Figure 9In interface 903 shown in (c) of FIG, if the text to be compressed on the right side of the annotation area 92 reaches the compression limit as the annotation content increases, the mobile phone may compress the content displayed on the left side of the annotation area 92 to expand the annotation area 92 until the content displayed on the left also reaches the compression limit, at which point the compression stops.

[0244] In another possible implementation, if the sliding trajectory of the preset operation is a closed area operation, then after the content to be compressed is compressed to the upper limit of compression, part of the content to be compressed is displayed in a new line to expand the marked area. That is, the display content of a line below the marked area is compressed to obtain a first area. The first area is used to display the first part of the content to be compressed. Among them, the first area is located above the line of display content below the marked area, that is, the character height and / or line spacing of the line of display content below the marked area is compressed to obtain the first area. Alternatively, the first area is located to the left of the line of display content below the marked area, that is, the character width and / or character spacing of the line of display content below the marked area is compressed to obtain the first area. The first part of the content refers to the part of the content to be compressed that cannot be displayed in the display area of ​​the content to be compressed after the mobile phone expands the marked area according to the marked content.

[0245] For example, assuming Figure 11 In the example shown in (b) of FIG1 , there is no blank space left in the annotation area 112 of the interface 1102 for displaying the annotation content, and the content to be compressed 113 has been compressed to the upper limit and cannot be compressed further. At this point, the mobile phone detects the annotation content entered by the user on the interface 1102. The mobile phone can expand the size of the annotation area 112 in the following two ways.

[0246] For example, Figure 11 In interface 1103 shown in (c) of FIG, the mobile phone compresses the line of content displayed below the marked area 112 downward, i.e., reduces the character height and / or line spacing of the line, thereby obtaining a partial blank area 114 above it. The mobile phone then displays part of the text in the content to be compressed to the left of the marked area 112 in blank area 114, thereby obtaining more blank space for horizontally expanding the marked area 112 and ensuring the integrity of the content displayed in interface 1103.

[0247] For example, Figure 11 In the interface 1104 shown in (d), the mobile phone compresses the content displayed in a line below the marked area 112 to the right, that is, after reducing the character width and / or character spacing of the line, a partial blank area is obtained on its left side. After that, the mobile phone displays part of the text in the content to be compressed on the left side of the marked area 112 in the obtained blank area, thereby obtaining more blank area for horizontally expanding the marked area 112, and being able to ensure the integrity of the content displayed on the interface 1104.

[0248] In another possible implementation, if the sliding track of the preset operation is a preset symbol, then after the content to be compressed corresponding to the preset symbol is compressed to the upper limit of compression, the mobile phone compresses the uncompressed display content in the row where the preset symbol is located. Alternatively, the mobile phone displays the content to be compressed in a new row, thereby expanding the annotated area. Alternatively, if the current preset symbol is a preset symbol with a direction, the display content of the adjacent rows of the content to be compressed is compressed, thereby expanding the annotated area. For example, if the direction is upward or downward, the display content of the content to be compressed is compressed M rows above or N rows below the content to be compressed, thereby expanding the annotated area. Wherein, M and N are positive integers.

[0249] For example, Figure 13 In the interface 1302 shown in (b), the direction of the preset symbol is right. If the content to be compressed on the right side reaches the compression limit as the annotated content increases, the mobile phone can compress the displayed content on the left side of the preset symbol to expand the annotated area 132.

[0250] For example, Figure 13 In the interface 1302 shown in (b) of FIG, the preset symbol is oriented rightward. If, as the annotated content increases, the content to be compressed on the right side reaches the upper limit of compression, the mobile phone can compress the content displayed in the row below the preset symbol. A blank area is created above or to the left of the content displayed in the row below, and part of the content to be compressed is displayed in the blank area, thereby expanding the annotated area 132.

[0251] For example, Figure 13 In the interface 1303 shown in (c), the preset symbol direction is upward. After the mobile phone compresses the content to be compressed, it obtains the marked area 133. As the marked content in the marked area 133 increases, the content to be compressed is compressed to the upper limit of compression. At this time, the mobile phone detects the marked content input by the user on the interface 1303, and determines the content below the content to be compressed that needs to be compressed according to the preset symbol operation direction. After compression, it is displayed as follows Figure 13 In the interface 1304 shown in (d), the interface 1304 includes a marked area 134 that is larger than the marked area 133. As the marked content continues to increase, the display content of the lines to be compressed below the content to be compressed can be determined line by line, thereby continuously expanding the marked area.

[0252] Optionally, the mobile phone does not display the marked content and / or the preset operation sliding track in response to the erase operation. Specifically, the sliding track of the preset operation displayed by the mobile phone will cover the content to be compressed, affecting the user's viewing of the content to be compressed. Figure 6In the interface 605 shown in (e) of FIG, the user can use the eraser option in the toolbar 64 to delete or hide the sliding track of the current preset operation. Alternatively, if the user does not want to retain the annotation content in the current annotation area, the user can also use the eraser option in the toolbar 64 to delete or hide the current annotation content. Alternatively, the user can use the eraser option in the toolbar 64 to delete or hide the sliding track and annotation content of the current preset operation.

[0253] For example, Figure 6 In the interface 605 shown in (e) of FIG, after the mobile phone detects that the user clicks the eraser option in the toolbar 64, it can determine the content to be erased by detecting the user's sliding track on the interface 605. For example, it can erase part of the annotated content, all the annotated content, or the sliding track of a preset operation. Alternatively, after the mobile phone detects that the user has erased all the annotated content, it can also delete the sliding trace. Alternatively, after the mobile phone detects that the user has erased the sliding trace, it can also delete or hide the annotated content.

[0254] In a possible implementation, if the mobile phone is equipped with a stylus, the mobile phone can confirm the execution of the erase operation by detecting the key value sent after the user operates a button on the stylus.

[0255] Optionally, after completing the annotation, the user can save the current annotation content. Figure 6 In the interface 605 shown in (e), the mobile phone detects that the user clicks the icon 65, which means that the marking is completed. In response to the operation of the operation icon 65, the mobile phone displays the following Figure 6 The interface 606 shown in (f) includes annotation content added by the user.

[0256] Optionally, the mobile phone does not receive the marked content and / or detects the first operation within the second time period, and switches from the second interface to the first interface.

[0257] The second time period is a preconfigured time period, which can be configured based on experience or user habits, or customized by the user. The first operation can include, for example, an interactive operation with the user other than the annotation operation, such as a first operation of detecting a user sliding the display screen to view other content, or a first operation of detecting a user turning a page, etc.

[0258] Specifically, if the user's mistaken operation causes the phone to display the marked area, the user currently has no marking requirements. Alternatively, the user's preset operation is performed in the wrong position, resulting in the marked area being a non-ideal marked area. Alternatively, after the user performs the preset operation, there is no need for marking. In this case, the phone may not receive the marked content and / or detect the first operation in the second time period. The phone then determines that the marked area needs to be deleted and automatically restores the compressed content to its initial state, that is, displays the display interface before the current preset operation is obtained, to ensure the normal display of the phone.

[0259] Thus, the annotation method provided by this application adjusts the font format and / or paragraph format of at least part of the content in the document file to obtain more blank area for annotation, which can prevent the annotation content from overwriting the original text content of the document file. In addition, this application can also adaptively adjust the size of the annotation area according to the requirements of the annotation content, allowing users to annotate more freely and improving the user's reading experience.

[0260] In addition, since this application achieves a larger annotation area by adjusting the font format and / or paragraph format of at least part of the content in the document file, it does not reduce the content displayed in the document file on the current page, and the addition of annotation content will not cause inconvenience to users in reading the original document file.

[0261] The present application also provides a marking method, such as Figure 14 FIG. 1 is a flow chart of another marking method provided in an embodiment of the present application, which may include:

[0262] S1401: The electronic device displays a first interface.

[0263] The first interface is an interface of a first application, and the first application can be used to display the content of a document file. For example, the first interface is an interface displayed after detecting that the user has entered the annotation mode, or the first interface is a reading interface of a document file.

[0264] S1402: The electronic device detects a preset operation on the first interface and determines a sliding track of the preset operation.

[0265] The preset operation is a sliding operation performed by the user along a preset trajectory, and the sliding trajectory of the preset operation can be a slanted line segment, a closed figure, or a preset symbol.

[0266] S1403: The electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding track of the preset operation to obtain a second area.

[0267] Specifically, the first file is a document file displayed by the first application. The electronic device can determine at least part of the text and compression strategy in the first file corresponding to different sliding tracks according to the detected different sliding tracks of the preset operation.

[0268] The compression strategy includes one or more of a compression method, a compression direction, and a compression ratio. The compression method includes one or more of the following: character height compression, character width compression, character weight compression, character spacing compression, and line spacing compression; the compression direction includes one or more of the following: upward compression, downward compression, leftward compression, and rightward compression; and the compression ratio is determined by the electronic device based on the coverage width and / or length of the sliding track of a preset operation, or based on the execution time of the preset operation, or is a default value.

[0269] For example, when the sliding trajectory of the preset operation is a slanted line segment and the width of the slanted line segment is greater than a first threshold value, the electronic device compresses the character height and / or line spacing of the line of text covered by the slanted line segment to obtain a second area; or, when the sliding trajectory of the preset operation is a slanted line segment and the width of the slanted line segment is less than or equal to the first threshold value, the electronic device compresses the character width and / or character spacing of the line of text covered by the slanted line segment, or compresses the character width and / or character spacing of the text covered by the slanted line segment to obtain a second area.

[0270] For example, when the width of the oblique line segment is greater than the first threshold and the oblique line segment is tilted upward, the compressed text is located above or below the second area; when the width of the oblique line segment is greater than the first threshold and the oblique line segment is tilted downward, the compressed text is located below or above the second area; when the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted upward, the compressed text is located on the left or right side of the second area; when the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is tilted downward, the compressed text is located on the right or left side of the second area.

[0271] For another example, when the sliding track of the preset operation is a closed graphic, the electronic device compresses the character width and / or character spacing of the line of text covered by the closed graphic to obtain the second area.

[0272] For another example, when the sliding track of the preset operation is a preset symbol, the electronic device compresses the character height and / or line spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain a second area; or, the electronic device compresses the character width and / or character spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain a second area.

[0273] In addition, for other specific implementations of the electronic device determining at least part of the text in the first file corresponding to different sliding trajectories and the compression strategy, reference can be made to the steps and functions executed by the mobile phone described above.

[0274] S1404: The electronic device displays a second interface including a second area.

[0275] Among them, the second interface is the interface displayed by the electronic device in the annotation mode. The second interface includes a first area and a second area, the first area is used to display the content of the document file, and the second area is used to display the annotation content. After the electronic device uses the compression strategy to compress the compressed object, at least part of the text in the first area has a different font format and / or paragraph format from the text in the document file in the first interface. The font format of the text includes one or more of the following: font height, font width, and font weight. The paragraph format of the text includes character spacing and / or line spacing.

[0276] S1405: No annotation content is received and / or no first operation is detected within a preset time period. If yes, execute step S1406; if no, execute step S1407.

[0277] The first operation is an operation other than adding annotation content, such as turning a page. When no annotation content input by the user is received within a preset time period after detecting a preset operation, or when an operation of deleting an annotation or exiting the annotation mode performed by the user is detected, the electronic device displays the first interface.

[0278] S1406: The electronic device deletes the second area and displays the first interface.

[0279] Specifically, if the user's erroneous operation causes the electronic device to display the second area, then the user currently has no annotation requirements. Alternatively, the user's preset operation applies to the wrong location, resulting in the second area being a non-ideal annotation area. Alternatively, after the user performs the preset operation, there is no annotation requirement. In this case, the electronic device may not receive the annotation content and / or detect the first operation in the second time period, and the electronic device determines that the second area needs to be deleted, and automatically restores the compressed text content to its initial state, that is, displays the display interface before the current preset operation is obtained, to ensure the normal display of the electronic device.

[0280] S1407: The electronic device receives annotation content input by the user on the second interface.

[0281] S1408: The second area meets the requirements for displaying the annotated content. If yes, execute step S1412; if not, execute step S1409.

[0282] S1409: The second area is smaller than the display requirement of the annotation content. If yes, go to step S1410; if not, go to step S1413.

[0283] S1410: The electronic device adjusts the size of the second area according to the number of characters and / or font size of the annotated content.

[0284] S1411: Compress to the upper limit of compression. If yes, execute step S1412; if not, execute steps S1409 to S1411 in a loop.

[0285] S1412. The electronic device displays the marked content.

[0286] S1413: The electronic device shrinks the second area and displays the marked content.

[0287] Through the above steps S1407-S1413, the electronic device adjusts the size of the second area according to the number of characters and / or font size of the annotation content detected on the second interface, so that the annotation area matches the annotation content, obtains a better display effect, and improves user experience.

[0288] S1414: The electronic device detects an erase operation on the second interface. If yes, execute step S1415; if not, execute step S1416.

[0289] S1415. The electronic device does not display the sliding trace of the preset operation on the second interface, or does not display the sliding trace of the preset operation and the annotation content.

[0290] S1416. In response to the save operation detected on the second interface, the electronic device saves the annotated content.

[0291] In this way, by adjusting the font format and / or paragraph format of at least part of the document file, the electronic device can obtain more blank space for annotation, thereby preventing the annotation content from overwriting the original text content of the document file. In addition, the size of the annotation area can be adaptively adjusted according to the requirements of the annotation content, allowing users to annotate more freely and improving the user's reading experience.

[0292] In addition, since the electronic device achieves a larger annotation area by adjusting the font format and / or paragraph format of at least part of the content in the document file, it does not reduce the content displayed in the document file on the current page, and the addition of annotation content will not cause inconvenience to the user in reading the original document file.

[0293] Furthermore, the electronic device may also execute the steps and functions executed by the mobile phone in the above embodiments, thereby realizing the marking method provided in the above embodiments.

[0294] like Figure 15 As shown, the embodiment of the present application discloses an electronic device, which can be used to implement the methods described in the above method embodiments. For example, the electronic device 1500 may include: a display unit 1501, a detection unit 1502 and a processing unit 1503. Among them, the display unit 1501 is used to support the electronic device to execute Figure 5Steps S501 and S502 in the above description; the detection unit 1502 is used to support the electronic device to perform Figure 5 Step S502 in the processing unit 1503 is used to support the electronic device to perform Figure 5 All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0295] like Figure 16 As shown, an embodiment of the present application discloses an electronic device, including: a touch screen 1601, wherein the touch screen 1601 includes a touch-sensitive surface 1606 and a display screen 1607; one or more processors 1602; a memory 1603; and one or more computer programs 1604. The aforementioned components may be connected via one or more communication buses 1605. The one or more computer programs 1604 are stored in the memory 1603 and configured to be executed by the one or more processors 1602. The one or more computer programs 1604 include instructions that can be used to perform the various steps of the aforementioned embodiment.

[0296] Optional, still as Figure 16 As shown, the electronic device may further include a communication module 1608. The communication module 1608 may be used to interact with a stylus pen.

[0297] For example, the processor 1602 may be Figure 2A The processor 110 shown in FIG. 1 , the memory 1603 may specifically be Figure 2A The internal memory 121 shown, the display screen 1607 can be specifically Figure 2A The display screen 194 shown, the communication module 1608 can be specifically Figure 2A The mobile communication module 150 and / or wireless communication module 160 shown in FIG. 1 may include the touch-sensitive surface 1606. Figure 2A The touch sensor in the sensor module 180 shown is not limited in any way in the embodiment of the present application.

[0298] An embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected via lines. For example, the interface circuit can be used to receive signals from other devices. For another example, the interface circuit can be used to send signals to other devices. Exemplarily, the interface circuit can read instructions stored in a memory and send the instructions to the processor. When the instructions are executed by the processor, the electronic device can execute the various steps performed by the mobile phone in the above embodiment. Of course, the chip system can also include other discrete components, which are not specifically limited in the embodiment of the present application.

[0299] An embodiment of the present application also provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on a terminal device, the terminal device executes the above-mentioned related method steps to implement the marking method in the above-mentioned embodiment.

[0300] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the marking method in the above-mentioned embodiment.

[0301] In addition, an embodiment of the present application also provides a device, which can specifically be a component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the device to execute the labeling method in the above-mentioned method embodiments.

[0302] Among them, the terminal device, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0303] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0304] In the several embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. For example, the terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, 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 through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.

[0305] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0306] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0307] 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 technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program instructions, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.

[0308] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A marking method, characterized in that: The method comprises: The electronic device displays a first interface; the first interface displays the content of the first file; In response to detecting a preset operation on the first interface, the electronic device displays a second interface; the second interface includes a first area and a second area, the first area is used to display the content of the first file, and the second area is a blank area for annotation; wherein at least part of the text in the first area has a different font format and / or paragraph format from the text in the first file on the first interface; the at least part of the text is determined according to the location where the preset operation is performed; The step of displaying the second interface by the electronic device in response to detecting a preset operation on the first interface includes: In response to detecting a preset operation on the first interface, the electronic device compresses at least part of the text in the first file using a compression strategy corresponding to a sliding track of the preset operation to obtain the second area; The electronic device displays the second interface including the second area.

2. The method according to claim 1, characterized in that The preset operation is a sliding operation performed by the user along a preset trajectory, and the preset trajectory includes one or more of the following: a slash segment, a closed figure, and a preset symbol.

3. The method according to claim 1, characterized in that The font format of the text includes one or more of the following: character height, character width, and character weight; the paragraph format of the text includes character spacing and / or line spacing.

4. The method according to claim 1, wherein The electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding track of the preset operation to obtain the second area, including: When the sliding track of the preset operation is a slanted line segment and the width of the slanted line segment is greater than a first threshold, the electronic device compresses the character height and / or line spacing of the line of text covered by the slanted line segment to obtain the second area; or When the sliding trajectory of the preset operation is a slanted line segment and the width of the slanted line segment is less than or equal to a first threshold, the electronic device compresses the character width and / or character spacing of the line of text covered by the slanted line segment, or compresses the character width and / or character spacing of the text covered by the slanted line segment to obtain the second area.

5. The method according to claim 4, characterized in that The method further comprises: When the width of the oblique line segment is greater than a first threshold and the oblique line segment is inclined upward, the compressed text is located above or below the second area; When the width of the oblique line segment is greater than a first threshold and the oblique line segment is inclined downward, the compressed text is located below or above the second area; When the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is inclined upward, the compressed text is located on the left or right side of the second area; When the width of the oblique line segment is less than or equal to the first threshold, and the oblique line segment is inclined downward, the compressed text is located on the right side or the left side of the second area.

6. The method according to claim 1, wherein The electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding track of the preset operation to obtain the second area, including: When the sliding track of the preset operation is a closed figure, the electronic device compresses the character width and / or character spacing of the line where the text covered by the closed figure is located to obtain the second area.

7. The method according to claim 1, characterized in that The electronic device compresses at least part of the text in the first file using a compression strategy corresponding to the sliding track of the preset operation to obtain the second area, including: When the sliding track of the preset operation is a preset symbol, the electronic device compresses the character height and / or line spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain the second area; or, the electronic device compresses the character width and / or character spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines to obtain the second area.

8. The method according to claim 7, characterized in that The method further comprises: When the preset symbol is a preset symbol with direction, the electronic device compresses the line of text covered by the preset symbol with direction to obtain the second area; the second area is located in the first direction of the preset symbol with direction, and the first direction is the direction indicated by the preset symbol with direction.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: The electronic device receives annotation content input by the user on the second interface, and adjusts the size of the second area according to the number of characters and / or font size of the annotation content.

10. The method according to any one of claims 1 to 8, characterized in that After the electronic device displays the second interface in response to detecting a preset operation on the first interface, the method further includes: When no annotation content input by the user is received within a preset time period after detecting a preset operation, or when it is detected that the user performs an operation of deleting the annotation or exiting the annotation mode, the electronic device displays the first interface.

11. An electronic device, characterized in that: include: A processor, a memory, and a touch screen, wherein the memory and the touch screen are coupled to the processor, the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor reads the computer instructions from the memory, the electronic device performs the following operations: Displaying a first interface; wherein the first interface displays the content of the first file; In response to detecting a preset operation on the first interface, a second interface is displayed; the second interface includes a first area and a second area, the first area is used to display the content of the first file, and the second area is a blank area for displaying annotations; wherein at least part of the text in the first area has a different font format and / or paragraph format than the text in the first file in the first interface; the at least part of the text is determined according to the location of the preset operation; The displaying of the second interface in response to detecting a preset operation on the first interface includes: In response to detecting a preset operation on the first interface, compressing at least part of the text in the first file using a compression strategy corresponding to a sliding track of the preset operation to obtain the second area; The second interface including the second area is displayed.

12. The electronic device according to claim 11, wherein: The preset operation is a sliding operation performed by the user along a preset trajectory, and the preset trajectory includes one or more of the following: a slash segment, a closed figure, and a preset symbol.

13. The electronic device according to claim 11, wherein: The font format of the text includes one or more of the following: character height, character width, and character weight; the paragraph format of the text includes character spacing and / or line spacing.

14. The electronic device according to claim 11, wherein: The compressing at least part of the text in the first file using the compression strategy corresponding to the sliding track of the preset operation to obtain the second area includes: When the sliding track of the preset operation is a slanted line segment and the width of the slanted line segment is greater than a first threshold, compressing the character height and / or line spacing of the line of text covered by the slanted line segment to obtain the second area; or, When the sliding track of the preset operation is a slanted line segment and the width of the slanted line segment is less than or equal to a first threshold, the character width and / or character spacing of the line of text covered by the slanted line segment is compressed, or the character width and / or character spacing of the text covered by the slanted line segment is compressed to obtain the second area.

15. The electronic device according to claim 14, characterized in that When the processor reads the computer instructions from the memory, the electronic device is further caused to perform the following operations: When the width of the oblique line segment is greater than a first threshold and the oblique line segment is inclined upward, the compressed text is located above or below the second area; When the width of the oblique line segment is greater than a first threshold and the oblique line segment is inclined downward, the compressed text is located below or above the second area; When the width of the oblique line segment is less than or equal to the first threshold and the oblique line segment is inclined upward, the compressed text is located on the left or right side of the second area; When the width of the oblique line segment is less than or equal to the first threshold, and the oblique line segment is inclined downward, the compressed text is located on the right side or the left side of the second area.

16. The electronic device according to claim 11, wherein: The compressing at least part of the text in the first file using the compression strategy corresponding to the sliding track of the preset operation to obtain the second area includes: When the sliding track of the preset operation is a closed graphic, the character width and / or character spacing of the line where the text covered by the closed graphic is located is compressed to obtain the second area.

17. The electronic device according to claim 11, wherein: The compressing at least part of the text in the first file using the compression strategy corresponding to the sliding track of the preset operation to obtain the second area includes: When the sliding track of the preset operation is a preset symbol, the character height and / or line spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines are compressed to obtain the second area; or, the character width and / or character spacing of the line where the text covered by the preset symbol is located and / or the adjacent lines are compressed to obtain the second area.

18. The electronic device according to claim 17, wherein: When the processor reads the computer instructions from the memory, the electronic device is further caused to perform the following operations: When the preset symbol is a preset symbol with direction, the line of text covered by the preset symbol with direction is compressed to obtain the second area; the second area is located in the first direction of the preset symbol with direction, and the first direction is the direction indicated by the preset symbol with direction.

19. The electronic device according to any one of claims 11 to 18, characterized in that: When the processor reads the computer instructions from the memory, the electronic device is further caused to perform the following operations: The electronic device receives annotation content input by the user on the second interface, and adjusts the size of the second area according to the number of characters and / or font size of the annotation content.

20. The electronic device according to any one of claims 11 to 18, characterized in that: After the second interface is displayed in response to detecting a preset operation on the first interface, when the processor reads the computer instructions from the memory, the electronic device further performs the following operations: When no annotation content input by the user is received within a preset time period after a preset operation is detected, or when it is detected that the user performs an operation of deleting the annotation or exiting the annotation mode, the first interface is displayed.

21. The electronic device according to any one of claims 11 to 18, characterized in that: The electronic device further includes a stylus pen, which is used to input preset operations and annotation content into the touch screen.

22. A computer-readable storage medium having instructions stored therein, characterized in that: When the instruction is executed on an electronic device, the electronic device is enabled to execute the marking method according to any one of claims 1 to 10.

23. A computer program product comprising instructions, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to execute the marking method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Overlay presentation of textual and graphical annotations

    US20020010707A1

  • Electronic document editing apparatus capable of inserting memo into paragraph, and operating method thereof

    US20170329756A1

  • Adaptive annotations

    US9430141B1