Method for editing handwritten notes and electronic equipment

By receiving editing instructions through electronic devices and adjusting the position of text in handwritten notes, the problem of uneven layout of handwritten notes is solved, achieving both aesthetic appeal and convenience in text arrangement, and improving the user experience.

CN120928992APending Publication Date: 2025-11-11HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411172600.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-05-08
Filing Date
2024-08-23
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In complex handwritten note-taking scenarios, users find it difficult to achieve a neat and aesthetically pleasing layout, requiring frequent switching of tools for manual adjustments, which is time-consuming, laborious, and makes it difficult to guarantee the neatness of the handwriting.

Method used

The electronic device receives editing instructions on the display screen to adjust the position of the text in the handwritten notes, so that the text lines are at the same angle or within a preset distance range, rotates lines with abnormal angles and/or moves text with abnormal vertical positions, so as to achieve neat text arrangement.

Benefits of technology

It improves the aesthetics and convenience of handwritten notes, enhancing user efficiency and experience in note-taking apps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120928992A_ABST
    Figure CN120928992A_ABST
Patent Text Reader

Abstract

The invention provides a method for editing handwritten notes and electronic equipment, relates to the technical field of terminals, and is used for solving the problem of how to realize tidy and attractive handwritten note layout in a complicated handwritten note scene. According to the scheme, the method comprises the steps that a note interface is displayed on a display screen, handwritten notes are displayed on the note interface, and the handwritten notes comprise one or more paragraphs; receiving an editing instruction which acts on the note interface and aims at the handwritten note; in response to the editing instruction, the character position in at least one paragraph is adjusted to obtain an edited handwritten note, the line angle in any one paragraph in the at least one paragraph in the edited handwritten note is the same as the angle of the paragraph, and / or the line angle in any one paragraph in the edited handwritten note is the same as the line angle in any one paragraph in the at least one paragraph in the edited handwritten note. The position of each row of characters in any paragraph in the paragraph meets a first requirement, and the at least one paragraph is a paragraph acted by the editing instruction; and displaying the edited handwritten note.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese patent application filed on May 8, 2024, with application number 202410565453.2 and entitled "Method for Intelligent Editing of Handwritten Handwriting", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to a method and electronic device for editing handwritten notes. Background Technology

[0003] With the widespread adoption of mobile devices (such as smartphones or tablets), note-taking apps like memos and sticky notes are increasingly used in various scenarios. Users can use their fingers or a stylus to write notes in these apps during daily meetings, video learning sessions, and other similar situations.

[0004] However, in the aforementioned scenarios, users often encounter situations where they miswrite or omit words. To edit or modify handwritten notes, users need to switch back and forth between tools such as pens, lasso tools, and erasers, and manually adjust the relative positions of text within the handwritten notes. This is time-consuming and laborious, and it is difficult to maintain the neatness of the handwriting layout during this process. Therefore, how to achieve a neat and aesthetically pleasing layout for handwritten notes in complex handwriting note-taking scenarios is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides a method and electronic device for editing handwritten notes, which solves the problem of how to achieve a neat and beautiful layout of handwritten notes in complex handwritten note scenarios.

[0006] To achieve the intended purpose, the embodiments of this application provide the following technical solutions:

[0007] In a first aspect, embodiments of this application provide a method for editing handwritten notes. This method is applied to an electronic device with a display screen. The method includes: the electronic device displaying a note interface on the display screen. The note interface displays handwritten notes, which include one or more paragraphs. The electronic device receives an editing instruction applied to the note interface for the handwritten notes. In response to the editing instruction, the electronic device adjusts the text position within a first paragraph to obtain an edited handwritten note. The text position within the first paragraph in the edited handwritten note meets one or more of the following requirements: the angle of any line within the first paragraph is the same as the angle of the first paragraph; the position of any line of text within the first paragraph meets a first requirement, whereby the distance between the text in any line and the center line of that line is within a preset distance threshold range. The first paragraph is the paragraph affected by the editing instruction. The electronic device displays the edited handwritten note.

[0008] The handwritten note editing method provided in this application allows an electronic device to respond to user-inputted editing commands for a specific paragraph in a handwritten note when using a note-taking app. The device then adjusts the text positions within the first paragraph according to the editing commands, ensuring that the angle between any line within the first paragraph and the paragraph itself is the same, or that the position of any line of text within the first paragraph meets a first requirement: the distance between any line of text and the line center line is within a preset distance threshold range. This ensures that there are no lines with abnormal angles or text with abnormal vertical positions relative to the line center line within the adjusted first paragraph. This solution results in a neat and aesthetically pleasing arrangement of text in the edited handwritten note. This method helps users use note-taking apps more conveniently, easily organize notes, and conforms to user habits, improving user efficiency and ultimately enhancing the user experience.

[0009] In one possible implementation of this application, the electronic device adjusts the text position within a first paragraph to obtain an edited handwritten note, including: rotating lines with abnormal angles within the first paragraph so that the angle of the rotated lines with abnormal angles is the same as the angle of the first paragraph, to obtain the edited handwritten note, wherein the lines with abnormal angles are lines in one or more rows included in the first paragraph whose angle difference from the angle of the first paragraph is greater than or equal to an angle difference threshold; and / or,

[0010] The electronic device adjusts the position of the text with abnormal vertical positioning in the first paragraph so that the distance between the text in the line containing the text with abnormal vertical positioning and the center line of the line is within a preset distance threshold range, so as to obtain the edited handwritten notes.

[0011] In this solution, by rotating the lines with abnormal angles within the first paragraph and / or adjusting the positions of text with abnormal vertical positions within the first paragraph, the text within the first paragraph can be arranged as a whole.

[0012] For example, the electronic device adjusts the position of text with abnormal vertical position in the first paragraph, including: the electronic device can move the text with abnormal vertical position in a direction closer to or farther away from the line center line, so that the distance between the text with abnormal vertical position and the line center line after the movement is within a preset distance threshold range.

[0013] For example, the preset distance threshold range is determined by the average, median, or mode of the first distance from all the text in the line containing the text with abnormal vertical position to the line center line of the line.

[0014] In one possible implementation of this application, the first requirement further includes: the spacing between adjacent characters within the first paragraph is within a preset spacing threshold range.

[0015] In one possible implementation of this application, the electronic device adjusts the position of the text in the first paragraph to obtain the edited handwritten notes, and further includes: the electronic device adjusts the position of the text with abnormal left and right spacing in the first paragraph so that the text spacing between adjacent text in the line containing the text with abnormal left and right spacing is within a preset spacing threshold range, so as to obtain the edited handwritten notes.

[0016] For example, an electronic device can adjust the position of text with abnormal left and right spacing within any line of the first paragraph in the following way: the electronic device moves the text with abnormal left and right spacing along the line center line towards or away from adjacent text, so that the spacing between the text with abnormal left and right spacing and adjacent text is within a preset spacing threshold range. Alternatively, the electronic device can also move the adjacent text of the text with abnormal left and right spacing, so that the spacing between the text with abnormal left and right spacing and adjacent text after the movement is greater than or equal to a first spacing threshold.

[0017] In one possible implementation of this application, before the electronic device rotates the angle-abnormal rows within the first paragraph so that the angle of the angle-abnormal rows is the same as the angle of the first paragraph to obtain the edited handwritten notes, the method provided in this application embodiment further includes: the electronic device determining the angle of each row within the first paragraph and the angle of the first paragraph; the electronic device determining the angle-abnormal rows within the first paragraph based on the angle of the first paragraph and the angle of each row within the first paragraph. For example, if the difference between the angle of any row and the angle of the first paragraph is greater than or equal to an angle difference threshold, then that row is considered an angle-abnormal row within the first paragraph.

[0018] In one possible implementation of this application, before the electronic device adjusts the position of characters with abnormal vertical positions in the first paragraph so that the distance between the characters in any line and the center line of any line is within a first distance threshold range, the method provided in this application embodiment further includes: the electronic device determining a first distance between each character in the first paragraph and the center line of the line where each character is located; the electronic device determining one or more first characters in the first paragraph based on the first distance between each character and the center line of the line where each character is located, wherein the first characters are characters with abnormal vertical positions in the first paragraph.

[0019] In one possible implementation of this application, a first distance between the first character and the center line of the line containing the first character is greater than or equal to a third distance threshold, and / or, the first distance between the first character and the center line of the line containing the first character is less than or equal to a fourth distance threshold. The third distance threshold and / or the fourth distance threshold are determined by the average distance from all characters in the line containing the first character to the center line of the line containing the first character. The third distance threshold is greater than or equal to a second distance threshold. The fourth distance threshold is less than the first distance threshold.

[0020] In one possible implementation of this application, the upper limit of the preset distance threshold range is a second distance threshold, meaning that the distance between the adjusted text with abnormal vertical position and the center line of the line must be less than or equal to the second distance threshold of that line. Optionally, the lower limit of the preset distance threshold range is a first distance threshold, meaning that the distance between the adjusted text with abnormal vertical position and the center line of the line must be greater than or equal to the first distance threshold. The first and second distance thresholds are determined by the average, median, or mode of the distances between the adjusted text with abnormal vertical position and the center line of all text in the line, with the first distance threshold being less than the second distance threshold.

[0021] In one possible implementation of this application, the distance between the adjusted text with abnormal vertical position and the line center line of its corresponding line satisfies the following requirement: dist(P ij , l i )≥A i1 and / or dist(P) ij , l i )≤A i2 Among them, dist(P ij , l i ) represents the first distance from the center of the j-th first character in the i-th line to the center line of the i-th line. A i1 This represents the first distance threshold for the i-th row. A i2 The second distance threshold represents the distance to the i-th line. The first distance threshold and / or the second distance threshold are determined by the average distance, median or mode of all characters in the i-th line to the center line of the i-th line. The first distance threshold is less than the second distance threshold.

[0022] In one possible implementation of this application, before the electronic device adjusts the position of characters with abnormal left-right spacing in any line within the first paragraph, such that the spacing between adjacent characters in the adjusted line is greater than or equal to a first spacing threshold, to obtain the edited handwritten note, the method provided in this application embodiment further includes: the electronic device determining the spacing between any character in the first paragraph and its adjacent characters; the adjacent characters of the any character and the any character belong to the same line. Based on the spacing between the any character and its adjacent characters, the electronic device determines one or more second characters within the first paragraph, where the spacing between the second character and its adjacent characters does not meet a third requirement, and the second character is a character with abnormal left-right spacing within the first paragraph. The third requirement is determined by the spacing between all characters in the line containing the second character.

[0023] In one possible implementation of this application, the preset spacing threshold range is determined by the average, median, or mode of the spacing between all characters in any line.

[0024] In one possible implementation of this application, the upper limit of the preset spacing threshold range can be a second spacing threshold, meaning that the spacing between adjacent characters in any line after adjustment needs to be less than or equal to the second spacing threshold. Optionally, the lower limit of the preset spacing threshold range can be a first spacing threshold, meaning that the spacing between adjacent characters in any line after adjustment needs to be greater than or equal to the first spacing threshold. The first spacing threshold is greater than the second spacing threshold. The first and second spacing thresholds are determined by the average spacing between characters in any line, or the median or mode of the spacing between characters in any line.

[0025] In one possible implementation of this application, the spacing between adjacent characters in any line after adjustment satisfies the following requirement: dist(P ij ,P ij+1 ,l i )>y and / or dist(P ij ,P ij+1 ,l i ) < m, where dist(P ij ,P ij+1 ,l i ) represents the spacing between the j-th second character in the i-th row and its adjacent characters, y represents the first spacing threshold, and m represents the second spacing threshold, wherein the first spacing threshold is greater than the second spacing threshold.

[0026] Secondly, embodiments of this application provide a method for editing handwritten notes. This method is applied to an electronic device with a display screen. The method includes: the electronic device displaying a note interface on the display screen, the note interface displaying handwritten notes, the handwritten notes including one or more paragraphs; the electronic device receiving an editing instruction applied to the note interface for a first paragraph, the editing instruction being a deletion or insertion operation, the first paragraph belonging to one or more paragraphs; the electronic device responding to the editing instruction by at least reformatting the first paragraph to obtain a reformatted handwritten note; and the electronic device moving the text to be moved from its initial position to its final position in the reformatted handwritten note according to the final position of the text to be moved, the text to be moved being the text in the reformatted first paragraph whose initial and final positions differ.

[0027] This solution ensures the neatness and aesthetics of the handwritten note layout by reformatting at least the first paragraph when the user's input for editing the handwritten note is a delete or insert operation. It improves the ease of editing handwritten text and, based on the final position of the text to be moved in the reformatted note, moves it from its initial position to its final position and displays it. The changed text naturally reminds the user of which handwriting styles have changed, enhancing the visual experience and usability.

[0028] In one possible implementation of this application, the editing instruction is an insertion operation, which instructs the insertion of content into a first paragraph. In response to the editing instruction, the electronic device at least reformatts the first paragraph to obtain a formatted handwritten note, including: In response to the editing instruction, if there is no second paragraph below the first paragraph, the electronic device inserts a first blank area of ​​a preset length from a first position in the first paragraph to obtain the formatted handwritten note, where the first position is the insertion position indicated by the editing instruction. If there is a second paragraph below the first paragraph, the electronic device determines the paragraph spacing between the first and second paragraphs. If the paragraph spacing is greater than or equal to the line height of the first paragraph, the electronic device inserts a first blank area of ​​a preset length from the first position in the first paragraph to obtain the formatted handwritten note. If the paragraph spacing is less than the line height of the first paragraph, the electronic device controls the second paragraph to move away from the first paragraph and inserts a first blank area of ​​a preset length from the first position in the first paragraph to obtain the formatted handwritten note.

[0029] This solution can respond to the user's insertion operation in the handwritten notes, inserting a first blank area of ​​preset length from the first position indicated by the insertion operation for the user to insert content.

[0030] In one possible implementation of this application, after the electronic device inserts a first blank area of ​​a preset length into the first paragraph from a first position to obtain the formatted handwritten notes, the method provided in this application embodiment further includes: the electronic device detecting the content inserted by the user in the first blank area. If the inserted content accounts for more than a first threshold in the first blank area, then the first blank area continues to be inserted into the first paragraph to obtain the formatted handwritten notes.

[0031] In one possible implementation of this application, the electronic device inserts a first blank area of ​​a preset length starting from a first position in the first paragraph, comprising: the electronic device inserting a first blank area of ​​a preset length starting from a first position in the first paragraph according to the number of lines in the first paragraph, wherein the number of lines in the first paragraph is one line, and the preset length is a first preset length; or the number of lines in the first paragraph is multiple lines, and the preset length is a second preset length, wherein the first preset length is less than the second preset length. This solution can achieve the insertion of first blank areas of different lengths in the first paragraph when the number of lines in the first paragraph is different.

[0032] In one possible implementation of this application, the editing instruction is the deletion operation, which instructs the deletion of a portion of the text in the first paragraph. The electronic device moves the text to be moved from its initial position to its final position and displays it based on the final position of the text to be moved in the formatted handwritten notes. This includes: the electronic device controlling a first group of text in the first paragraph to move from its initial position to its corresponding final position; the first group of text being the text whose initial and final positions are on the same line. At the moment the first group of text begins to move, the electronic device controls a second group of text to disappear from its initial position and appear at the right end of the initial state of the previous line of text with a first transparency; the second group of text being the text whose initial and final positions are on different lines. The electronic device controls the second group of text to move together with the first group of text until both groups are at their respective final positions. During the movement, the transparency of the second group of text gradually decreases from the first transparency to the second transparency.

[0033] In one possible implementation of this application, the editing command is a deletion or insertion operation. The electronic device moves the text to be moved from its initial position to its final position in the typed handwritten note and displays it. This includes: the electronic device controlling a first group of text to be moved to move from its initial position to its final position; the first group of text consists of text whose initial and final positions are on the same line. At the moment the first group of text begins to move, the electronic device controls a second group of text to disappear from its initial position and appear at its final position with a first transparency level; the second group of text consists of text whose initial and final positions are on different lines. During the movement of the first group of text, the electronic device controls the transparency of the second group of text at its final position to gradually decrease from the first transparency level until the transparency of the second group of text is 0 at the end of the movement.

[0034] In one possible implementation of this application, the editing instruction is a deletion operation or an insertion operation. The electronic device moves the text to be moved from its initial position to its final position and displays it according to the final position of the text to be moved in the typed handwritten notes. This includes: the electronic device moves the first group of text and the second group of text to their final positions in sequence according to the playback time order corresponding to the first group of text and the second group of text to be moved. The first group of text consists of text whose initial and final positions are on the same line, and the second group of text consists of text whose initial and final positions are on different lines.

[0035] In one possible implementation of this application, the editing command is a deletion or insertion operation. The electronic device moves the text to be moved from its initial position to its final position in the formatted handwritten note and displays it. This includes: the electronic device controlling a first group of text to be moved to move from its initial position to its final position, where the first group of text consists of characters whose initial and final positions are on the same line. The electronic device then controls a second group of text to disappear from its initial position at the moment the first group of text begins to move; this second group of text consists of characters whose initial and final positions are on different lines. Finally, when the first group of text reaches its final position, the electronic device controls the second group of text to appear at that final position.

[0036] In one possible implementation of this application, the editing instruction is an insertion operation, and the step of moving the text to be moved from its initial position to its final position and displaying it according to the final position of the text to be moved in the formatted handwritten notes includes:

[0037] Control the first group of characters in the text to be moved to move from the initial position to the final position. The first group of characters is the text in the text to be moved whose initial position and final position are on the same line.

[0038] At the moment when the first group of text begins to move, the second group of text is controlled to disappear from the initial position of the second group of text and appear at the left end of the initial state of the next line of text with the first transparency. The second group of text consists of text whose initial position and final position are on different lines among the text to be moved.

[0039] Control the second group of text to move together with the first group of text until the second group of text and the first group of text are respectively in their final positions. During the movement, the transparency of the second group of text gradually decreases from the first transparency to 0%.

[0040] In one possible implementation of this application, a second paragraph is further provided below the first paragraph, and the paragraph spacing between the first paragraph and the second paragraph is greater than the line height of the first paragraph. The method further includes:

[0041] At the moment the first group of text begins to move, control the second paragraph to move downwards until the first group of text reaches its final position, then control the second paragraph to move to its final position.

[0042] Thirdly, embodiments of this application also provide an electronic device, the electronic device including at least one memory and at least one processor; wherein, the at least one memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the at least one processor, the electronic device causes the electronic device to perform any of the possible designs in the first aspect described above.

[0043] Fourthly, embodiments of this application also provide an apparatus for editing handwritten notes, which includes modules / units for performing the methods in any of the possible designs described in the first aspect. These modules / units can be implemented in hardware or by hardware executing corresponding software.

[0044] Fifthly, embodiments of this application also provide an apparatus for editing handwritten notes, which includes modules / units for performing the methods in any of the possible designs described in the second aspect above. These modules / units can be implemented in hardware or by hardware executing corresponding software.

[0045] In a sixth aspect, a computer-readable storage medium is provided that stores a computer program (also referred to as code or instructions) that, when executed on a computer, causes the computer to perform any of the possible designs in the first aspect described above.

[0046] In a seventh aspect, a computer-readable storage medium is provided, which stores a computer program (also referred to as code or instructions) that, when executed on a computer, causes the computer to perform any of the possible designs in the second aspect above.

[0047] Eighthly, a computer program product is provided, comprising: a computer program (also referred to as code or instructions) that, when run, causes the method in any of the possible designs in the first aspect to be executed.

[0048] Ninthly, a computer program product is provided, comprising: a computer program (also referred to as code or instructions) that, when run, causes the method in any of the possible designs in the second aspect above to be executed.

[0049] In a tenth aspect, a graphical user interface is also provided for an electronic device having a display screen, one or more memories, and one or more processors, the one or more processors being configured to execute one or more computer programs stored in the one or more memories, the graphical user interface including a graphical user interface displayed when the electronic device executes any of the possible designs in the first aspect of the embodiments of this application described above.

[0050] Eleventhly, a graphical user interface is also provided for an electronic device having a display screen, one or more memories, and one or more processors, the one or more processors being configured to execute one or more computer programs stored in the one or more memories, the graphical user interface including the graphical user interface displayed when the electronic device executes any possible design of the second aspect of the embodiments of this application described above.

[0051] In a twelfth aspect, embodiments of this application provide a chip including at least one processor, the processor being configured to read and execute a computer program stored in a memory to perform the method in the first aspect or any possible implementation thereof.

[0052] In a thirteenth aspect, embodiments of this application provide a chip including at least one processor, the processor being configured to read and execute a computer program stored in a memory to perform the method in the second aspect or any possible implementation thereof.

[0053] Optionally, the chip also includes a memory, which is connected to the processor via circuitry or wires.

[0054] Alternatively, the chip may also include a communication interface. The communication interface is used to communicate with other modules outside the chip.

[0055] Any of the devices, computer storage media, computer program products, chips, or communication systems provided above are used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding solutions in the corresponding methods provided above, and will not be repeated here.

[0056] It should be noted that the beneficial effects of the various designs of the electronic devices provided in the second to thirteenth aspects of the embodiments of this application can be referred to the beneficial effects of any possible design in the first aspect above, and will not be repeated here. Attached Figure Description

[0057] Figure 1 A schematic diagram of a memo interface provided for an embodiment of this application;

[0058] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0059] Figure 3 This is a software system architecture block diagram of an electronic device provided in an embodiment of this application.

[0060] Figure 4 A schematic diagram of a handwritten note editing interface provided in this application embodiment. Figure 1 ;

[0061] Figure 5 A schematic diagram of a handwritten note editing interface provided in this application embodiment. Figure 2 ;

[0062] Figure 6 A flowchart illustrating an electronic device's identification of lines with abnormal angles within a paragraph to be edited, provided as an embodiment of this application;

[0063] Figure 7 A schematic diagram of an interface for adjusting abnormally angled lines in a handwritten note, provided as an embodiment of this application;

[0064] Figure 8 A schematic diagram of another interface for adjusting abnormally angled rows in a handwritten note, provided as an embodiment of this application;

[0065] Figure 9 This is a flowchart illustrating an electronic device for determining one or more characters with abnormal vertical positions within a paragraph to be edited, as provided in an embodiment of this application.

[0066] Figure 10 A schematic diagram of an interface for adjusting text with abnormal vertical position in a handwritten note, provided as an embodiment of this application;

[0067] Figure 11 A schematic diagram of an interface for adjusting text with abnormal vertical position in a handwritten note, provided as an embodiment of this application;

[0068] Figure 12 A flowchart illustrating the process of an electronic device determining text with abnormal spacing within a paragraph to be edited, as provided in an embodiment of this application;

[0069] Figure 13 A schematic diagram of an interface for adjusting the spacing between characters in a handwritten note, provided as an embodiment of this application;

[0070] Figure 14 A schematic diagram of another interface for adjusting the spacing between characters in a handwritten note, provided as an embodiment of this application;

[0071] Figure 15 A schematic diagram of a handwritten note editing interface provided in this application embodiment. Figure 3 ;

[0072] Figure 16 A schematic diagram of a handwritten note editing interface provided in this application embodiment. Figure 4 ;

[0073] Figure 17 The text formatting process of an electronic device responding to a deletion operation, as provided in the embodiments of this application;

[0074] Figure 18 A schematic diagram of a text layout interface provided in this application embodiment. Figure 1 ;

[0075] Figure 19 The text layout process of the electronic device in response to the insertion operation provided in the embodiments of this application;

[0076] Figure 20 A schematic diagram of the interface for editing handwritten notes in response to an insertion operation in an electronic device provided in this application embodiment. Figure 1 ;

[0077] Figure 21 A schematic diagram of the interface for editing handwritten notes in response to an insertion operation in an electronic device provided in this application embodiment. Figure 2 ;

[0078] Figure 22 A schematic diagram of the interface for editing handwritten notes in response to an insertion operation in an electronic device provided in this application embodiment. Figure 3 ;

[0079] Figure 23 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 1 ;

[0080] Figure 24 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 2 ;

[0081] Figure 25 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 3 ;

[0082] Figure 26 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 4 ;

[0083] Figure 27 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 5 ;

[0084] Figure 28 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 6 ;

[0085] Figure 29 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 7 ;

[0086] Figure 30 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 8 ;

[0087] Figure 31 A layout animation illustration of a handwritten note editing interface provided in this application embodiment. Figure 9 ;

[0088] Figure 32 A flowchart illustrating a method for editing handwritten notes according to an embodiment of this application;

[0089] Figure 33 A flowchart illustrating another method for editing handwritten notes provided in this application embodiment;

[0090] Figure 34 A schematic diagram of an interface for editing handwritten notes provided in an embodiment of this application;

[0091] Figure 35 A schematic diagram of another interface for editing handwritten notes provided in this application embodiment;

[0092] Figure 36A schematic diagram of the structure of a device for editing handwritten notes provided in an embodiment of this application;

[0093] Figure 37 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

[0094] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0095] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.

[0096] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0097] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.

[0098] It should be understood that in this application, "at least one (item)" means one or more. "More than one" means two or more. "At least two (items)" means two or three or more. "And / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural.

[0099] The character " / " generally indicates that the preceding and following objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any single or multiple items. For example, "at least one of a, b, or c" can be expressed as: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0100] Both "...when" and "if" indicate that a corresponding action will be taken under certain objective circumstances. They are not time limits, nor do they require a judgment action to be taken when the action is taken, nor do they imply any other limitations.

[0101] In this embodiment, the content written by the user in the handwriting area of ​​the electronic device can include: text, which can include numbers, punctuation marks, and written language in various languages ​​(such as Chinese, English, Japanese, Korean, etc.). For example, written language in a Chinese context can be referred to as Chinese characters. Chinese characters can be single Chinese characters or words composed of two or more Chinese characters. Written language in an English context can be referred to as English words. English words can be single English letters or English words composed of the 26 letters of the alphabet.

[0102] Punctuation marks: Symbols used in writing to indicate pauses and intonation. Punctuation marks are symbols that assist in recording language in writing, and can be used to indicate pauses, intonation, and the nature and function of words.

[0103] In some embodiments, punctuation marks can be divided into three main categories: period marks, punctuation marks, and symbols. Period marks indicate pauses of varying lengths in spoken language, while punctuation marks indicate the nature or function of words in written language. For example, period marks may include: period (.), question mark (?), exclamation mark (!), comma (,), pause mark (、), semicolon (;), and colon (:). Punctuation marks may include: quotation marks (“”, ''), parentheses [(), [], {}], dash (──), ellipsis (······), emphasis mark (.), book title marks (《》, 〈〉), separator (·), hyphen (—), and proper noun mark (____). Symbols may include: footnote mark (*), hidden mark (×), missing mark (□), slash ( / ), identifier (▲ or ●), substitution (~), beaded mark (……), and arrow mark (→).

[0104] The method for editing handwritten notes provided in this application can be applied to all electronic devices that support user handwriting. For example, electronic devices may include screen devices that support writing with fingers or styluses, such as mobile phones, tablets, PCs, and large office screens, as well as virtual projection devices that support writing with fingers or controllers, such as Virtual Reality (VR) and Augmented Reality (AR). This application does not limit the specific type of electronic device.

[0105] Specifically, the handwritten note editing method provided in this application embodiment can exist in the form of program code in a handwritten note application on an electronic device.

[0106] The aforementioned electronic devices can install various applications (hereinafter referred to as "APPs"), such as music, video, and handwriting note applications (e.g., memos, sticky notes). In this embodiment, a memo application is used as an example for illustration.

[0107] The handwriting note application installed on the electronic device can be a built-in application of the electronic device or a third-party application. This application embodiment does not limit this.

[0108] Many note-taking apps now support handwriting input using electronic devices with a stylus (also known as a marker or pen) or finger. For example, in scenarios where users need to record their schedules, such as... Figure 1 As shown in (a), the user can tap the Notes app installed on their phone to trigger the phone to display the following: Figure 1 The note-taking interface is shown in (b) and (c). Users can write text in the note-taking interface of the Notes app installed on their phones to record information, such as... Figure 1 As shown in (b) in the figure, or as shown in the figure ..., or as shown in (b) in the figure, or as shown in (b) in the figure, or as shown in (b) in the figure, or as shown in (b) in the figure, or as shown in (b Figure 1 As shown in (c), users can also use a stylus to write notes in the editing interface of the memo app installed on their phone to record their schedules.

[0109] In this scenario, users often encounter situations where they miswrite or omit words. In the current context, in order to edit or modify handwritten text,

[0110] Users need to switch back and forth between tools such as pens, lassos, and erasers and manually adjust the relative positions of text, which is time-consuming and laborious, and it is difficult to ensure the neatness of the handwriting and layout during this process. Therefore, the industry needs a more natural way to edit handwritten text.

[0111] Furthermore, when users write text in handwriting note-taking applications using their fingers or styluses, complex scenarios may arise, such as slanted text lines and misaligned text, which cannot guarantee the neatness and aesthetics of the handwriting layout. Therefore, how to achieve neat and aesthetically pleasing intelligent text editing in complex handwriting note-taking scenarios is a technical problem that this application urgently needs to solve.

[0112] Based on this, this application provides a method for editing handwritten notes, which can be applied to any handwritten note contained in a note-taking app. It is used to adjust the position of the text content contained in the paragraph in which the editing instruction is applied in the handwritten note based on the detected user input of the editing instruction for the handwritten note, and / or to adjust the text layout based on the overall writing layout, so as to ensure the neatness and aesthetics of the handwritten note's handwriting layout.

[0113] Furthermore, this application also proposes a layout animation effect for handwritten notes. When a user performs a deletion or insertion operation in a handwritten note, the layout animation effect can show the user the trajectory of the text to be moved from the initial position to the final position. This can naturally remind the user which notes in the handwritten note have undergone what changes, improving the visual experience and ease of use.

[0114] The electronic devices to which this application's embodiments can be applied, exemplary embodiments of which may include, but are not limited to, those equipped with the HarmonyOS system (…). HarmonyOS ), Android Microsoft Or other electronic devices with different operating systems. The aforementioned portable electronic devices can also be other portable electronic devices, such as laptops with touch-sensitive surfaces (e.g., touch panels).

[0115] Figure 2 This is a schematic diagram of the structure of an example electronic device 100 provided in an embodiment of this application.

[0116] Please refer to Figure 2 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application.

[0117] like Figure 2As shown, 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0118] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0119] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0120] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0121] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0122] In some embodiments, the processor 110 may include one or more interfaces. 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, etc.

[0123] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0124] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0125] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0126] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0127] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0128] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0129] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0130] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0131] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives 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 supply power to the electronic device 100 via the power management module 141.

[0132] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

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

[0134] 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 one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0135] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0136] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates 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 processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0137] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0138] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

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

[0140] Display screen 194 is used to display images, videos, etc. 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 Minied, MicroLED, Micro-OLED, quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. In the embodiments of this application, display screen 194 can be used to display various sub-screens of the main screen of electronic device 100, such as, see... Figure 1 As shown in (a)-(c) above. Each sub-screen may include icons of applications in the electronic device.

[0141] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0142] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, 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, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0143] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0144] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

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

[0146] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0147] The external storage 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 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0148] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

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

[0150] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

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

[0152] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0153] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0154] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0155] Pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, in this embodiment, when a touch operation with an intensity less than a first pressure threshold is applied to the icon of an application, a command to display the interface of that application is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the icon of the application, a command to display the management menu is executed. The management menu may include identifiers of sub-screens of the main screen of the electronic device 100, which is displayed around the application's icon, and / or identifiers of folders included in the sub-screens.

[0156] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0157] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0158] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0159] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0160] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0161] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0162] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0163] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0164] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0165] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0166] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0167] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0168] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0169] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0170] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0171] The methods described in the following embodiments can all be implemented in the electronic device 100 having the above-described hardware structure.

[0172] Figure 3 This is a software structure block diagram of an electronic device according to an embodiment of this application.

[0173] Optionally, the electronic device 100 in this application embodiment may have The system, that is, having Figure 3 The layered architecture shown can include several layers, each with a clear role and division of labor, and the layers communicate with each other through software interfaces.

[0174] Exemplary, in some embodiments, such as Figure 3 As shown, it can be The system is divided into four layers, from top to bottom: application layer, application framework layer, runtime layer, and application layer. runtime and system libraries, kernel layer and hardware layer.

[0175] The application layer can include a series of application packages. For example, such as... Figure 3 As shown, the application layer may include camera, Bluetooth, settings, user interface (UI), third-party applications, etc., wherein the third-party applications may include wireless local area network (WLAN), music, call, Bluetooth, video, memo, note, etc., and this application embodiment does not limit them.

[0176] In this embodiment, the application layer can be used to implement the presentation of the editing interface. The editing interface can provide users with editing operations for note-taking apps such as memos and sticky notes, which are the focus of this embodiment. For example, it can be the layout editing interface involved in the following embodiments. For instance, users can adjust the position of text content and / or the layout in the layout editing interface of a memo app. Exemplarily, the editing interface can be as follows: Figure 1 (b) or Figure 1 The memo display interface shown in (c) is shown in the image.

[0177] In one possible implementation, the application can be developed using Java, by calling the application programming interface (API) provided by the application framework layer. Developers can then interact with the underlying operating system layers (such as the hardware layer and kernel layer) to develop their own applications. This application framework layer primarily consists of a series of services and management systems within the operating system.

[0178] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0179] For example, such as Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0180] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, and participate in operations such as locking the screen and capturing the screen.

[0181] Content providers are used to store and retrieve data, making that data accessible to applications. The stored data can include video data, image data, audio data, and may also include call logs, user browsing history, bookmarks, and other data, which will not be elaborated upon here.

[0182] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0183] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including call connection and disconnection).

[0184] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and so on.

[0185] The notification manager allows applications to display notifications in the screen's status bar, conveying messages to the user. These notifications disappear automatically after a brief appearance in the status bar, without requiring user interaction such as closing the app. For example, the notification manager can inform the user that a download is complete. The notification manager can also appear as an icon or scrolling text bar in the top status bar, such as notifications from background applications; alternatively, it can appear as a dialog box on the screen, such as a text message in the status bar; furthermore, the notification manager can control electronic devices to emit sounds, vibrate, and flash indicator lights, among other things. These details will not be elaborated upon here.

[0186] The runtime includes the core libraries and the virtual machine. The runtime is responsible for scheduling and management of the Android system.

[0187] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0188] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0189] System libraries can include multiple functional modules. For example: surface manager, media libraries, three-dimensional (3D) graphics processing libraries (e.g., OpenGL ES), two-dimensional (2D) graphics engines, image processing libraries, etc.

[0190] The Surface Manager is used to manage the display subsystem of electronic devices and provides the blending of 2D and 3D layers for multiple applications.

[0191] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0192] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0193] A 2D graphics engine is a drawing engine for 2D drawing.

[0194] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0195] The hardware layer can include various types of sensors, such as accelerometers, gravity sensors, and touch sensors.

[0196] It should be understood that the hardware structure of electronic devices can be as follows: Figure 2 As shown, the software system architecture can be as follows: Figure 3 As shown, the software programs and / or modules corresponding to the software system architecture in the electronic device can be stored in the memory 240, and the processor 230 can run the software programs and applications stored in the memory 240 to execute the flow of a method for editing handwritten notes provided in the embodiments of this application.

[0197] For ease of understanding, the following embodiments of this application will be described using the following methods: Figure 2 and Figure 3 Taking the mobile phone 10 with the structure shown as an example, and in conjunction with the accompanying drawings and application scenarios, the method for editing handwritten notes provided in this application embodiment will be specifically described.

[0198] To facilitate understanding of the note-editing methods provided in this application, the following is combined with... Figures 4 to 31 The content shown describes the implementation process of the method provided in this application.

[0199] This application applies to scenarios involving note-taking apps installed on electronic devices. The main design concept is that the electronic device can receive and respond to any handwritten note editing command triggered by the user within the note-taking app's interface, adjusting the text position within at least one paragraph specified by the editing command and / or formatting at least one paragraph based on the overall layout of the handwritten note, thereby obtaining the edited handwritten note. The following examples illustrate the applicable scenarios for this application's embodiments. It should be understood that this application's embodiments are not limited to the following application scenarios.

[0200] The following explanation uses a note-taking app installed on an electronic device as an example. It is understood that users can refer to the following examples to explain how to edit handwritten notes in other note-taking apps.

[0201] When a user wants to record relevant content via handwriting on their phone, such as Figure 4 As shown in Figure (a), the user can tap the Notes app installed on the phone to trigger the phone to display the following: Figure 4 The note-taking interface 40 is shown in (b) above. This interface displays one or more notes. For example, the interface includes handwritten notes 42 and electronic notes 43 (i.e., notes entered by the user using a keyboard). Users can enter keywords in the search bar 41 to trigger the phone to search for and display relevant notes from existing notes. Handwritten notes 42 refer to content entered by the user in the note-taking app via handwriting, including Chinese characters, letters, symbols, etc.

[0202] In the notes interface 40, users can click to create a new control 44 to trigger the phone to display, such as Figure 4 The handwriting input interface 400 is shown in (c) in the figure.

[0203] Figure 4The handwriting input interface 400 shown in (c) includes: a handwriting area 401 and multiple editing controls for editing text within the handwriting area 401. For example, a "Switch to Keyboard Input" control 402 for instructing users to add or delete content in the handwriting area 401 using the keyboard; an "Eraser" control 403 for instructing users to erase content in the handwriting area 401; an automatic editing control 404 for adaptive overall editing of the notes written by the user in the handwriting area 401; an editing control 405 for instructing users to edit the content in the notes; a "Color Selection" control 408 for instructing users to select the color (e.g., font color) of the note content; a "Line Selection" control 409 for instructing users to select the line thickness of the font in the note content; a "Return Control 410" for instructing users to exit the handwritten note and display the memo homepage; an undo typing control 411; a redo typing control 412 for instructing users to restore previously deleted or undone text; and a confirmation control 413. Furthermore, it is understood that although... Figure 4 As not shown in the diagram, in some other embodiments, the handwriting input interface 400 may also include other editing controls. For example, it may include a "share" control, a "delete note" control, or a "favorite" control, which can be configured according to the user's needs. In addition, the handwriting input interface 400 may also include a "pen" control and a "pencil" control to indicate the display effect of the font in the notes, as well as a status bar (which may include mobile network, wireless network, time, and remaining battery power); it is understood that the status bar may also include the operator's name, Bluetooth icon, etc.

[0204] For example, the electronic device can enter an adaptive editing mode. In adaptive editing mode, the electronic device can adaptively adjust the handwritten notes written by the user in the handwriting area 401. For example, while the user is writing text in the handwriting area 401 with their finger or a stylus, the electronic device will automatically adjust the position of the text in the handwritten notes. For example, after the user finishes writing each character, the electronic device will automatically adjust the vertical position and / or horizontal spacing of that character. Or, after the user finishes writing a line of text, the electronic device will automatically adjust the position of characters with abnormal vertical positions within that line so that the distance between any character in that line and the center line of that line meets a preset distance requirement. For example, the preset distance requirement can be: the distance between any character and the center line of the line is greater than or equal to a first distance threshold, and / or less than or equal to a second distance threshold. And / or, after the user finishes writing a line of text, the electronic device will automatically adjust the position of characters with abnormal vertical and horizontal spacing within that line so that the spacing between all characters in that line meets the preset spacing requirement, thus making the spacing between the text in the entire line more consistent. For example, the preset spacing requirements are: the spacing between characters in any line is greater than or equal to the first spacing threshold, and / or less than or equal to the second spacing threshold, or the electronic device will automatically adjust the position of characters with abnormal vertical and / or horizontal spacing within the paragraph after the user finishes writing a paragraph.

[0205] Optionally, in one scenario, the electronic device can automatically adjust lines with abnormal angles within a paragraph after the user finishes writing each paragraph. Alternatively, in some scenarios, in adaptive editing mode, the electronic device can adaptively adjust the content of the handwritten notes written by the user in the handwriting area 401 as follows: for example, if the user triggers a deletion operation, the electronic device can respond to the deletion operation by deleting one or more characters indicated by the user, and adjusting the position of the characters within the paragraph affected by the deletion operation, including but not limited to lines with abnormal rotation angles, adjusting characters with abnormal vertical positions within the paragraph, and adjusting characters with abnormal horizontal spacing within the paragraph. Alternatively, if the user triggers an insertion operation, the electronic device responds to the insertion operation by inserting a blank area of ​​a specified length from the position affected by the insertion operation for the user to write in, and performs overall layout for the paragraph affected by the insertion operation. The layout process can be found in the description in the following embodiments, and will not be repeated here.

[0206] As an example, the electronic device can receive and respond to the user's click on the aforementioned automatic editing control 404 to enter adaptive editing mode. Of course, triggering the electronic device to enter adaptive editing mode can also be achieved in other ways. For example, the user can directly trigger the electronic device to enter adaptive editing mode through preset gesture operations (such as double-clicking or knuckle tapping) on ​​the handwriting input interface 400, or the user can trigger it through voice commands (such as "enter adaptive editing mode"), etc.

[0207] In practice, users may only want to adjust the position of a single line of text and / or format a paragraph, or only want to adjust lines with abnormal angles, text with abnormal vertical positioning, and / or text with abnormal horizontal spacing within a paragraph. To improve the user experience, as an example, users can also click the edit control 405 to trigger the phone to display something like... Figure 4 The interface shown in Figure (d) is in Figure 4 The interface shown in Figure (d) includes controls 4051 for adjusting text position, 4052 for adjusting abnormal angle lines, 4053 for adjusting text vertical position, 4054 for adjusting text spacing, and 4055 for text layout.

[0208] When control 4051 is triggered, the electronic device responds by adjusting the overall text layout within the paragraph. When control 4052 is triggered, the electronic device identifies lines with abnormal angles within the paragraph and rotates them. When control 4053 is triggered, the electronic device identifies text with abnormal vertical positioning within the paragraph and adjusts its position. When control 4054 is triggered, the electronic device identifies text with abnormal horizontal spacing within the paragraph and adjusts the spacing to ensure that the spacing between lines containing the text with abnormal horizontal spacing meets preset requirements. When control 4055 is triggered, the electronic device responds to control 4054 by adjusting the overall text layout within the paragraph.

[0209] It is understandable that, in addition to clicking the aforementioned controls to trigger the electronic device to detect an editing operation, users can also input editing operations in other ways on the electronic device. The following will describe how users can trigger deletion and insertion operations on the electronic device:

[0210] 1) Taking the deletion operation as an example of an editing operation.

[0211] In practice, users may make mistakes in writing certain words in their handwritten notes, or they may want to delete one or more words from their handwritten notes. In such scenarios, users can trigger a deletion operation on the handwritten notes. For example, users can... Figure 5 The deletion operation is triggered in the manner shown in (a) to (c). One example is... Figure 5As shown in (a), taking the content displayed in the handwritten note as "I plan to start exercising tomorrow" as an example, assuming the user needs to delete the word "tomorrow", the user can use their finger to add a strikethrough to the two words "tomorrow". This makes it easier for the electronic device to detect the deletion operation used to indicate the deletion of the two words "tomorrow". After that, the electronic device can respond to the deletion operation and delete the two words "tomorrow" from the handwritten note.

[0212] As another example, users can also use their finger or a stylus to circle the text they want to delete in their handwritten notes, allowing the electronic device to detect the deletion. Figure 5 As shown in (b), the user can circle the word "tomorrow" with their finger to trigger the electronic device to detect the deletion operation. The electronic device can then delete the word "tomorrow" from the handwritten note in response to the deletion operation.

[0213] As another example, users can also long-press the display screen with their finger or stylus to trigger a selection action, indicating the selection of one or more characters. The electronic device can then display something like... Figure 5 The pop-up window shown in (c) can include a delete control or a clipboard control. Assuming the user selects the text "tomorrow" during the selection process, the user can then click the delete or clipboard control to trigger the electronic device to detect the deletion operation. Figure 5 As shown in (c), the user can long-press the display screen with their finger to select the word "tomorrow." The user can then click the delete or clipboard control in the pop-up window, allowing the electronic device to detect the deletion operation indicating the removal of the word "tomorrow." The electronic device can then respond to the deletion operation and remove the word "tomorrow" from the handwritten note.

[0214] As another example, users can also use the eraser control in the handwriting note interface to erase text to be deleted from one or more lines. In this scenario, the electronic device can regard the user's act of using the eraser control to erase text to be deleted from one or more lines as a deletion operation.

[0215] It is worth noting that the above are only a few examples of user-triggered deletion operations proposed in the embodiments of this application. In actual practice, users may also trigger deletion operations in other ways, and the embodiments of this application do not limit this.

[0216] 2) Taking the insertion operation as an example of editing operations.

[0217] When a user needs to insert content into their handwritten notes, they can trigger the insertion action based on the handwritten notes. For example, a user can use a tool like... Figure 5Trigger the insertion operation in the manner shown in (d) of []. For example, assume that the user wants to insert content between "备" and "明". Then the user can use a finger or a stylus to trigger a long-press operation between "备" and "明" to trigger the electronic device to display a pop-up window as shown in Figure 5 the (d) of []. After that, when the electronic device detects that the user clicks the "Insert" control in the pop-up window, it can be considered that the insertion operation is detected. Or the user can use a finger or a stylus to draw one or more vertical lines between any two characters to trigger the electronic device to detect the insertion operation. Or, the user can use a finger or a stylus tip to click, draw an insertion symbol, etc. to trigger the insertion operation.

[0218] It should be noted that the above are only several examples of the user-triggered insertion operation proposed in the embodiments of the present application. In actual situations, the user can also trigger the insertion operation in other ways, and the embodiments of the present application do not limit this.

[0219] The following will describe, in combination with specific examples, how to adjust the positions of characters in a handwritten note when the electronic device detects an editing instruction.

[0220] Before introducing the embodiments of the present application, first introduce how to identify the angular abnormal lines in the paragraph to be edited in the present application.

[0221] Scenario 1: Adjust the angular abnormal lines within a paragraph.

[0222] The design principle of adjusting the angular abnormal lines within a paragraph is to identify the angular abnormal lines in the paragraph and rotate the angular abnormal lines, so as to ensure that each line in the paragraph is relatively parallel, so as to achieve the purpose of improving the neatness and aesthetics.

[0223] Such as Figure 6 As an example, the electronic device can determine the angular abnormal lines within the paragraph to be edited through the process as shown in Figure 6 shown. As shown in Figure 6 shown, the method includes:

[0224] Step 601: The electronic device determines the angle of each line included in the paragraph to be edited.

[0225] For example, the electronic device can determine the best-fit line of each line. The electronic device takes the angle of the best-fit line of each line as the angle of that line.

[0226] Specifically, for each line of text in the paragraph to be edited, the electronic device can determine the geometric center of the character frame of each character in each line, and through a linear fitting function, calculate the best-fit line passing through the center of the character frame of each character, and calculate the angle of the best-fit line according to the slope information of the best-fit line.

[0227] It is understandable that the paragraph to be edited is one or more paragraphs that the editing command is applied to.

[0228] Step 602: The electronic device calculates the angle of the paragraph to be edited based on the angle of each line within the paragraph.

[0229] For example, the angle of the paragraph to be edited could be the arithmetic mean of the angles of each line within the paragraph, a weighted average based on the number of words in each line, or the median, mode, etc., without any limitations. Alternatively, the angle of the paragraph to be edited could also be the angle of the target line within the paragraph. For example, the target line could be the first line of the paragraph, the line with the most text, the line with the largest angle, the line with the smallest angle, or the line within the first paragraph whose angle is closest to the average angle of that first paragraph.

[0230] For example, different lines within the paragraph to be edited correspond to different weights. The weight of any line can be set by the user or determined by the number of characters in each line. For instance, if a line has a large number of characters, then the weight of that line can be set higher.

[0231] Step 603: The electronic device calculates the difference between the angle of each line and the angle of the paragraph to be edited.

[0232] Step 604: The electronic device determines whether the difference between the angle of each line and the angle of the paragraph to be edited is greater than the angle difference threshold.

[0233] If the difference between the angle of any line and the angle of the paragraph to be edited is greater than the angle difference threshold, then any line is determined to be an angle abnormal line, and step 605 is executed.

[0234] If the difference between the angle of any line and the angle of the paragraph to be edited is less than or equal to the angle difference threshold, then the angle of any line is determined to be consistent with the angle of the paragraph to be edited.

[0235] Step 605: Rotate the abnormal angle line of the electronic device to make the angle of the abnormal angle line consistent with the angle of the paragraph to be edited.

[0236] As an example, an electronic device can rotate an entire line of text with an abnormal angle so that the angle of the abnormal line matches the angle of the paragraph to be edited.

[0237] The electronic device can rotate the abnormal line clockwise or counterclockwise. This application does not limit this, as long as the angle of the abnormal line after rotation is consistent with the angle of the paragraph to be edited.

[0238] It is understood that the angle of the line with abnormal angle after rotation being the same as the angle of the paragraph to be edited can mean that the angle of the line with abnormal angle after rotation is the same as the angle of the paragraph to be edited, or the difference between the two is less than or equal to a certain preset threshold (for example, the angle difference threshold). This application embodiment does not limit this.

[0239] Understandably, this angle difference threshold can be greater than or equal to 0. If the angle difference threshold is 0, then if the difference between the angle of any line and the angle of the first paragraph is 0, that line is considered not an angle-abnormal line. If the difference between the angle of any line and the angle of the first paragraph is not 0, then that line is considered an angle-abnormal line. If the angle difference threshold is not 0, then if the difference between the angle of any line and the angle of the first paragraph is less than the angle difference threshold, that line is not an angle-abnormal line. If the difference between the angle of any line and the angle of the first paragraph is greater than or equal to the angle difference threshold, then that line is an angle-abnormal line.

[0240] like Figure 7 As shown in Figure (a), the display interface of a handwritten note contained in the memo can be as follows: Figure 7 The note interface 71 is shown in (a) above. Note interface 71 includes two paragraphs, paragraph 72 and paragraph 73. Paragraph 72 contains three lines of text: lines 721, 722, and 723. Paragraph 73 contains two lines of text: lines 731 and 732. Suppose a user wants to adjust the angled lines in paragraph 72, the user can do so in the following way: Figure 7 In the note-taking interface 71 shown in Figure (a), an editing command for paragraph 72 is triggered. Taking a long-press operation as an example, for instance... Figure 7 As shown in (b), the user can trigger a long press within paragraph 72 (for example, the user can trigger a long press at any position within paragraph 72, or trigger a long press on a line within paragraph 72 that needs adjustment (such as line 731)). In response to the long press, the electronic device identifies lines with abnormal angles within paragraph 72. Assuming the electronic device identifies line 721 as a line with abnormal angles within paragraph 72, the electronic device rotates the entire line of text in line 721 so that the angle of line 721 after rotation matches the angle of paragraph 72. Ultimately, the electronic device can display as shown in [image / description]. Figure 7 The interface shown in (c) is shown in the image.

[0241] Alternatively, in response to a long press, the electronic device displays a pop-up window 724, and the user can then click the control to adjust the angle of the line with the abnormal angle, triggering the electronic device to detect an editing command. In response to this editing command, the electronic device recognizes that line 721 is an line with an abnormal angle within paragraph 72, and then rotates the entire line of text in line 721.

[0242] It is worth noting that, such as Figure 7This example illustrates how an electronic device responds to a user-triggered editing command by adjusting an angle-abnormal behavior within paragraph 72 specified by the command. In practice, a user might want to adjust the position of multiple paragraphs in a handwritten note at once. In this scenario, the user can select multiple paragraphs and then trigger the editing command. The electronic device can then identify and rotate the angle-abnormal lines within each paragraph based on the user's editing command, ensuring that the angle of the angle-abnormal lines in each paragraph matches the angle of the paragraph after rotation. Alternatively, the user can trigger a specific gesture-based editing command on the note interface 71, allowing the electronic device to confirm that the user wishes to adjust multiple paragraphs. Or, as... Figure 8 As shown in (a), the user can click "Edit Control 405" to trigger the electronic device to display, as shown in (a). Figure 8 The interface shown in (b) is in Figure 8 In the interface shown in (b), the user can click control 4052 to trigger the electronic device to detect the user's editing command, thereby identifying lines with abnormal angles in paragraphs 72 and 73. Assuming the electronic device identifies line 721 and line 731 as lines with abnormal angles within paragraph 72, the electronic device rotates the entire text of line 721 so that the text in line 721 has the same angle as paragraph 72, and rotates the entire text of line 731 so that the angle of line 731 is consistent with the angle of paragraph 73. After rotation, the electronic device can display as follows: Figure 8 The interface shown in (c) is shown in the image.

[0243] It's worth noting that when a user triggers an editing command, the electronic device may or may not detect lines with abnormal angles within the paragraph to be edited. If no lines with abnormal angles are detected, the electronic device can output a prompt message to inform the user that no such lines exist.

[0244] Optionally, after the electronic device rotates the entire line of text in the line with the abnormal angle to make the angle of the text in the line with the angle of the paragraph to be edited consistent with that of the line with the abnormal angle, the electronic device may also output a prompt message to inform the user that the angle of the line with the abnormal angle has been adjusted.

[0245] It is worth noting that, optionally, if the difference between the angle of any line and the angle of the paragraph to be edited is less than or equal to a certain preset threshold, the electronic device can determine that the line is not an angle-abnormal line.

[0246] Typically, there may be text with abnormal left and right spacing and / or abnormal top and bottom positions within the paragraph to be edited. In such scenarios, electronic devices can also respond to user-triggered editing commands by using the following scheme to adjust the position of text with abnormal left and right spacing and / or abnormal top and bottom positions within the paragraph to be edited, so that the text spacing and / or top and bottom positions within the paragraph to be edited tend to be consistent.

[0247] Scenario 2: Adjusting text with abnormal vertical positioning.

[0248] Before introducing the embodiments of this application, we will first introduce how to determine the text with abnormal vertical position in the paragraph to be edited.

[0249] As an example, electronic devices can be used through, for example Figure 9 The process shown identifies text with abnormal vertical positioning within the paragraph to be edited, such as... Figure 9 As shown, the method includes:

[0250] Step 901: The electronic device determines the line center line of each line in the paragraph to be edited.

[0251] For example, the line center line is the central axis that passes through the entire line of text. The line center line can be determined in the following ways:

[0252] (a) The electronic device determines the geometric center of each character box in each line of the paragraph to be edited, and calculates the best fitted line passing through the center of each character box in any line through a linear fitting function, and takes the best fitted line passing through the center of each character box in any line as the line center line of that line.

[0253] (b) Electronic devices use the geometric center line (axis of symmetry) of the line frame that encloses the entire line of text as the line center line.

[0254] Step 902: The electronic device calculates the first distance between each character in each line and the center line of the line containing that character.

[0255] For example, the first distance can refer to the vertical distance between the center of the character frame of any text and the center line of the line containing that text, denoted as dist(P). ij , l i ) represents the vertical distance between the center of the character frame of the j-th character in the i-th row and the center line of the i-th row.

[0256] Step 903: The electronic device determines the distance threshold for each row.

[0257] Among them, the distance threshold for each line can refer to the average distance of the first distances from all the characters in each line to the center line of that line, or the distance threshold for each line can be the mode or median of the first distances from all the characters in that line to the center line of that line. The embodiments of the present application do not limit this. Of course, the distance threshold for each line can also be a preset value, or the distance threshold for each line can be the average value of the distance thresholds corresponding to all the lines in the paragraph to be edited.

[0258] For example, the electronic device can calculate according to the formula the average distance of all the characters in the i-th line to the center line of the i-th line, so as to obtain the average distance of all the characters in each line to the center line of that line.

[0259] Among them, n represents the total number of characters in the i-th line in the paragraph to be edited. represents the sum of the vertical distances from the center of the character frames of the n characters in the i-th line to the center line of the i-th line. D i represents the average distance of all the characters in the i-th line to the center line of the i-th line.

[0260] Step 904: The electronic device determines whether there are characters with abnormal up-and-down positions in each line according to the distance threshold of all the characters in each line to the center line of that line and the first distance between each character in each line and the center line of the line where the character is located.

[0261] It can be understood that the characters with abnormal up-and-down positions can refer to the characters in a certain line that are far from or close to the center line of the line. For example, as shown in (a) of Figure 10 , in the handwritten note 102 displayed by the electronic device, the character "North" 1023 is a character far from the center line of the line. The character "Middle" 1024 is a character close to the center line of line 1021. The characters far from the center line of the line can refer to the characters whose first distance to the center line of the line where the character is located is greater than or equal to the third distance threshold. The characters close to the center line of the line can refer to the characters whose first distance to the center line of the line where the character is located is less than or equal to the fourth distance threshold.

[0262] For example, the third distance threshold is greater than the fourth distance threshold, and the third distance threshold and the fourth distance threshold for any line can be determined by the distance threshold of that line. For example, assuming that the distance threshold for a certain line is the average distance of that line, then for example B i1 = D i or B i1 = D i ×d1. B i2 = D i or B i2 = D i ×d2. B i1 represents the third distance threshold corresponding to the i-th line. Bi2 This represents the fourth distance threshold corresponding to the i-th row. d1 and d2 are preset parameters whose values ​​can be set manually. For example, d1 and d2 can be any value between 0.5 and 2.5, with d1 being greater than d2. For example, B i1 =D i ×d1, B i2 =D i When ×d², d1 can be 1.5 and d2 can be 0.8. For example, B i1 =D i B i2 =D i When ×d2, d2 can be a number less than 1.

[0263] For example, step 904 can be achieved in the following way:

[0264] Electronic devices can be based on the formula dist(P) ij , l i )≥B i1 or dist(P ij , l i )≤B i2 Identify text in any line that is out of order. Specifically, dist(P ij , l i The distance () represents the first distance from the center of the character frame of the j-th character in the i-th line to the center line of the i-th line. That is, if the first distance from the center of the character frame of the j-th character in the i-th line to the center line of the i-th line is greater than or equal to B... i1 Then the j-th character can be considered to be a character with an abnormal vertical position. If the distance from the center of the j-th character's frame in the i-th line to the first line center line of the i-th line is less than or equal to B... i2 Therefore, the j-th character can be considered to be a character with an abnormal vertical position. B i1 B i2 Custom settings can be made as needed, or system preset values ​​can be used; this application embodiment does not limit this.

[0265] It is understood that in the embodiments of this application, each line in a certain paragraph can correspond to a third distance threshold / fourth distance threshold, and the third distance threshold / fourth distance threshold corresponding to different lines can be the same or different.

[0266] As an example, the third / fourth distance threshold for each line can be determined by the average distance of all the text in each line to the center line of that line, or the median or mode of the distance.

[0267] For example, taking d1 = 1.5 as an example. Then, for electronic devices, the vertical distance between each character and the center line of line 102 can be greater than or equal to 1.5D.i The text is considered as text with an abnormal vertical position.

[0268] If any line contains text with an abnormal vertical position, the electronic device may execute step 905. If no line contains text with an abnormal vertical position, the electronic device will not adjust the vertical position of the text in that line.

[0269] Step 905: For text with abnormal vertical position, the electronic device adjusts the position of the text with abnormal vertical position so that the distance from the adjusted text with abnormal vertical position to the center line of the line is within the preset distance threshold range.

[0270] For example, for text with abnormal vertical position, the electronic device moves the text with abnormal vertical position closer to or further away from the center of the line along the direction from the center of the text frame of the text with abnormal vertical position to the center line of the line of the text.

[0271] As an example, the preset distance threshold range can be determined by the average, mode, or median of the first distance from all characters in the line containing the abnormally positioned text to the line center line; however, this embodiment does not limit this. Alternatively, the preset distance threshold range can be a preset value.

[0272] As an example, the preset distance threshold range may include an upper limit and / or a lower limit. For instance, the preset distance threshold range may include an upper limit, meaning the preset distance threshold range is a range less than or equal to a second distance threshold. The upper limit of the preset distance threshold range is used to limit the first distance from the text to the line center line after movement to be less than or equal to the second distance threshold. Alternatively, the preset distance threshold range may include a lower limit, meaning the preset distance threshold range is a range greater than or equal to a first distance threshold. The lower limit of the preset distance threshold range is used to limit the first distance from the text to the line center line after movement to be greater than or equal to the first distance threshold.

[0273] For example, if the first distance from a character to the center line of the line is greater than or equal to 1.5D i The electronic device can then move the text closer to the line center line so that the first distance between the text and the line center line after the movement is within a preset distance threshold range. For example, the first distance between the text and the line center line after the movement is greater than or equal to a first distance threshold and / or less than a second distance threshold. For example, if the first distance between a text and the line center line is less than or equal to 0.5D... i Then the electronic device can move the text away from the center line of the line so that the first distance between the text and the center line of the line after the movement is greater than or equal to a first distance threshold and / or less than a second distance threshold.

[0274] As an example, one alternative implementation is that, after the electronic device determines that the text in any line is abnormally positioned vertically, the electronic device can adjust the text position until it satisfies the following formula: dist(P ij , l i )≥A i1 and / or dist(P) ij , l i )≤A i2 Among them, dist(P ij , l i ) represents the vertical distance from the center of the j-th first character in the i-th row to the center line of the i-th row after adjustment. A i1 A represents the first distance threshold of the i-th row. i2 This represents the second distance threshold for the i-th line. The first and / or second distance thresholds are determined by the average, median, or mode of the first distances from all characters in the i-th line to the line center line of the i-th line, where the first distance threshold is greater than the second distance threshold. A i1 A i2 Custom settings can be made as needed, or system preset values ​​can be used; this application embodiment does not limit this. In this application embodiment, each line within a paragraph can correspond to a first distance threshold / second distance threshold, and the first distance threshold / second distance threshold corresponding to different lines can be the same or different.

[0275] As an example, the first distance threshold / second distance threshold for any line can be determined by the average distance of all the text in that line to the line centerline.

[0276] As an example, A i1 =D i Or A i1 =D i ×c. A i2 =D i Or A i1 =D i ×a. Here, c and a are preset parameters whose values ​​can be set manually. For example, c and a can be any value between 0 and 2. For instance, c can be 1, or a number greater than 1. If you want the text in any line to be closer to the line center line, then c can also be a number greater than 0 or less than 1, such as 0.9 or 0.6. If you want the text in any line to be further away from the line center line, then c can also be a number greater than 1, such as 1.2 or 1.1.

[0277] As an example, the second distance threshold can be less than or equal to the third distance threshold; for instance, if the first distance from a character to the line center line is greater than or equal to 1.5D. i, the text can be moved towards the center line of the line so that the first distance from the text to the center line of the line after movement is less than 1.5D i . For example, it is 1.2D i or D i .

[0278] It can be understood that although the first distance from the text to the center line of the line can be controlled to be less than the second distance threshold, in order to prevent the text from being too close to the center line of the line, the first distance from the text after movement to the center line of the line can be made greater than or equal to the first distance threshold. The first distance threshold in the embodiments of the present application can be greater than or equal to the fourth distance threshold. Assuming that the fourth distance threshold is 0.5D i , then if the first distance from a text to the center line of the line is less than or equal to 0.5D i , then the text can be moved away from the center line of the line so that the first distance from the text to the center line of the line after movement is greater than or equal to 0.9D i .

[0279] For example, when the user writes handwritten notes in the memo using a finger, there may be some texts far from the center line of the line or some texts too close to the center line of the line, which makes the handwritten notes look untidy. As shown in Figure 10 Figure (a) in, the electronic device displays a note interface 101 as shown in Figure 10 Figure (a) in. The user can trigger an edit instruction in the handwritten note interface 101. For example, the user can perform a long press operation in the handwritten note interface 101 to trigger the electronic device to display a pop-up window. Then the user can click on a control in the pop-up window to adjust the up and down position of the text, so that the electronic device detects the edit instruction. After that, in response to the edit instruction, the electronic device can determine that the user wants to edit paragraph 102, and then the electronic device identifies the texts with abnormal up and down positions in the paragraph 102 (that is, single characters that are too high or too low when the user writes), such as the single character "North" 1023 far from the center line of line 1021 and the single character "Middle" 1024 close to the center line of line 1021 in paragraph 102. After that, the electronic device can appropriately move the text "North" 1023 towards the center line of line 1021 so that the first distance between the text "North" 1023 and the center line of line 1021 after movement is greater than or equal to the first distance threshold. Optionally, the first distance between the text "North" 1023 and the center line of line 1021 after movement can also be less than or equal to the second distance threshold. The electronic device can appropriately move the text "Middle" 1024 away from the center line of line 1021 so that the first distance between the text "Middle" 1024 and the center line of line 1021 after movement is greater than or equal to the first distance threshold. The first distance between the text "Middle" 1024 and the center line of line 1021 is less than or equal to the second distance threshold, as shown in Figure 10 as shown in (b) of

[0280] It can be understood that there may be text with abnormal vertical positions in any line, or there may be no text with abnormal vertical positions. Assuming that there is no text with abnormal vertical positions in any line, then for the electronic device, it is not necessary to move the text in the direction of approaching or moving away from the center line of the line. For example, the electronic device determines that there is no text with abnormal vertical positions in line 1022.

[0281] It should be noted that, as Figure 10 taking the example that the electronic device responds to an editing instruction triggered by the user to edit a certain paragraph. In the actual process, a handwritten note usually includes multiple paragraphs, and there may be text with abnormal vertical positions in each paragraph. To improve the user experience, the user can also trigger an operation to indicate adjusting the text with abnormal vertical positions in all paragraphs in the handwritten note. Then, as Figure 11 shown in (a) of Figure 11 the user can click on the "Editing Control 405" to trigger the electronic device to display an interface as shown in (b) of Figure 11 In the interface shown in (b) of Figure 11 , the user can click on Control 4053 to trigger the electronic device to detect the user's editing instruction, thereby identifying all paragraphs included in the handwritten note, that is, the text with abnormal vertical positions in Paragraph 102 and Paragraph 103. Assuming that the electronic device identifies the characters "North" 1023 and "Middle" 1024 in line 1021 as the text with abnormal vertical positions in line 1021, and all the characters in line 1031 are text with abnormal vertical positions. The electronic device can appropriately move the character "North" 1023 in the direction of the center line of line 1021 so that the first distance between the moved character "North" 1023 and the center line of line 1021 is greater than or equal to the first distance threshold. Optionally, the first distance between the moved character "North" 1023 and the center line of line 1021 can also be less than or equal to the second distance threshold. The electronic device can appropriately move the character "Middle" 1024 in the direction away from the center line of line 1021 so that the first distance between the moved character "Middle" 1024 and the center line of line 1021 is greater than or equal to the first distance threshold. Optionally, the first distance between the moved character "North" 1023 and the center line of line 1021 can also be less than or equal to the second distance threshold. In addition, the electronic device can also adjust the positions of each character in line 1031 so that the vertical distance between all the characters in line 1031 after adjustment and the center line of line 1031 is greater than or equal to the first distance threshold corresponding to line 1031, and optionally less than or equal to the second distance threshold corresponding to line 1031.

[0282] It is understood that in the embodiments of this application, each row has a line frame, and the text within each row has a character frame.

[0283] Scenario 3: Adjusting inline text spacing

[0284] The design principle of inline text spacing adjustment is to identify characters in each line whose spacing is abnormal (i.e., characters that are too dense or too sparse when written by the user), and to move these characters or other characters in the line appropriately to the left or right to resolve the abnormality in density.

[0285] The user can trigger an editing command for a certain paragraph. The electronic device responds to the editing command by adjusting the text spacing within the paragraph so that the text spacing of the line containing text with abnormal left and right spacing is greater than or equal to a first spacing threshold. Optionally, the spacing between text in the same line can also be adjusted to be less than or equal to a second spacing threshold.

[0286] Before introducing the embodiments of this application, we will first introduce how to determine the text with abnormal left and right spacing in a certain line of the paragraph to be edited.

[0287] As an example, electronic devices can be used through, for example Figure 12 The process shown identifies text with abnormal left and right spacing within the paragraph to be edited, such as... Figure 12 As shown, the method includes:

[0288] Step 1201: The electronic device determines the line center line of each line in the paragraph to be edited.

[0289] The specific implementation is the same as described in step 901 above, and will not be repeated here.

[0290] Step 1202: The electronic device calculates the spacing between each character in any line and its adjacent characters.

[0291] For example, the spacing between a character and its adjacent characters can be considered as the horizontal distance between the two characters along the center line of the line.

[0292] For example, for each character in any line, the electronic device calculates the distance between that character and a neighboring character along the line's center line. One example is that the electronic device can use the following formula: Calculate the distance between each character and its adjacent characters along the line center line. Where S... i,j P represents the distance between the j-th character in the i-th line and the character to the right of the j-th character, along the line center line of the i-th line. i,j+1 P represents the center position of the character frame of the (j+1)th character in the i-th row. i,j This indicates the center position of the character frame of the j-th character in the i-th row. This represents a unit vector along the direction of the row centerline.

[0293] Step 1203: The electronic device calculates the average spacing between text in each line, or the median or mode of the spacing between text in each line.

[0294] By performing the calculation as in step 1202 for each character in any line, the spacing between any two adjacent characters in the same line can be obtained. Then, the electronic device can calculate the average of the spacing between multiple adjacent characters in the same line to obtain the average spacing between characters in any line. The average here can be the arithmetic mean, the median, the mode, etc., and is not limited here.

[0295] Since the number of characters in different lines varies, the above method can be used to calculate the unique average spacing of each line. This average spacing can then be used to identify characters with abnormal spacing within that line, thus ensuring that the spacing of characters within the same line is consistent.

[0296] As another example, in order to make the spacing between text in different lines within a paragraph more consistent, the average spacing of each line in this embodiment can also be taken as the same value. In this way, the uniform text spacing within a paragraph can be used to identify text with abnormal spacing within that paragraph, so as to achieve consistent spacing between text within the same line and also between text within the same paragraph.

[0297] For example, the average spacing of each line can be obtained by averaging the average spacing of all lines. For example, it could be a weighted average based on the number of characters in each line, or it could be the median, mode, etc., without any restrictions here.

[0298] Step 1204: The electronic device determines whether there are characters with abnormal spacing in any line based on the average / median or mode of the spacing between characters in each line and the spacing between each character and its adjacent characters in each line.

[0299] If the horizontal distance between a character in a line and its adjacent characters is greater than or equal to the third spacing value, and / or less than or equal to the fourth spacing value, then that character can be considered to have abnormal horizontal spacing. In other words, if the horizontal distance between a character in a line and its adjacent characters is less than the fourth spacing value, and / or greater than or equal to the third spacing value, then the spacing between that character and its adjacent characters can be considered to not meet the third requirement. The third spacing value is greater than the fourth spacing value. It can be understood that the third spacing value is used to filter out overly sparse text within a line, while the fourth spacing value is used to filter out overly dense text within a line.

[0300] The fourth spacing value / third spacing value can be the average distance between the center lines of any row, or it can be a value obtained by combining the average distance between the center lines of any row and a preset value.

[0301] For example, if the spacing S between the j-th character in the i-th row and the (j+1)-th or (j-1)-th character in the i-th row... i,j ≥S i ×e and / or S i,j ≤S i If we consider the expression ×f, then the j-th character is considered to be a character with abnormal left and right spacing in the i-th line. j is an integer greater than or equal to 1. For example, if j = 1, then the character can be considered to be the first character from left to right in the i-th line. For example, as... Figure 13 If the character 1315 is in the i-th row and j=2, then this character can be considered the second character from left to right in the i-th row. For example, as shown in... Figure 13 The text is 1313.

[0302] It is understandable that for any given character, if the spacing S between it and its adjacent characters is... i,j ≥S i ×e can be considered as text with abnormal left and right spacing. Or, if the spacing S between it and adjacent text is... i,j ≤S i ×f can be considered as text with abnormal left and right spacing. Or, if the spacing between it and the adjacent text 1 satisfies S i,j ≤S i ×f, the spacing between it and the adjacent character 2 satisfies S i,j ≥S i ×e can also be considered a character with abnormal left and right spacing. Adjacent character 1 and adjacent character 2 are the characters located to the left and right of this character, respectively.

[0303] Among them, S i This represents the average spacing between all characters in the i-th line and their adjacent characters. e and f are preset values; for example, e and f can be 1.5, 1.2, 1.3, 2, 2.1, or numbers less than 1, with e greater than f. This application does not limit these values.

[0304] Taking e = 1.5 as an example, then the spacing S between the j-th character in the i-th row and the (j+1)-th character in the i-th row is... i,j ≥S i When the value is ×1.5, the j-th character is considered to have abnormal left and right spacing in the i-th line. In practice, the position of the j-th character or the (j+1)-th character can be moved to make the spacing between the j-th character and the (j+1)-th character meet the preset spacing requirements.

[0305] If there are characters with abnormal left and right spacing in any line, the electronic device can execute step 1205.

[0306] Step 1205: The electronic device adjusts the position of the text in the line containing the text with abnormal left and right spacing so that the spacing between adjacent text in the entire line meets the preset spacing requirements.

[0307] The spacing between adjacent characters meeting the preset spacing requirements can mean that the spacing between adjacent characters in the same line is the same, or that the spacing between adjacent characters in the same line is within a preset spacing threshold range.

[0308] For example, the preset spacing threshold range can be determined by the average, mode, or median of the spacing between all characters in the line containing text with abnormal left and right spacing.

[0309] As an example, the preset spacing threshold range in this application embodiment may include an upper limit and / or a lower limit. For instance, the preset spacing threshold range may include an upper limit, that is, a range where the preset spacing threshold range is less than or equal to a second spacing value. The upper limit of the preset spacing threshold range is used to limit the spacing between the text and adjacent text after movement to be less than or equal to the second spacing value. Alternatively, the preset spacing threshold range may include a lower limit, that is, a range where the preset spacing threshold range is greater than or equal to a first spacing threshold. The lower limit of the preset spacing threshold range is used to limit the spacing between the text and adjacent text after movement to be greater than or equal to the first spacing value.

[0310] As an example, electronic devices can move the position of text within a line in a direction parallel to the line center line.

[0311] As an example, electronic devices can adjust the position of only text with abnormal left and right spacing so that the spacing between adjacent text in the entire line meets the preset spacing requirements.

[0312] As another example, in practice, there may be situations where only adjusting the position of text with abnormal left and right spacing cannot make the spacing between adjacent text in the entire line meet the preset spacing requirements. In this case, the electronic device can also move the position of other text in the line so that the spacing between adjacent text in the entire line finally meets the preset spacing requirements.

[0313] A preferred implementation is to adjust the text position until it satisfies the following formula: dist(P ij ,P ij+1 ,l i )>y and / or dist(P ij ,P ij+1 ,l iLet y represent the first spacing threshold and m represent the second spacing threshold. The first and second spacing thresholds can be determined based on the average spacing of the i-th row. For example, the first spacing threshold is the average spacing S of the i-th row. i That is, y = S i Alternatively, the first spacing threshold can be determined by the average spacing S of the i-th row. i And determined by the preset parameter c, i.e., y = S i ×c. c can be a value greater than 0. For example, if you want smaller spacing between text within any line after adjustment, you can set c to a value less than 1. If you want larger spacing between text within any line after adjustment, you can set c to a value greater than or equal to 1. The first spacing threshold is greater than the second spacing threshold. The second spacing threshold is determined by the average spacing S. i It is determined by the preset parameter n. n can be a value greater than 0. For example, c is 1 and n is 0.8.

[0314] As an example, c is a value greater than 0 and less than or equal to 1.

[0315] When users handwrite notes in a memo app using their fingers or a stylus, some characters may be written too densely or too sparsely. In such scenarios, to ensure a better overall coherence of the user's handwritten notes, electronic devices can recognize characters with abnormally large or small spacing between their left and right neighbors in any line and adjust these characters accordingly to correct the density discrepancies. For example... Figure 13 As shown in Figure (a), the electronic device displays as follows: Figure 13 Figure (a) shows a handwritten note interface 130. The handwritten note interface 130 includes paragraphs 131 and 132. Paragraph 131 includes lines 1311 and 1312. Paragraph 132 includes line 132. Assuming a user wants to edit paragraph 131, the user can trigger an editing command for paragraph 131 within the handwritten note interface 130. For example, the user can perform a long press operation within the handwritten note interface 130 to trigger a pop-up window on the electronic device. The user then clicks on the control to adjust the left and right spacing in the pop-up window, triggering the electronic device to detect the editing command. In response to the editing command, the electronic device can determine that the user wants to edit paragraph 131, and then the electronic device identifies text with abnormal left and right spacing within paragraph 132. Assuming the electronic device combines... Figure 12The process shown identifies the character "Zhang" 1313 in line 1311 as a character with abnormal left and right spacing, and identifies the characters "Dui" 1314 and "Hao" 1315 in line 1312 as characters with abnormal left and right spacing. The electronic device can move the character "Zhang" 1313 along the direction of the center line of the line towards the adjacent character "He", so that the spacing between the moved character "Zhang" 1313 and the character "Xiao" on its left and the spacing between the character "Zhang" 1313 and the character "He" on its right are the same, as shown in (b) of Figure 13 As shown. It can be understood that after the movement in (b) of Figure 13 , the spacing between all the characters in line 1311 tends to be consistent. It can be understood that during the implementation process, in order to keep the spacing between all the characters in line 1311 consistent, the electronic device can first determine the target spacing between adjacent characters, and then move the characters in line 1311 based on the determined target spacing. For example, the electronic device can first move the character "Zhang" 1313 to the right according to the target spacing. Assuming that after moving the character "Zhang" 1313, the spacing between the character "Zhang" 1313 and the character "He" is greater than the target spacing, then the electronic device can move the character "He" to the left (i.e., in the direction closer to the character "Zhang" 1313) so that the spacing between the character "Zhang" 1313 and the character "He" is equal to the target spacing. By analogy, the electronic device can move the remaining characters in line 1311 according to this method so that the spacing between all the characters in line 1311 after the movement tends to be consistent. As shown in (a) of Figure 13 , the electronic device can also move the characters "Dui" 1314 and "Hao" 1315 in line 1312 according to the spacing requirements that need to be satisfied between the characters in line 1312 after the movement, so that the spacing between the characters in line 1312 after the movement tends to be consistent, as shown in (b) of Figure 13 .

[0316] As another example, assuming that after the electronic device adjusts the positions of the characters in line 1311, if there is still a blank area in line 1311 that can accommodate one or more characters, as shown in (b) of Figure 13 , there is still a blank area after the character "Ming" after the movement, then the electronic device can move the character "Shi" in line 1312 to the blank area in line 1311 and move the positions of other characters in line 1312, as shown in (c) of Figure 13 .

[0317] It can be understood that there may be characters with abnormal left and right spacing in any line, or there may be no single characters with abnormal left and right spacing. Assuming that there are no single characters with abnormal left and right spacing in any line, then the electronic device may not need to perform the action of moving the characters in any line left and right.

[0318] It is worth noting that, such as Figure 13 Taking an electronic device responding to a user-triggered editing command to adjust text with abnormal left and right spacing in one or more lines of the paragraph as an example, in practice, handwritten notes usually include multiple paragraphs, and each paragraph may contain text with abnormal left and right spacing. In this case, if... Figure 13 Adjusting in the way shown may be cumbersome and detrimental to the user experience, such as... Figure 14 As shown, assume the electronic device displays as follows Figure 14 The handwritten note interface 140 shown in (a) displays paragraphs 141 and 142. Both paragraphs 141 and 142 contain text with abnormal spacing. To adjust the abnormal spacing in paragraphs 141 and 142 with a single click, the user can click control 405 to trigger the electronic device to display... Figure 14 The interface shown in (b) is in Figure 14 In the interface shown in (b), the user can click control 4054 to enable the electronic device to detect the editing command. The electronic device can then respond to the editing command by adjusting the text with abnormal spacing in paragraphs 141 and 142. After adjustment, the text will display as shown in (b). Figure 14 The interface shown in (c) is shown in the image.

[0319] It's worth noting that scenarios one through three above describe how an electronic device responds to editing commands by adjusting lines with abnormal angles, text with abnormal vertical positioning, and text with abnormal horizontal spacing within the paragraph to be edited. In reality, the same paragraph to be edited may contain lines with abnormal angles, text with abnormal vertical positioning, and text with abnormal horizontal spacing. In such scenarios, the electronic device can respond to detected editing commands by rotating lines with abnormal angles, moving text with abnormal vertical positioning, and moving text with abnormal horizontal spacing. If the electronic device detects an editing command and the paragraph contains text with abnormal vertical positioning and abnormal horizontal spacing, but no lines with abnormal angles, then the electronic device can respond to the editing command by adjusting the positions of the text with abnormal vertical positioning and abnormal horizontal spacing. If the electronic device detects an editing command and the paragraph contains lines with abnormal angles and abnormal horizontal spacing, but no text with abnormal vertical positioning, then the electronic device can respond to the editing command by rotating lines with abnormal angles and adjusting the positions of text with abnormal horizontal spacing. If an electronic device detects an editing command and there are lines with abnormal angles and text with abnormal vertical positions within the paragraph to be edited, but no text with abnormal horizontal spacing, then the electronic device can respond to the editing command by rotating the lines with abnormal angles and moving the text with abnormal vertical positions within the paragraph to be edited.

[0320] As an example, the editing commands triggered by a user in the handwritten note-taking interface can also be deletion or insertion operations.

[0321] Taking the deletion operation as an example, this paper describes how the electronic device in this embodiment adjusts the position of the text in the paragraph to be edited when it detects the deletion operation.

[0322] like Figure 15 As shown in (a), the handwriting interface area of ​​the electronic device displays paragraphs 72 and 73. When the user wants to delete text from a certain paragraph, for example... Figure 15 As shown in (b), the electronic device can be instructed to delete the text "a" in line 721 by triggering a deletion operation. When the electronic device detects a deletion operation, it can do so through the above... Figure 6 , Figure 9 as well as Figure 11 The process identifies whether the following conditions exist within paragraph 72: lines with abnormal angles, text with abnormal vertical positioning, and text with abnormal horizontal spacing. For example, if... Figure 15As shown in (b) of , line 721 is an abnormal angle line. There are characters with abnormal left - right spacing in lines 721, 722, and 723, and there are also characters with abnormal up - down positions in line 721. For example, the characters "厚", "历", "史" in line 721 are all characters with abnormal up - down positions. In this scenario, the electronic device can, in response to a deletion operation, rotate line 721 within paragraph 72 to change the angle of line 721. The electronic device can also move the positions of the characters in lines 721, 722, and 723 left or right so that the spacing between adjacent characters in lines 721, 722, and 723 respectively meets the preset spacing requirements. In addition, the electronic device also needs to move the positions of the characters "厚", "历", "史", etc. in line 721 in the direction closer to or farther from the center line of line 721 so that the positions of the characters "厚", "历", "史" in line 721 after movement meet the preset distance requirements. The adjusted result is as shown in Figure 15 shown in (c) of Figure 15 As can be seen from (c) of , after adjustment, the character spacing in line 721 tends to be consistent. The character spacing in line 722 tends to be consistent. The character spacing in line 723 tends to be consistent. And the distances between the characters "厚", "历", "史", etc. in line 721 and the center line of line 721 meet the preset distance requirements.

[0323] For example, taking the edit instruction as an insert operation, this example describes how the electronic device in the embodiment of the present application adjusts the positions of characters in the to - be - edited paragraph when detecting an insert operation. Combining Figure 15 with (a) of , assuming that the user wants to insert characters between certain positions in line 721, as shown in (a) of Figure 16 , the electronic device can trigger a long - press operation at the position where the characters are to be inserted (for example, between the characters "是" and "一" in line 721) so that the electronic device can detect the insert operation. In this scenario, the electronic device can, in response to the insert operation input by the user, generate a blank area with a preset length between the characters "是" and "一" for the user to write the content to be inserted. In addition, the electronic device can also, in response to the user's insert operation, adjust the angle of line 721 and adjust the characters with abnormal left - right spacing and up - down positions in lines 721, 722, and 723, and finally display an interface as shown in (b) of Figure 16 .

[0324] In the embodiment of the present application, after the electronic device detects an edit instruction (such as insert, delete, etc.), the electronic device can adjust the positions of the characters in the edited paragraph to improve neatness. After that, the electronic device will perform text typesetting for the entire layout based on the overall layout. For different types of edit instructions, the text typesetting methods of the electronic device are different. This embodiment respectively describes the text typesetting processes based on the overall layout when performing deletion and insert operations.

[0325] Scenario 4: Text Layout Based on Overall Page Layout

[0326] 1) Delete operation (also known as delete command).

[0327] like Figure 17 As shown, Figure 17 The text formatting process of an electronic device in response to a delete command is shown.

[0328] Step 1701: The electronic device obtains the text frames, line frames, and paragraph frames of the text within the paragraph to which the deletion command is applied.

[0329] For example, the electronic device first obtains the paragraph frame of the paragraph to be edited, the line frame of each line within the paragraph to be edited, and the character frame of each word within the paragraph to be edited.

[0330] Step 1702: The electronic device obtains the character outline based on the character frame and line frame.

[0331] The outer frame of each line of text in the paragraph to be edited is formed by the boundary of each line frame and the midline between the line frames of the text it contains.

[0332] Step 1703: The electronic device saves the text after the deleted area into the layout list. Specifically, the deleted area refers to the area where the text to be deleted is located, as instructed by the deletion command.

[0333] Step 1704: The electronic device determines whether there is any text remaining in the layout list.

[0334] Determine if there is still text to be formatted in the formatting list. If it exists, proceed to step 1705. If it does not exist, proceed to step 1706.

[0335] Step 1705: Format the first text in the formatting list.

[0336] For example, the electronic device typesets the first character in the typesetting list, with the left edge of the text's outline coinciding with the right edge of the previous character, and the center of the text's outline aligned with the line center line. If the text extends beyond the right boundary of a paragraph, the left border of the text coincides with the left boundary of the paragraph, and the center of the text's outline aligns with the center line of the next line. Then, step 1704 is performed for judgment.

[0337] Step 1706: End of Layout: There is no more text to be formatted in the layout list, and the layout process for the current paragraph ends.

[0338] like Figure 18 As shown in (a), the electronic device's handwriting note interface displays handwritten notes, including paragraph 181, which contains lines 1811 and 1812. If the user wants to delete certain text in paragraph 181, such as... Figure 18 As shown in (b), the user can trigger a deletion operation on the text 18111. The electronic device will then respond to the received deletion operation and remove the text 18111 from the handwritten note. After the text 18111 is deleted, the electronic device can move the text following the text 18111 in line 1811 (e.g., "connecting the East and") to the left (i.e., towards the direction of "the Silk Road is"), and move the text in line 1812 (e.g., the West) into line 1811, and display as shown in [image / description]. Figure 18 The interface shown in (c) is shown in the image.

[0339] Assuming there are 11 characters in line i, after the electronic device deletes characters j to j+5 from line i, j = 2, the electronic device can move characters j+6 to 12 from line i to the left, so that character j+6 is adjacent to character j-1. After the movement, there will be a blank area on the right side of line i. To improve the neatness of handwritten notes, the electronic device can also calculate how many more characters the blank area can hold based on the length of the blank area and the size and average spacing of the characters handwritten by the user in line i. For example, if it can hold 6 characters, then the electronic device can move the first 6 characters on the left side of line i+1 (i.e., characters 1 to 6 in line i+1) to the blank area of ​​line i.

[0340] Optionally, the electronic device can also adjust text with abnormal angles, abnormal vertical positioning, and / or abnormal horizontal spacing in paragraph 181 in response to a deletion operation. For example, there are texts with abnormal vertical positioning in line 1812, such as "text" 18121, "text" 18122, and "text" 18123. The electronic device can also adjust the text with abnormal vertical positioning in line 1812 in response to a deletion operation, ultimately displaying as follows: Figure 18 The interface shown in (c) is shown in the image.

[0341] It is understandable that, taking the example of text with abnormal vertical positioning in line 1812, in actual practice, if lines 1811 and 1812 also have text with abnormal angles and / or abnormal left and right spacing, the electronic device can also rotate the lines with abnormal angles in lines 1811 and 1812 and / or adjust the text spacing in lines 1811 and 1812.

[0342] 2) Insertion operation (also known as insert command).

[0343] After a user writes handwritten notes on the handwriting area of ​​an electronic device, the following scenarios may occur: the user misses a word, or the user wants to insert content between two words in a line. In this case, the user can trigger an insertion operation on the electronic device, so that the electronic device, upon detecting the insertion operation, will respond by inserting a blank area of ​​a specified length at the position indicated by the insertion operation, for the user to write content. The specific process can be as follows: Figure 19 As shown:

[0344] Step 1901: The user triggers an insertion operation. The electronic device detects and responds to the insertion operation by acquiring the paragraph frame of the paragraph to be inserted, the line frame of each line within the paragraph to be inserted, and the paragraph frames of other paragraphs (if any) on the page.

[0345] For example, the paragraph to be inserted is the paragraph on which the insertion operation is applied.

[0346] Step 1902: The electronic device determines whether there are other paragraphs below the paragraph to be inserted based on the identified paragraph frame.

[0347] In step 1902, if the electronic device determines that there are no other paragraphs below the paragraph to be inserted, then the determination in step 1903 is executed; if the electronic device determines that there are other paragraphs below the paragraph to be inserted, then the determination in step 1906 is executed.

[0348] Step 1903: The electronic device confirms the existing number of lines in the paragraph to be inserted based on the line boxes identified in step 1901.

[0349] It is understandable that the existing number of lines in the paragraph to be inserted refers to the number of lines in the paragraph to be inserted before the electronic device detects the insertion operation.

[0350] In step 1902, assuming the electronic device determines that there is only one line in the paragraph to be inserted, i.e., a single line, then step 1904 is executed; if the electronic device determines that there are multiple lines in the paragraph to be inserted, then step 1905 is executed.

[0351] Step 1904: The electronic device generates a first blank area of ​​a first preset length in the line where the insertion position is located in the paragraph to be inserted, for the user to write the content to be inserted.

[0352] The first preset length is less than the length of the row where the insertion position is located. For example, the first preset length can be one-half or one-third of the length of the row where the insertion position is located, but this embodiment does not limit this.

[0353] It is understandable that after the first blank area is generated, the user can write text in the first blank area. It is also understandable that the text written by the user in the first blank area can be text entered using the phone's keyboard or text entered by handwriting. This embodiment of the application does not limit this.

[0354] As another example, after the first blank area is generated, if the electronic device detects that the user has not written text in the first blank area for a preset time, the electronic device can cancel the first blank area.

[0355] If the user-entered content occupies more than a certain threshold in the first blank area (preferably between 0.5 and 1.0), a second blank area is generated for the user to input. If the added second blank area causes the paragraph to touch other paragraph boxes or page boundaries, it will automatically wrap to the next line.

[0356] If the content entered by the user in the first blank area accounts for less than a certain threshold, i.e., the first blank area is not filled, the electronic device can refer to the above. Figure 17 The method shown is used to format the text following the first blank area.

[0357] Step 1905: The electronic device generates a third blank area with a total length of the second preset length in the line where the insertion position is located in the paragraph to be inserted (with the paragraph frame as the boundary, and automatic line wrapping when encountering the paragraph frame) for the user to write the content to be inserted.

[0358] For example, the second preset length is equal to the length of the row where the insertion position is located. The first preset length is less than the second preset length.

[0359] If the content to be inserted by the user in the third blank area accounts for more than a certain threshold (preferably between 0.5 and 1.0), then a fourth blank area with a total length equal to the line length will be generated for the user to input (with the paragraph box as the boundary, and automatic line wrapping when a paragraph box is encountered).

[0360] Step 1906: If there are other paragraphs below the paragraph to be inserted, the electronic device determines whether the spacing between the paragraph to be inserted and the other paragraphs below it is greater than the line height of the paragraph to be inserted.

[0361] For example, the line height of the paragraph to be inserted can be the average line height of all lines, the largest line height of the paragraph to be inserted, or the smallest line height. This application does not limit this.

[0362] Based on the paragraph frame and line frame information obtained in step 1901, determine whether the spacing between the paragraph to be inserted and the paragraph below it is greater than the average line height of the paragraph to be inserted. If the determination result is yes, that is, if the spacing between the paragraph to be inserted and the paragraph below it is greater than the line height, then proceed to step 1907; if the determination result is no, that is, if the spacing between the paragraph to be inserted and the paragraph below it is less than or equal to the line height of the paragraph to be inserted, then proceed to step 1908.

[0363] Step 1907: If the spacing between the paragraph to be inserted and the paragraph below it is greater than the line height, the electronic device generates a fourth blank area in the line where the insertion point is located.

[0364] It is understandable that the length of the fourth blank area, whether it is the first preset length or the second preset length, can be determined by referring to steps 1903 to 1905. For example, if the paragraph to be inserted is a single line, the fourth blank area is the first preset length; if the paragraph to be inserted is a multi-line paragraph, the fourth blank area is the second preset length.

[0365] Step 1908: If the spacing between the paragraph to be inserted and the paragraph below it is less than or equal to the line height, the electronic device moves down to the other paragraphs below the paragraph to be inserted and generates a fourth blank area in the line where the insertion point is located.

[0366] If the spacing between the paragraph to be inserted and the paragraph below it is less than the line height, it means that a blank area may not be able to be inserted, or if a blank area is inserted, it will overlap with the paragraph below. Therefore, the electronic device can change the position of the notes in the paragraph below, moving the entire paragraph down until the paragraph spacing exceeds the line height. The electronic device then generates a fourth blank area in the line where the insertion point is located.

[0367] The following will be combined Figures 20-24 Describe the processing flow of the electronic device when an insertion operation is detected.

[0368] a) There are no other paragraphs below the paragraph to be inserted.

[0369] Case a1) Taking a paragraph to be inserted that includes a single line as an example, such as Figure 20 As shown in Figure (a), assuming the electronic device performs an insertion operation on line 2011 in paragraph 201, the electronic device can determine that paragraph 201 is the paragraph to be inserted. The electronic device can identify the paragraph frame of paragraph 201, as well as the line frame of each line within paragraph 201, such as the line frame of line 2011. Since there are no other paragraphs below paragraph 201, the electronic device can identify the existing number of lines in paragraph 201, such as... Figure 20 As shown in Figure (a), paragraph 201 has one line, namely line 2011. The electronic device can insert a blank area 2031 of a first preset length from the position where the insertion operation is performed in line 2011, as follows. Figure 20 as shown in (b) therein for the user to input the content to be inserted.

[0370] As Figure 20 shown in (c) therein, after the electronic device inserts the blank area 2031 in row 2011, during the process that the user inputs the content to be inserted in the blank area 2031, the electronic device can detect the proportion of the content to be inserted in the entire blank area 2031. Assuming that the proportion exceeds 0.8, then the electronic device can continue to insert a blank area 2032 with a first preset length on the right side of the blank area 2031 for the user to input content, as Figure 20 shown in (d) therein. After the electronic device inserts the blank area 2031 in row 2011, the user can insert text in the blank area 2031. Assuming that the text inserted by the user does not fill the blank area 2031, as Figure 20 shown in (c) therein, then the electronic device can also move the text after the blank area 2031 to the remaining area of the blank area 2031, as Figure 20 shown in (e) therein.

[0371] It should be noted that during the process of the electronic device inserting the blank area 2032 with the first preset length and the blank area 2031, if the paragraph touches other paragraph frames or page boundaries, automatic line break will occur. As Figure 20 shown in (d) therein, during the process that the electronic device continues to insert the blank area 2032, the rightmost text "silk" in row 2011 touches the page boundary, then the electronic device can automatically line break the text after "silk" in row 2011 to row 2012.

[0372] It can be understood that in the actual process, it is also possible that when inserting the blank area 2031, the length of the remaining area in row 2011 is less than the first preset length of the blank area 2031, then the electronic device can also trigger automatic line break. For example, as Figure 20 shown in (f) therein, assuming that the user triggers the insertion operation at the position shown in Figure 20 (f) therein, since the length of the remaining area in row 2011 is less than the first preset length of the blank area 2031, at this time the electronic device can trigger the line break operation. At this time, the blank area 2031 includes the blank area in row 2012 and the blank area in row 2011, as Figure 20 shown in (g) and (h) therein. Or, as Figure 20As shown in (h), there are other paragraphs to the right of paragraph 201, such as paragraph 202. When the user triggers the insertion operation, the electronic device will encounter paragraph 202 during the process of inserting blank area 2031 in line 2011. In order to avoid the blank area 2031 and paragraph 202 from overlapping, the electronic device can automatically wrap the line, that is, move one or more texts after blank area 2031 to the next line, i.e., line 2012 in the figure.

[0373] Case a2) Taking the paragraph to be inserted as an example, which includes multiple lines, such as Figure 21 As shown in Figure (a), assuming the electronic device performs an insertion operation on line 2011 of paragraph 201, the electronic device can determine that the paragraph to be inserted is paragraph 201. Therefore, the electronic device can identify the paragraph frame of paragraph 201, as well as the line frame of each line within paragraph 201, such as the line frame of line 2011. Since there are no other paragraphs below paragraph 201, and paragraph 201 includes lines 2011 and 2022, the electronic device can insert a blank area 2031 of a second preset length at the insertion position of the insertion operation at line 2011, as shown in Figure (a). Figure 21 As shown in (b), this allows the user to input the content to be inserted. The second preset length is equal to the length of the line containing the insertion point. Figure 21 As shown in (c), when the content inserted by the user in the blank area 2031 exceeds a certain threshold, the electronic device can trigger automatic insertion into the blank area 2032, as follows: Figure 21 As shown in (d) in the figure.

[0374] Understandable Figure 21 and Figure 20 The difference lies in whether the paragraph to be inserted is a single line or multiple lines. For a single line, a blank area of ​​the first preset length is inserted; for multiple lines, a blank area of ​​the second preset length is inserted. The first preset length is less than the second preset length.

[0375] b) There are other paragraphs below the paragraph to be inserted.

[0376] like Figure 22 As shown in Figure (a), the handwritten note interface displayed on the electronic device includes paragraphs 201 and 202. Assuming the user intends to insert content in line 2011, the electronic device can trigger the insertion operation in line 2011, as follows: Figure 22 As shown in Figure (a), the electronic device receives and responds to the insertion operation by determining whether the spacing between paragraph 201 and the paragraph 202 below it is greater than the line height of paragraph 201. If the spacing between paragraph 201 and the paragraph 202 below it is less than the line height of paragraph 201, then... Figure 22As shown in (b), the electronic device can first move paragraph 202 downwards by a certain distance so that the spacing between paragraph 201 and the paragraph 202 below it is greater than the line height of paragraph 201, and then... Figure 22 As shown in (c), the electronic device can then insert a third blank area of ​​a second preset length in line 2011. It is understood that... Figure 22 Taking paragraph 201 as an example of multiple lines. Alternatively, the electronic device can perform the operation of inserting a third blank area of ​​a second preset length in line 2011 while moving paragraph 202 downwards. This embodiment of the application does not limit this. Alternatively, the electronic device can first perform the operation of inserting a third blank area of ​​a second preset length. Since the spacing between paragraph 201 and the paragraph 202 below it is less than the line height of paragraph 201 after inserting the third blank area, there may be overlap between the text in line 2011 and the content in paragraph 202. If the overlap is detected, the electronic device then moves paragraph 202 downwards.

[0377] In practice, it's possible that the content the user intends to insert into blank area 2031 occupies less of the specified space. For example, blank area 2031 may be long enough to hold four characters, but the user only writes one. Alternatively, the content inserted into blank area 2031 may not fill it completely. In such cases, the user can trigger a specified operation on this interface. The electronic device will then respond to this operation, confirming that the user has completed inserting content into blank area 2031. This will adjust the text position in line 2011 and move any text following blank area 2031 after the inserted text. Figure 20 As shown in (e). For example, the specified operation could be clicking a confirmation control, performing a double-click operation in the blank area 2031, or after writing a text, if the electronic device detects that the user has not performed an input operation in the blank area 2031 within a preset time, then the electronic device can also determine that the specified operation has been detected, or the electronic device can detect that the user performed an input operation outside the blank area 2031, etc.

[0378] In practice, it's possible that although the proportion of content the user intends to insert in blank area 2031 exceeds a certain threshold, the length of blank area 2031 is sufficient for the user to write the intended content. In this case, if the electronic device detects that the proportion of the inserted content in blank area 2031 exceeds the certain threshold, it will automatically trigger the insertion of more content into blank area 2032, which may be detrimental to the user experience. To improve the user experience, as an example, on the one hand, if the proportion of content the user intends to insert in blank area 2031 exceeds the certain threshold, the electronic device can automatically trigger the insertion of more content into blank area 2032. On the other hand, the electronic device can also output a prompt message to indicate whether to continue inserting content when the proportion of the inserted content in blank area 2031 exceeds the certain threshold. If it is determined that the user indicates to continue inserting content, the electronic device can continue inserting content into blank area 2032.

[0379] Optionally, as a possible implementation, in scenarios where users perform insertion operations in handwritten notes, electronic devices can not only respond to the insertion operation by inserting a blank area at a specified position, but also respond to the insertion operation by adjusting the position of the text within the paragraph to be inserted.

[0380] As an example, in this embodiment of the application, the electronic device can insert a blank area at a specified position and then adjust the lines with abnormal angles, text with abnormal vertical positions, and / or text with abnormal left and right spacing in the paragraph to be inserted. Alternatively, after inserting a blank area at a specified position, if the user indicates that the editing operation of the paragraph to be inserted has been completed, the lines with abnormal angles, text with abnormal vertical positions, and / or text with abnormal left and right spacing in the paragraph to be inserted can be adjusted.

[0381] In one possible implementation of this application, after the electronic device detects that the user has entered an editing command for handwritten notes (such as an insert command, a delete command, etc.), the electronic device can first adjust the position of the text within the paragraph to be edited to improve neatness. Afterwards, since text paragraphs are more text-related than text lines or text areas, the formatting of the edited text can better match the user's operational intent. Therefore, the electronic device can also perform text formatting based on the overall layout, with paragraphs as the unit.

[0382] The solution described above allows users to easily delete and insert text while maintaining a clean and aesthetically pleasing layout. However, in complex handwritten note layouts, user-triggered editing can lead to significant changes in the overall layout, making it difficult for users to quickly locate the corresponding positions of the text after formatting. Therefore, this embodiment proposes generating layout animations for handwritten notes. Specifically, after obtaining the final position of the handwriting layout, the animation is generated by calculating the intermediate trajectory based on the initial position and then displayed.

[0383] 1. Layout animation 1: Translation

[0384] Taking deletion or insertion operations as examples of editing commands, after a user triggers a deletion or insertion operation on a handwritten note, the electronic device, in response to the deletion or insertion operation, needs to move the position of the text in the paragraph to be edited when formatting the paragraph affected by the deletion or insertion operation. During the movement, the initial and final positions of the text to be moved may be on the same line, while the initial and final positions may be on different lines. In this embodiment, the initial position of the text to be moved can refer to its position within a line before the movement. In this embodiment, the final position of the text to be moved can refer to its position within a line after the movement.

[0385] For example, regarding the insertion operation, assuming the insertion operation is applied to position A within line A, the text at position A in line A needs to move from its initial position to the next line, or from its initial position within line A to its final position within line A, during typesetting. Similarly, regarding the deletion operation, assuming the deletion operation instructs the deletion of one or more characters B in line A, multiple characters in line A located after one or more characters B need to move towards character A. For the deletion operation, characters on the next line after the line where the deletion operation is applied may move to the line where the deletion operation is applied. Therefore, electronic devices can divide the text involved in position movement during typesetting into two groups: the first group consists of text whose initial and final positions are on the same line; the second group consists of text whose initial and final positions are not on the same line. Based on their positions before and after typesetting, each group calculates a certain number of intermediate states using interpolation or other methods, and plays them sequentially in chronological order to achieve the translation effect. An example of typesetting animation 1 is shown below. Figure 23 As shown:

[0386] Taking deletion as an example, such as Figure 23As shown in (a), the electronic device displays a handwritten note interface 23. This handwritten note interface 23 displays handwritten notes 230. These handwritten notes 230 include paragraphs 231, which include lines 2311, 2312, 2313, and 2314. Suppose a user wants to delete the text "2018 Meeting" 23120 in line 2312. The user can trigger a deletion operation on the handwritten note interface 23, causing the electronic device to detect and respond to the deletion operation by grouping the text in paragraph 231. For example, the electronic device can determine the text in paragraph 230 that has been moved after the text "2018 Meeting" 23120 in paragraph 231 is deleted. The electronic device can then divide the moved text into two groups. For example, the first group of text includes: text 23121 in line 2312, text 23132 in line 2313, and text 23142 in line 2314. The second group of text includes: text 23131 in line 2313 and text 23141 in line 2314. The electronic device can then determine the playback order of the first and second groups of text, as follows: Figure 23 As shown in (b), during the movement, text 23121 moves from its initial position toward the position of "2018 Meeting" 23120. Text 23131 moves from its initial position in line 2313 to line 2312, and is located after text 23121 in line 2312. Text 23141 moves to line 2313 and is located after text 23132, while 23132 moves to the left a certain position in line 2313. At the end of the movement, the final positions of each text in the handwritten note are shown as follows. Figure 23 As shown in (c) in the figure.

[0387] As an example, in deletion or insertion scenarios, layout animation 1 can be used to generate layout animation for handwritten notes.

[0388] 2. Layout Animation 2: Translation + Flash

[0389] Taking the deletion operation as an example, such as Figure 24 As shown in (a), when the electronic device detects a user-triggered deletion instruction to delete the text "2018 Meeting" 23120 in line 2312, the electronic device can determine that the first group of text includes: text 23121 in line 2312, text 23132 in line 2313, and text 23142 in line 2314. The electronic device can determine that the second group of text includes: text 23131 in line 2313 and text 23141 in line 2314. The electronic device can perform the same translation operation on the first group of text as in layout animation 1. That is, after grouping the text, the electronic device controls the translation of the first group of text and controls the second group of text to disappear from the position of the second group of text at the moment the translation of the first group of text begins. For example, as shown in... Figure 24 As shown in (b), during the movement of text 23121 in line 2312, text 23132 in line 2313, and text 23142 in line 2314, the electronic device controls the disappearance of text 23131 in line 2313 and text 23141 in line 2314. When each text in the first group has moved to its corresponding final position, the electronic device can control each text in the second group to appear in its corresponding final position. For example, the electronic device can control the appearance of each text in the second group to appear in its corresponding final position at the moment the first group of text finishes moving, as shown in (b). Figure 24 As shown in (c). For example, when text 23121 moves to line 2312 and is located at the position of "2018 Meeting" 23120 (i.e., the final position of text 23121), when text 23132 in line 2313 moves to the corresponding final position of text 23132 in line 2313 and text 23141 moves to the corresponding final position of text 23141 in line 2314, the electronic device controls text 23131 and text 23141 to appear in their respective corresponding final positions. For example, text 23131 appears in line 2312 and is located after text 23121, that is, the first character from the left in text 23131 is next to the last character from the left in text 23121.

[0390] As an example, in deletion or insertion scenarios, layout animation 2 can be used to generate layout animations for handwritten notes. Figure 24 Taking deletion as an example, during insertion, the electronic device can perform operations on two sets of text in the handwritten note, such as... Figure 24 The movement operation shown.

[0391] 3. Layout Animation 3: Translation + Gradient

[0392] Taking the deletion operation as an example, such as Figure 25 As shown in (a), when the electronic device detects a user-triggered deletion instruction to delete the text "2011 Experiment" in line 2312, it can determine that the first group of text includes: text 23121 in line 2312, text 23132 in line 2313, and text 23142 in line 2314. The electronic device can also determine that the second group of text includes: text 23131 in line 2313 and text 23141 in line 2314. The electronic device can perform the same translation operation on the first group of text as in layout animation 1. At the moment the first group of text begins to translate, the electronic device can control the second group of text to disappear from its initial position and appear at the final position corresponding to each character in the second group, but with the transparency set to the first transparency level, as shown in the image. Figure 25As shown in (b) of [reference], for the user, they can faintly see the second group of text at the final position.

[0393] As the first group of text is translated, the transparency of the second group of text gradually decreases. At the end moment when the translation of the first group of text is completed, that is, when each text in the first group of text is at its respective final position, the electronic device can control the transparency of the second group of text to reach 0, that is, at the final position, the user can clearly see the second group of text, as Figure 25 shown in (c) of [reference].

[0394] As an example, in the scenario of a deletion operation or an insertion operation, the typesetting animation effect 3 can be adopted to generate a typesetting animation effect for the handwritten note.

[0395] It can be understood that in the scenario of performing a deletion operation / insertion operation, the electronic device can move the text in the handwritten note according to the solution as Figure 25 shown. When the text moves to the final position, the electronic device can automatically perform an action to adjust the position of the text within the paragraph for paragraph 231 and display the adjusted handwritten note interface. Or when the text moves to the final position, the electronic device can, based on an editing operation triggered by the user, such as the operation of the user clicking on the control 405, or triggering a specified gesture on the handwritten note interface, to trigger the electronic device to perform an action to adjust the position of the text within the paragraph.

[0396] 4. Typesetting Animation Effect 4: Translation + Displacement + Gradient

[0397] Still taking the deletion operation as an example, as Figure 26 shown in (a) of [reference], when the electronic device detects that the deletion operation triggered by the user indicates deleting the text "thinking of being a housewife" in line 2612, the electronic device can determine that the first group of text includes: the text 26111 in line 2611, the text 26122 in line 2612, and the text 26132 in line 2613. The electronic device can determine that the second group of text includes: the text 261211 in line 2612 and the text 26131 in line 2613. The electronic device can perform the same translation operation on the first group of text as in the typesetting animation effect 1. The second group of text disappears from the initial position at the moment when the first group of text starts to be translated and appears at the right end of the initial state of the upper line of text, but the transparency is 100%. Subsequently, the second group of text is translated together with the first group of text until reaching the respective final positions of the two groups of text. During the translation process, the transparency of the second group of text gradually decreases from 100% to 0%.

[0398] As an example, in the deletion operation scenario, the typesetting animation effect 4 can be adopted to generate a typesetting animation effect for the handwritten note.

[0399] 5. Typesetting Animation Effect 5: Translation + Displacement + Gradient

[0400] Taking the insertion operation as an example, when an electronic device detects an insertion operation, it divides the text in the paragraph indicated by the insertion operation into two groups. The first group consists of text whose initial and final positions are on the same line. The second group consists of text whose initial and final positions are not on the same line.

[0401] like Figure 27 As shown, the electronic device displays as follows Figure 27 The handwritten note interface 270 is shown in (a). This handwritten note interface 270 includes a paragraph 271 containing a line of text, such as line 2711. Suppose a user triggers an insertion operation in line 2711, with the insertion position between the text "position" 2712 and "home" 2713. The electronic device can then respond to the insertion operation and determine the final position of the text in paragraph 271 after reformatting.

[0402] For the electronic device, it can determine that the text 2710 before the insertion position is text that does not need to be moved. The text 2715 after the insertion position is text to be moved. Since there is only one line in this paragraph 271, the electronic device can use the above scheme to determine to insert a blank area 2713 of a first preset length in line 2711. Therefore, the electronic device can determine that the text 2715 only needs to be moved to the right by the first preset length in line 2711. After inserting the blank area 2713, if the electronic device is based on the typed handwritten notes, it determines that after the text 2715 is moved to the right by the first preset length, it is still in line 2711. Therefore, the electronic device can determine that both the text 2715 and the blank area 2714 are in line 2711. Then, the electronic device can determine that both the text 2715 and the blank area 2714 are the first group of text. The electronic device can translate the text 2715 from its initial position to its final position based on the translation operation of the difference. The blank area 2714 gradually appears at the insertion position when the text 2715 begins to be translated. As the text 2715 moves, the length of the blank area 2714 gradually increases, as... Figure 27 As shown in (b) and (c) in the diagram. Finally, as text 2715 moves to its final position, the length of the blank area 2714 increases to the first preset length, as shown in the diagram. Figure 27 As shown in (d) in the figure.

[0403] like Figure 28 This demonstrates another animation effect in the insertion operation scenario, such as... Figure 28 As shown, the electronic device displays as follows Figure 28The handwritten note interface 280 shown in (a) of []. The handwritten note interface 280 includes a paragraph 281 and a paragraph 282. The paragraph 282 is located on the right side of the paragraph 281. There is a line of text in the paragraph 281, such as line 2811. Assume that the user triggers an insertion operation in the line 2811, and the insertion position where the insertion operation acts is between the characters "位" 28111 and "家" 28112. At this time, for the electronic device, it can determine that the text 28110 located before the insertion position is the text that does not need to be moved, and the text 28113 located after the insertion position is the text that needs to be moved. Since the text 28113 needs to be moved to the next line, the electronic device can determine that the text 28113 is the second group of text, and regard the blank area 2814 to be inserted as the first group of text. The second group of text disappears from its initial position at the moment when the first group of text starts to translate and appears at the left end of the initial state of the next line of text, but the transparency is 100%. Since there is only one line in the paragraph 281, but inserting a blank area will encounter the paragraph 282, the electronic device can adopt the above scheme to determine to insert a blank area 2814 with a first preset length in the line 2811, and automatically wrap the line in response to the insertion operation, move the text 28113 to the line 2812, and the transparency of the text 28113 in the line 2812 is 100%, that is, the user cannot see the text 28113, as shown in Figure 28 (b) of []. The electronic device can translate the text 28113 from the initial position (i.e., the position of the text 28113 in the line 2811) to the final position (i.e., the position of the text 28113 in the line 2812) based on the translational operation of the difference. During the process of the electronic device moving the text 28113, the electronic device simultaneously moves the blank area 2814, that is, the blank area 2814 and the text 28113 move together, and the transparency of the text 28113 gradually decreases during the movement, that is, the blank area 2814 gradually becomes visible in the interface from being invisible in the interface, as shown in Figure 28 (c) of []. In addition, comparing Figure 28 (c) and (d) of [], it can be seen that during the movement, the length of the blank area 2814 gradually increases to the first preset length. As shown in Figure 28 (d) of []. When the blank area 2814 and the text 28113 are both in their final positions, the length of the blank area 2814 is the first preset length, and the transparency of the text 28113 is 0%, that is, at this time the user can clearly see the text 28113. It can be understood that the transparency of the text 28113 is the same as that of other texts in the line.

[0404] It can be understood that in the scenario of performing a deletion operation / insertion operation, the electronic device can follow as shown in Figures 23-27The animation shown moves the text in the handwritten note. When the text reaches its final position, the electronic device can automatically adjust the position of the text within paragraph 231 and display the adjusted handwritten note interface. Alternatively, when the text reaches its final position, the electronic device can adjust the position of the text within the paragraph based on a user-triggered editing operation, such as the user clicking control 405.

[0405] It is worth noting that when performing insertion or deletion operations, the number of characters in the lines involving text movement may change. Therefore, after the text has been moved to its respective final position, when adjusting the position of the text in the lines involving text movement, the number of characters in each line after the movement should be used as the reference.

[0406] It's worth noting that in scenarios triggered by deletion, the following situations may occur: the user instructs to delete one or more texts, but the user does not want other texts to move to the area containing the deleted text. To improve the user experience, when the electronic device detects a deletion operation, it can also output a prompt message asking the user whether to move the other texts. If the user confirms moving the other texts, then... Figures 23-28 The animation shown depicts the movement of text in a handwritten note. Alternatively, it can control the text on an electronic device to move as shown in the image. Figures 23-28 After the animation shown reaches its final position, if the electronic device detects the user's action on the undo control in the handwriting note interface, the electronic device will respond to the user's undo action, restoring all the moved text to its original position and displaying the text as shown. Figure 27 The interface shown in (d) is shown in the image.

[0407] 6. Layout Animation 6: Translation + Displacement + Gradient + Non-Editable Paragraph Movement

[0408] During typesetting, text within edited paragraphs can move, as can text within non-edited paragraphs. When an inserted paragraph extends downwards, if other paragraphs exist below it and the spacing between them is less than the height of the edited line, those paragraphs will also move downwards.

[0409] like Figure 29 As shown in (a), the handwritten notes displayed on the note-taking interface 290 of the electronic device include paragraphs 291 and 292. Paragraph 292 is located below paragraph 291. Paragraph 291 includes lines 2911, 2912, and 2913. Assume the user is... Figure 29The insertion operation is triggered at position (a) in the diagram. Since paragraph 292 is below paragraph 291, the electronic device can determine that a whole line should be inserted at the insertion position, and that text 29131 is the text that needs to be moved to the next line. Assuming the paragraph spacing between paragraph 292 and paragraph 291 is less than the line spacing of paragraph 291, the electronic device can also determine that paragraph 292 is the paragraph that needs to be moved. Therefore, text 29131 and paragraph 292 can be moved during the insertion operation. For example, during the movement, the electronic device can move text 29131 to its final position on the next line and display it with 100% transparency at the start of the movement. During the movement, if... Figure 29 As shown in (b), the transparency of text 29131 gradually decreases, and paragraph 292 gradually moves downwards. At the end of the movement, as... Figure 29 As shown in (c), text 29131 is in its final position with 0 transparency, and paragraph 292 is moved to a position where the paragraph spacing between paragraph 292 is greater than or equal to the preset line spacing.

[0410] like Figure 30 As shown in (a), the handwritten notes displayed on the note-taking interface 300 of the electronic device include paragraphs 301 and 302. Paragraph 302 is located below paragraph 301. Paragraph 301 includes lines 3011, 3012, 3013, and 3014. Assuming that line 3013 is the inserted blank area, and assuming the user fills line 3013 with text, such as... Figure 30 As shown in (a), when the electronic device determines to continue inserting blank areas, it can automatically wrap lines, moving text 30141 to line 3015. As an example, the electronic device can first move text 30141 to line 3015 and set its transparency to 100%, then insert blank area 30142 in line 3014, with blank area 30142 having 100% transparency in line 3014, and paragraph 302 gradually moving downwards. During the movement, the transparency of blank area 30142 and text 30141 gradually decreases, as... Figure 29 As shown in (b) above. At the end of the movement, text 30141 is located in line 315 with 0 transparency, and a blank line 30142 is inserted in line 3014. Paragraph 302 moves to a position where the paragraph spacing between it and paragraph 301 is greater than or equal to the preset line spacing.

[0411] like Figure 31 As shown in (a), the handwritten notes displayed on the note-taking interface 310 of the electronic device include paragraphs 301 and 302. Paragraph 302 is located below paragraph 301. Paragraph 301 includes lines 3113, 3114, and 3115. Assuming the user does not fill line 3014 with text, such as... Figure 31As shown in (a), when the electronic device determines that the user area is exiting the insertion, the electronic device can move text 31151 from line 3115 to the remaining area in line 3014. As an example, the electronic device can first move text 30151 to the remaining area in line 3014 and set the transparency of text 31151 to 100%. During the movement, the transparency of text 30151 gradually decreases, and paragraph 312 gradually moves upwards, as... Figure 31 As shown in (b) above. At the end of the movement, text 30151 is located in line 3015 and has an opacity of 0. Paragraph 302 moves to a position where the paragraph spacing between it and paragraph 301 is greater than or equal to the preset line spacing.

[0412] like Figure 32 As shown, Figure 32 This application provides a flowchart illustrating a method for editing handwritten notes, the method comprising:

[0413] Step 3201: The electronic device displays the note-taking interface on the screen.

[0414] For example, the note-taking interface displays handwritten notes, which include one or more paragraphs.

[0415] For example, such as Figure 7 As shown, electronic devices can display, for example... Figure 7 The handwritten note interface 71 shown in (a) is shown in the image. Or, as shown in the image... Figure 10 As shown, electronic devices can display, for example... Figure 10 The handwritten note interface 101 shown in (a) is shown in the figure.

[0416] As an example, electronic devices can display things like Figure 4 The interface shown in (b) is then accessed by the user, who clicks on New Control 44 to trigger the electronic device to display, as shown in [image / description]. Figure 4 The interface shown in (c) is as follows: Figure 4 In the interface shown in (c), the electronic device can respond to the user using a finger or stylus as input to write handwritten notes in the handwriting area 401 to obtain the handwriting note interface 101 or the handwriting note interface 71. Therefore, the note interface displayed by the electronic device can be the notes that the user is currently writing in the handwriting area.

[0417] As another example, electronic devices can display such as Figure 4 The interface shown in (b) then triggers an open operation on the user's previously handwritten notes 42, thereby triggering the electronic device to display the following: Figure 7 The handwritten note interface 71 shown in (a) is shown in the image. Or, as shown in the image... Figure 10 The handwritten note interface 101 shown in (a) is shown in the figure.

[0418] Step 3202: The electronic device receives editing instructions for handwritten notes applied to the note-taking interface.

[0419] As an example, users can click on things like... Figure 4 The adaptive editing control 404 in the interface shown in (d) triggers the electronic device to detect the editing command.

[0420] As another example, editing commands can also be specific gestures that users input on the note-taking interface for the paragraph to be edited. For example, users can perform a long press, double-tap, delete, or insert operation on the paragraph to be edited.

[0421] For example, such as Figure 7 As shown in (b), the user can long press the paragraph to be edited to trigger the electronic device to display pop-up window 724. In pop-up window 724, the electronic device can click any of the following controls: "One-click adjustment", "Adjust abnormal line angle", "Adjust vertical position", and "Adjust text spacing" to trigger the electronic device to detect the editing command.

[0422] Step 3203: In response to the editing command, the electronic device performs at least one of the following actions: identifying lines with abnormal angles within the first paragraph, identifying text with abnormal vertical positioning within the first paragraph, and identifying text with abnormal text spacing within the first paragraph.

[0423] The first paragraph refers to one or more paragraphs that the editing command instructs you to edit. For example, such as... Figure 7 As shown, if the electronic device detects an editing command triggered by the user for paragraph 72, then paragraph 72 becomes the first paragraph. If the electronic device detects editing commands triggered by the user for paragraphs 72 and 73 in the handwritten notes, then the first paragraph includes paragraphs 72 and 73. For example, the user first selects paragraphs 72 and 73, and then clicks the adaptive editing control 404 or clicks the "One-Click Adjustment" control in the displayed pop-up window, thus causing the electronic device to detect the editing command. Or as... Figure 7 As shown, suppose the user clicks on... Figure 7 If the "One-Click Adjustment" control shown in (b) is used, then the first paragraph can include all paragraphs in the handwritten notes or all paragraphs currently displayed on the interface.

[0424] For information on how electronic devices can identify lines with abnormal angles within paragraphs, please refer to [link / reference]. Figure 6 The description in [the document] regarding how electronic devices identify text with abnormal vertical positioning within paragraphs can be found in [the document]. Figure 9 The description in [the document] regarding how electronic devices identify text with abnormal vertical positioning within paragraphs can be found in [the document]. Figure 12The description in the text will not be repeated here.

[0425] If the electronic device detects that the editing command triggered by the user is a deletion or insertion operation, the electronic device can identify lines with abnormal angles, text with abnormal vertical positions, and text with abnormal spacing in the first paragraph.

[0426] If the electronic device detects that the user-triggered editing command is to adjust the line with an abnormal angle, such as clicking the "adjust line with abnormal angle" control, then the electronic device will identify the line with an abnormal angle in the first paragraph.

[0427] If the editing command triggered by the electronic device is to adjust the vertical position of text, such as clicking the "Adjust Vertical Position" control, then the electronic device will recognize text with abnormal vertical position in the first paragraph.

[0428] If the editing command triggered by the electronic device is to adjust the text spacing, such as clicking the "Adjust text spacing" control, then the electronic device will recognize text with abnormal text spacing in the first paragraph.

[0429] Understandably, if there are lines with abnormal angles, text with abnormal vertical positions, or text with abnormal spacing in the first paragraph, the electronic device can execute steps 3204 to 3206 below.

[0430] If there are lines with abnormal angles and text with abnormal vertical positions in the first paragraph, but no text with abnormal spacing, then the electronic device can execute steps 3204 to 3205, but not step 3206.

[0431] If there are lines with abnormal angles and text spacing in the first paragraph, but no text with abnormal vertical positioning, then the electronic device can execute steps 3204 and 3206 below, but not step 3205.

[0432] If there are characters with abnormal vertical positioning and abnormal character spacing in the first paragraph, but no lines with abnormal angles, then the electronic device can execute steps 3205 and 3206 below, but not step 3204.

[0433] Step 3204: The electronic device rotates an abnormal angle within the first segment.

[0434] Specifically, an angle-abnormal behavior refers to a line within the first paragraph whose angle difference from the first paragraph is greater than or equal to an angle difference threshold. For example, an electronic device can rotate any line in a paragraph with an angle-abnormal behavior so that the angle of the rotated line is the same as the angle of the paragraph containing the line with the angle-abnormal behavior, thus obtaining an edited handwritten note.

[0435] Step 3025: The electronic device adjusts the position of the text with abnormal vertical position in the first paragraph so that the first distance between the text in the first line of the first paragraph and the line center line of any line is within the preset distance threshold range.

[0436] For example, text whose vertical position is abnormal after adjustment can be considered to be within a preset distance range if the first distance between it and the center line of its line meets the following requirement: dist(P ij , l i )≥A i1 and / or dist(P) ij , l i )≤A i2 , where dist(P ij , l i A represents the first distance from the center of the j-th first character in the i-th row to the center line of the i-th row. i1 A represents the first distance threshold of the i-th row. i2 The second distance threshold represents the i-th row, and the first distance threshold and / or the second distance threshold are determined by the average distance of all characters in the i-th row to the center line of the i-th row, wherein the first distance threshold is less than the second distance threshold.

[0437] As an example, suppose that if the first distance of a certain character from the line center line is less than or equal to a fourth distance threshold or a first distance threshold, then the character is considered to be in an abnormal vertical position. In this case, the electronic device can move the character away from the line center line so that, after the movement, the first distance of the character from the line center line is greater than or equal to the first distance threshold. Alternatively, suppose that the first distance of a certain character from the line center line is greater than or equal to a third distance threshold or a second distance threshold. In this case, the electronic device can move the character closer to the line center line so that, after the movement, the first distance of the character from the line center line is less than or equal to the second distance threshold, thereby placing the character in an abnormal vertical position within a preset distance threshold range.

[0438] The first row contains text that is not in the correct vertical position.

[0439] Step 3025 ensures that there are no abnormally positioned characters within the adjusted first paragraph; that is, no characters too close to or too far from the line center line. This ensures that the distance from any line of text within the first paragraph to the line center line is within a preset distance threshold, thus making the overall position of the text within the first paragraph relatively uniform. For the process of how electronic devices adjust the position of abnormally positioned characters within the first paragraph, please refer to [reference needed]. Figure 9 The embodiments shown are not described in detail here.

[0440] Step 3026: The electronic device adjusts the spacing between the characters in the line containing the first character in the first paragraph so that the spacing between the characters in the line containing the first character in the first paragraph is within the preset spacing range, so as to obtain the edited handwritten notes.

[0441] The first character refers to the text in the first paragraph with abnormal left and right spacing.

[0442] For example, an electronic device can adjust the text in the first line of the first paragraph until the spacing between adjacent text in that line satisfies the following formula, thus ensuring that the spacing between text in the first line of the first paragraph is within a preset range: dist(P ij ,P ij+1 ,l i )>y and / or dist(P ij ,P ij+1 ,l i ) < m. y represents the first spacing threshold, and m represents the second spacing threshold.

[0443] It is worth noting that, for electronic devices, when they detect text with abnormal left and right spacing in a certain line, the electronic devices can adjust the spacing of the text in that line as a whole, so that the spacing between the text in the whole line after adjustment is greater than or equal to a first spacing threshold, or so that the spacing between the text in the whole line after adjustment is equal to the average spacing of the line, or the difference between the spacing and the average spacing is less than or equal to a preset difference. This application embodiment does not limit this.

[0444] Step 3207: The electronic device displays the edited handwritten notes.

[0445] like Figure 33 As shown, Figure 33 A flowchart illustrating another method for editing handwritten notes provided in this application embodiment, the method comprising:

[0446] Step 3301: The electronic device displays the note-taking interface on the screen.

[0447] For example, the notes interface displays handwritten notes. Handwritten notes consist of one or more paragraphs.

[0448] For example, electronic devices can display things like Figure 18 or Figure 20 The interface shown in (a) is shown in the image.

[0449] Step 3302: The electronic device receives editing instructions for handwritten notes applied to the note-taking interface.

[0450] As an example, the editing instruction could be an operation that instructs the deletion of text in the first paragraph of one or more paragraphs, such as... Figure 18 The instruction shown in (b) is to delete the text 18111.

[0451] As another example, the editing instruction could be an operation that instructs the insertion of content at a certain position within the first paragraph, such as... Figure 20 The insertion operation is shown in (a) above.

[0452] If the editing command is a deletion operation, the electronic device performs the following steps 3303 to 3305.

[0453] If the editing command is an insert operation, the electronic device performs the following steps 3306 to 3324.

[0454] Step 3303: In response to the editing instruction, delete the text to be deleted from the first paragraph as instructed by the editing instruction, and reformat the first paragraph to determine the formatted handwritten notes.

[0455] If text is deleted from a line, simply deleting the text edited by the command will result in blank areas in the first paragraph if no reformating is performed. Reformating can move the text following the deleted text into the blank areas to improve neatness.

[0456] Optionally, the electronic device can also reformat the first paragraph in response to editing instructions to obtain a reformatted handwritten note. During reformatization, text that typically precedes the deleted text (i.e., text on the same line as the deleted text and to the left of the first of the deleted text or text) does not need to be moved. However, text on the same line as the deleted text and to the right of the last deleted text, and text in the first paragraph that lies one or more lines below the deleted text, need to be moved. For ease of description, the text involved in the movement will be referred to as the text to be moved.

[0457] Therefore, after deleting the deleted text, the electronic device can reformat the first paragraph to determine the final position of the text to be moved in the reformatted handwritten note. Then, based on the initial position of the text to be moved and its final position in the reformatted handwritten note, the electronic device divides the text to be moved into two groups: the first group and the second group. The first group consists of text in the first paragraph whose initial position before moving and final position after moving are on the same line. The second group consists of text in the first paragraph whose initial position before moving and final position after moving are not on the same line.

[0458] Step 3304: The electronic device moves the text to be moved from its initial position to its final position according to the final position of the text to be moved in the typed handwritten notes.

[0459] It's worth noting that the initial position refers to the location of a particular character in the handwritten notes before typesetting. The final position can be understood as the location of a particular character in the handwritten notes after typesetting.

[0460] If the position of a certain character in the handwritten notes before typesetting (i.e., the initial position) is different from the position of the character in the handwritten notes after typesetting (i.e., the final position), then the character is to be moved. In other words, the character to be moved can refer to the character in the handwritten notes whose initial position and final position are different.

[0461] As an example, for an electronic device, the first group of text and the second group of text can be moved from their respective initial positions to their respective final positions and displayed.

[0462] As an example, electronic devices can be configured as follows: Figure 23 , Figure 24 , Figure 25 , Figure 26 The layout animation shown moves the first and second groups of text, which will not be described in detail here.

[0463] Understandably, suppose the editing command instructs the deletion of text from a single line in the first paragraph, and this is the only line in the first paragraph. In this case, the electronic device can determine that the formatted handwritten notes only include the first set of text. Therefore, for the electronic device, it can proceed as follows: Figure 23 , Figure 24 , Figure 25 , Figure 26 The layout animation shown moves the first group of text, which will not be described in detail here.

[0464] Step 3305: The electronic device displays the formatted handwritten notes.

[0465] It is worth noting that as the electronic device moves the first and second groups of text according to the layout animation, the user can observe the movement of the first and second groups of text using the layout animation.

[0466] Step 3306: In response to the editing command, determine whether there is a second paragraph below the first paragraph.

[0467] If there is no second paragraph below the first paragraph, the electronic device performs the following steps 3307 to 3319 to insert a blank area in the first paragraph.

[0468] If a second paragraph exists below the first paragraph, the electronic device performs steps 3320 to 3324 as follows.

[0469] Step 3307: If there is no second paragraph below the first paragraph, determine the line number of the first paragraph.

[0470] When the first paragraph is a single line, the electronic device performs the following steps 3308 to 3314. When the first paragraph is multiple lines, the electronic device performs the following steps 3315 to 3319.

[0471] Step 3308: When the number of lines in the first paragraph is a single line, the electronic device determines to insert a first blank area of a first preset length in the first paragraph starting from the insertion position indicated by the editing instruction, and re-typesets the first paragraph to obtain a typeset handwritten note.

[0472] Among them, the typeset handwritten note includes the position of the first blank area in the first paragraph, the position of the text before the first blank area, and the position of the text after the first blank area.

[0473] It can be understood that when the number of lines in the first paragraph is a single line, the text after the first blank area refers to the text that is on the same line as the first blank area after moving and the text that is on a different line from the first blank area after moving.

[0474] It can be understood that if the insertion position indicated by the editing instruction is between two texts in the same line, as shown in Figure 20 Figure (a) below, when inserting a blank area of the first preset length, the electronic device needs to move the text after the insertion position (hereinafter referred to as the text to be moved) to the right. As shown in Figure 20 Figure (b) below, the text "Silk Road" is the text that needs to be moved. Specifically, the moving distance of the text to be moved is the first preset length.

[0475] It should be noted that if, after inserting a blank area of the first preset length in a certain line, the remaining length within the line is sufficient to accommodate the text to be moved, then the text to be moved still remains in the same line after moving to the right by the first preset length, as shown in Figure 20 Figure (b) below. If the remaining length within the line is not sufficient to accommodate the text to be moved or can only accommodate some of the text to be moved, then the electronic device can move the text to be moved to the next line, or move other text of the text to be moved to the next line, as shown in Figure 20 Figures (c) and (d) below. For example, the text "Silk" still remains in line 2011 after moving, while the text "Road" is moved to the next line 2012.

[0476] When an electronic device needs to move text after its insertion point, it can use preset layout animations to move the text to its final position and display it, allowing users to quickly locate the correct text after layout. For example, the device can divide the text into two groups: a first group and a second group. The first group consists of text within the first paragraph whose initial and final positions are on the same line. The second group consists of text within the first paragraph whose initial and final positions are not on the same line. It's understandable that the device can perform different or the same movement operations on both groups. For instance, it could perform a translation operation on both the first and second groups, as described in layout animation 1 above. Alternatively, when performing a translation operation on the first group of text, the electronic device can move the second group of text in the following ways: 1) The second group of text disappears at the moment the first group of text begins to translate, and then at the moment the translation ends (i.e., when the first group of text reaches its final position), the second group of text reappears at its final position, i.e., the above-mentioned layout animation 2. 2) The second group of text disappears from its initial position at the moment the first group of text begins to translate and appears at its final position, but with 100% transparency. As the first group of text translates, the transparency of the second group of text gradually decreases, reaching 0% at the end, i.e., the above-mentioned layout animation 3. 3) The second group of text disappears from its initial position at the moment the first group of text begins to translate and appears at the left end of the initial state of the next line of text, but with 100% transparency. Subsequently, the second group of text translates together with the first group of text until both groups of text reach their respective final positions. During the translation process, the transparency of the second group of text gradually decreases from 100% to 0%, i.e., the above-mentioned layout animation 5.

[0477] It is worth noting that electronic devices can treat the blank area to be inserted as the first group of text.

[0478] It is worth noting that during the typesetting process, the first paragraph may contain both a first group of text and a second group of text simultaneously, such as... Figure 28 As shown. It's also possible that only the first group of characters exists, and the second group does not, such as... Figure 27 As shown, when the electronic device decides to insert blank area 2714, since both blank area 2714 and text 2715 belong to the first group of text, the electronic device can use the following method: Figure 27 The layout animation shown moves the first group of text.

[0479] Step 3309: The electronic device moves the inserted first blank area of ​​the first preset length and the text to be moved in the first paragraph to their respective final positions using preset layout animation effects and displays them.

[0480] As an example, an electronic device can display the position change trajectory of the first blank area and the text to be moved on the interface according to any of the movement animations shown in Layout Animation 1 to Layout Animation 3, Layout Animation 5 or Layout Animation 6. This application embodiment does not limit this.

[0481] It is worth noting that after the electronic device responds to the user's editing instruction and inserts a first blank area of ​​a first preset length, the user can continue to write text in the first blank area. For example, the user can input text using a keyboard or by using a finger or stylus. This application embodiment does not limit this.

[0482] Since the first paragraph is a single line, the length of the first blank area inserted by the electronic device in response to the editing command is a first preset length. This first preset length is less than the total length of the line where the insertion point is located. Therefore, the length of the inserted first blank area may not meet the user's needs. In this case, the user can trigger some preset gesture operations on the displayed interface to prompt the electronic device to continue inserting. For example, the user can double-click on the first blank area to trigger the electronic device to detect the continued insertion operation, thereby continuing to insert a first blank area of ​​the first preset length.

[0483] It is understandable that after the electronic device inserts a first blank area of ​​a first preset length in response to the user's editing instruction, if the user needs to undo the inserted first blank area, the user can trigger an undo operation, causing the electronic device to delete the first blank area in response to the undo operation. It is worth noting that, upon detecting an undo operation, the electronic device can also restore the text to its original position. For example, the user can click the "undo control" to trigger an undo operation, or the undo operation can be a specific gesture input by the user on the displayed interface; this embodiment does not limit this.

[0484] Step 3310: The electronic device displays the formatted handwritten notes.

[0485] The formatted handwritten notes include a first blank area, and the text to be moved is located in its corresponding final position.

[0486] Step 3311: In response to the trajectory written by the user in the first blank area, insert the content written by the user in the first blank area.

[0487] Step 3312: The electronic device detects the content inserted by the user in the first blank area.

[0488] Step 3313: If the inserted content occupies more than the first threshold in the first blank area, then continue to insert a first blank area of ​​the first preset length in the first paragraph.

[0489] It is worth noting that even when inserting the first blank area of ​​the first preset length, the electronic device still needs to move the position of the text to be moved, such as... Figure 20 As shown in (c) and (d) in the figure.

[0490] As an example, if the inserted content occupies more than a first threshold in the first blank area, the electronic device can automatically trigger the action of continuing to insert a first blank area of ​​a first preset length, or the electronic device can output a prompt message to ask the user whether to continue inserting blank areas. If the electronic device detects the user's instruction to continue inserting blank areas, it will continue to insert a first blank area of ​​a first preset length in the first paragraph to obtain the formatted handwritten notes. If the electronic device detects the user's instruction to stop inserting blank areas, it will not continue to insert a first blank area of ​​a first preset length in the first paragraph, even if the inserted content occupies more than the first threshold.

[0491] As another example, if the inserted content occupies more than a first threshold in the first blank area, and the electronic device detects a specific gesture operation triggered by the user, it will continue to insert a first blank area of ​​a first preset length in the first paragraph to obtain the typed handwritten notes.

[0492] It is worth noting that, if the electronic device determines that the inserted content occupies more than a first threshold area within the first blank area, and the user continues to input within the first blank area using a finger or stylus, then it will continue to insert a first blank area of ​​a first preset length into the first paragraph. If, however, the electronic device determines that the inserted content occupies more than the first threshold area within the first blank area, and no further input is detected from the user using a finger or stylus within the remaining area of ​​the first blank area within a preset time, then the electronic device does not need to continue inserting the first blank area of ​​a first preset length, and it can also move any text following the first blank area to the remaining area.

[0493] In practice, the following situation may also occur: after the electronic device displays step 3310, if the content written by the user in the first blank area does not fill the first blank area, that is, there is still a remaining blank area in the first blank area, then the electronic device can execute the following step 3314 so that there is no remaining blank area in the first paragraph.

[0494] Step 3314: Upon detecting a writing completion instruction, the electronic device responds to the writing completion instruction by reformatting the formatted handwritten notes and moving the text to be moved in the first paragraph based on the reformatted notes, so that the remaining blank area is filled with text.

[0495] It is worth noting that the writing completion instruction can be a user's operation on the confirmation control, a specific gesture operation entered in the handwriting note interface, or the user's input operation in the first blank area not being detected within a preset time, or the user's input operation in other paragraphs or other positions being detected. This application embodiment does not limit this.

[0496] For example, such as Figure 34 As shown in (a), in the case that the first paragraph has a single line, it is assumed that the electronic device inserts a blank area 34111 in line 3411 of the first paragraph in response to an insertion operation. Then, as... Figure 34 As shown in (b), the user can write the content to be inserted in the blank area 34111. Suppose that the user has finished inserting the content they want in the blank area 34111, but there is still a part of the blank area 34111 that is not filled, namely the remaining blank area 34113. Therefore, the electronic device can move the text 34112 toward the remaining blank area 34113 so that some or all of the text in the text 34112 is located in the remaining blank area 34113.

[0497] It is worth noting that if the inserted blank area is not filled with text, the electronic device can respond to the operation and delete the remaining blank area. Therefore, the actions of moving the text after the remaining blank area can refer to the relevant steps of the deletion operation mentioned above, which will not be repeated here.

[0498] Step 3315: If the first paragraph consists of multiple lines, in response to the editing command, insert a third blank area of ​​the second preset length from the insertion position indicated by the editing command, and reformat the first paragraph to obtain the formatted handwritten notes.

[0499] It's worth noting that if the first paragraph consists of multiple lines, and the insertion point is between two characters on the same line, then... Figure 20 As shown in (b), when the electronic device inserts a full row of blank area 2031 (i.e., the third blank area) from the insertion position, this blank area 2031 includes not only the blank area in row 2011 but also the blank area in row 2012. It is understood that, in cases such as... Figure 21 In the scenario shown, the electronic device needs to move the text 20113 from line 2011 to line 2012, and then move all the text in line 2012 to line 2013.

[0500] Step 3316: The electronic device moves the inserted third blank area of ​​the second preset length and the text to be moved in the first paragraph to their respective final positions using preset layout animation effects and displays them.

[0501] Step 3317: After inserting the third blank area, the electronic device responds to the handwritten trace entered by the user in the third blank area and inserts content in the third blank area.

[0502] It is worth noting that after inserting the third blank area, the following scenario may occur: the length of the inserted third blank area is too long, and the content that the user intends to insert in the third blank area is insufficient to fill the third blank area, that is, there is a remaining blank area in the third blank area, resulting in unwritten blank areas in the handwritten notes, which leads to poor overall readability. In this case, the user can trigger the completion operation, so that the electronic device responds to the completion operation and moves the text located after the third blank area, so that the text located after the third blank area moves to the remaining blank area.

[0503] For example, completing an operation could be triggered by the electronic device to activate a "confirm" control, or it could be a preset gesture entered by the user in the handwriting note-taking interface, such as crossing out the remaining blank area. Alternatively, completing an operation could be triggered by the electronic device detecting the user's handwriting traces on other lines.

[0504] For example, such as Figure 35 As shown in (a), assuming the electronic device responds to a user's insertion operation by inserting a third blank area from row 3511 starting from the insertion position, this third blank area includes blank area 35111 in row 3511 and blank area 35120 in row 35121, then, as Figure 35 As shown in (b), the electronic device inserts text in the third blank area in response to the user's handwriting trajectory. If the user confirms the insertion is complete, the user can click the "confirm" control on the handwriting note page, or the electronic device can detect an editing or writing operation triggered by the user elsewhere, thus triggering the electronic device to detect the completion operation. In response to the completion operation, the electronic device can move text 35122 in line 3512 and text 35131 in line 3513. For example, as... Figure 35 As shown in (c), the electronic device moves part of the text 35122 in line 3512 to the remaining blank area, and moves text 35132 to line 3412 and places it after text 35122.

[0505] Step 3318: The electronic device detects the content inserted by the user in the third blank area.

[0506] Step 3319: If the inserted content occupies more than the first threshold in the third blank area, then continue to insert a third blank area of ​​the second preset length in the first paragraph.

[0507] This process can be referred to in step 3313 above, and will not be repeated here.

[0508] Step 3320: If a second paragraph exists below the first paragraph, determine the paragraph spacing between the first and second paragraphs.

[0509] Step 3321: If the paragraph spacing is greater than or equal to the line height of the first paragraph, reformat the first paragraph to obtain the reformatized handwritten notes.

[0510] The formatted handwritten notes include a pre-defined blank area inserted in the first paragraph, starting from the first position, and the positions of each character in the first paragraph after the blank area is inserted. This process can be referred to step 3308 in the above embodiment, and will not be repeated here.

[0511] It is understandable that if the paragraph spacing is greater than or equal to the minimum, average, or maximum line height of the first paragraph, it means that inserting a blank area of ​​a preset length in the first paragraph will not cause the text in the first paragraph to overlap with the text in the second paragraph. Therefore, a blank area of ​​a preset length can be inserted in the first paragraph.

[0512] Step 3322: The electronic device moves the inserted blank area of ​​a preset length and the text to be moved in the first paragraph to their respective final positions using preset layout animation effects and displays them.

[0513] This process can refer to step 3309 in the above embodiments, and will not be repeated here.

[0514] It is understandable that if a second paragraph exists below the first paragraph, and the first paragraph contains a single line, then step 3321 can refer to the implementation of step 3308, which will not be repeated here. If the first paragraph contains multiple lines, then step 3321 can refer to the implementation of step 3315, which will not be repeated here.

[0515] Step 3323: If the paragraph spacing is less than the line height of the first paragraph, the electronic device also needs to reformat the first and second paragraphs to obtain the reformatted handwritten notes.

[0516] It is worth noting that the formatted handwritten notes indicate the final position of the second paragraph, as well as the position of the preset length of blank space and the position of the text in the first paragraph.

[0517] Step 3324: Based on the final position of the second paragraph of the formatted handwritten notes, the final position of the blank area, and the final position of the text to be moved, the electronic device controls the second paragraph, the blank area, and the text to be moved to move from their initial positions to their final positions, and then displays them. For a detailed explanation, please refer to... Figure 30 The embodiments shown are not described in detail here.

[0518] Specifically, the electronic device also controls the second paragraph to move away from the first paragraph so that the spacing between the first and second paragraphs is greater than or equal to the line height of the first paragraph.

[0519] It is worth noting that after executing step 3324, assuming the content inserted by the user does not fill the blank area, the electronic device can proceed as follows: Figure 31 The handwritten notes are resized as shown, and the final edited handwritten notes are displayed.

[0520] It is worth noting that, in the above embodiments, the following is used: Figure 32 and Figure 33 Described for individual embodiments, it is worth noting that when the editing command is a deletion or insertion operation, the electronic device, in addition to formatting the first paragraph, can also reference the position of the text in the first paragraph as shown in the example. Figure 32 Adjust the position as shown.

[0521] The handwritten note editing method provided in this application allows an electronic device to respond to user-inputted editing commands for a specific paragraph in a handwritten note when using a note-taking app. The device then adjusts the text positions within the first paragraph according to the commands, ensuring that the angle of any line within the first paragraph is consistent with the paragraph's angle, or that the vertical position of any line within the first paragraph is consistent (i.e., there are no characters with abnormal vertical positions), or that the spacing between any line of text is consistent (i.e., there are no characters with abnormal spacing within the first paragraph). This method results in a neat and aesthetically pleasing arrangement of text in the edited handwritten note. This method helps users use note-taking apps more conveniently, easily organize notes, and conforms to user habits, thereby improving user efficiency and enhancing the user experience.

[0522] Based on the above embodiments, this application also provides an electronic device, which includes multiple functional modules; the multiple functional modules interact to realize the functions performed by the electronic device in the methods described in the embodiments of this application. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations. For example, [the following is an example of implementation details]. Figure 32Steps 3201 to 3207 are performed by the electronic device in the illustrated embodiment. Or as... Figure 33 Steps 3301 to 3324 are performed by the electronic device in the illustrated embodiment.

[0523] It is understood that, in order to achieve the functions of any of the above embodiments, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0524] This application embodiment can divide electronic devices into functional modules. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0525] For example, when dividing functional modules in an integrated manner, such as Figure 36 The diagram shown is a structural block diagram of an electronic device provided in an embodiment of this application. Figure 36 As shown, the electronic device may include a display unit 3610, a receiving unit 3620, and an adjustment unit 3630.

[0526] The display unit 3610 supports the display of handwritten notes or adjusted handwritten notes on the electronic device. The receiving unit 3620 receives editing instructions input by the user to the electronic device, such as deletion or insertion operations. The adjusting unit 3630 adjusts the text position within the first paragraph to obtain the edited handwritten notes, or at least reformatts the first paragraph to obtain the reformatted handwritten notes.

[0527] As an example, the display unit 3610 described above can be as follows: Figure 2 The display screen shown, adjustment unit 3630 and receiving unit 3620 can be integrated into such a device. Figure 2 In the processor shown.

[0528] Figure 37This is a schematic diagram of the structure of chip 370 provided in an embodiment of this application. Chip 370 includes one or more (including two) processors 3710 and communication interfaces 3730.

[0529] Optionally, the chip 370 also includes a memory 3740, which may include read-only memory and random access memory, and provides operation instructions and data to the processor 3710. A portion of the memory 3740 may also include non-volatile random access memory (NVRAM).

[0530] In some implementations, memory 3740 stores elements such as execution modules or data structures, or subsets thereof, or extended sets thereof.

[0531] In this embodiment of the application, the corresponding operation is executed by calling the operation instructions stored in the memory 3740 (the operation instructions can be stored in the operating system).

[0532] One possible implementation is that electronic devices have similar structures, and different devices can use different chips to achieve their respective functions.

[0533] The processor 3710 controls the processing operations of electronic devices. The processor 3710 can also be called a central processing unit (CPU).

[0534] Memory 3740 may include read-only memory and random access memory, and provides instructions and data to processor 3710. A portion of memory 3740 may also include NVRAM. For example, in an application, memory 3740, communication interface 3730, and memory 3740 are coupled together via bus system 3720, which, in addition to a data bus, may also include a power bus, control bus, and status signal bus, etc. However, for clarity, in... Figure 37 The general labeled all buses as Bus System 3720.

[0535] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 3710. The processor 3710 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 3710 or by instructions in the form of software. The processor 3710 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 3740. Processor 3710 reads the information in memory 3740 and, in conjunction with its hardware, completes the steps of the above method.

[0536] In one possible implementation, taking the application of chip 370 in an electronic device as an example, the communication interface 3730 is used to execute... Figure 32 or Figure 33 The steps of receiving and transmitting data in the illustrated embodiment of the electronic device are shown. Processor 3710 is used to execute... Figure 32 and / or Figure 33 The processing steps of the first terminal device in the illustrated embodiment.

[0537] The communication module described above can be a communication interface of the device, used to receive signals from other devices. For example, when the device is implemented as a chip, the communication module is the communication interface used by the chip to receive or send signals from other chips or devices.

[0538] Based on the above embodiments, this application also provides an electronic device, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions. When the electronic device is running, the at least one processor executes the functions performed by the electronic device in the methods described in the embodiments of this application. For example, when executing... Figure 32 Steps 3201 to 3207 are performed by the electronic device in the illustrated embodiment. Or as... Figure 33 Steps 3301 to 3324 are performed by the electronic device in the illustrated embodiment.

[0539] Based on the above embodiments, this application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes the methods described in the embodiments of this application to be executed.

[0540] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions), which, when executed by a computer, causes the computer to perform the methods described in the embodiments of this application. Based on the above embodiments, this application also provides a chip for reading a computer program stored in a memory to implement the methods described in the embodiments of this application.

[0541] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the methods described in the embodiments of this application. In one possible design, the chip system further includes a memory for storing necessary programs and data of the computer device. This chip system may be composed of chips or may include chips and other discrete devices. Those skilled in the art will understand that the embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0542] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0543] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for editing handwritten notes, characterized in that, The method is applied to an electronic device having a display screen, and the method includes: A note-taking interface is displayed on the screen, and the note-taking interface displays handwritten notes, which include one or more paragraphs. Receive editing instructions for the handwritten notes applied to the note-taking interface; In response to the editing instruction, the text position in the first paragraph is adjusted to obtain the edited handwritten notes. The text position in the first paragraph of the edited handwritten notes meets one or more of the following requirements: the angle of any line in the first paragraph is the same as the angle of the first paragraph; the position of the text in the first paragraph meets the first requirement; the first requirement is that the distance between the text in the line and the center line of the line is within a preset distance threshold range; and the first paragraph is the paragraph affected by the editing instruction. The edited handwritten notes are displayed.

2. The method according to claim 1, characterized in that, The process of adjusting the text position within the first paragraph to obtain the edited handwritten notes includes: Rotate the lines with abnormal angles within the first paragraph so that the angle of the rotated lines is the same as the angle of the first paragraph, to obtain the edited handwritten notes. The lines with abnormal angles are those lines in one or more rows included in the first paragraph whose angle difference from the angle of the first paragraph is greater than or equal to an angle difference threshold; and / or, Adjust the position of the text with abnormal vertical positioning within the first paragraph so that the distance between the text with abnormal vertical positioning and the center line of the line containing the text with abnormal vertical positioning is within the preset distance threshold range, so as to obtain the edited handwritten notes.

3. The method according to claim 2, characterized in that, Before rotating the angle-abnormal lines within the first paragraph so that the angle of the angle-abnormal lines is the same as the angle of the first paragraph to obtain the edited handwritten notes, the method further includes: Determine the angle of each line within the first paragraph and the angle of the first paragraph; Based on the angle of the first paragraph and the angle of each line within the first paragraph, identify the lines with abnormal angles within the first paragraph.

4. The method according to claim 2 or 3, characterized in that, Before adjusting the position of text with abnormal vertical alignment within the first paragraph, the method further includes: Determine the first distance between each character in the first paragraph and the line center line of the line containing each character; Based on the first distance between each of the characters and the center line of the line containing each character, one or more first characters within the first paragraph are determined, wherein the first characters are characters whose vertical positions are abnormal within the first paragraph.

5. The method according to any one of claims 1 to 4, characterized in that, The preset distance threshold range is determined by the average, median, or mode of the first distance from the first distance of all characters in the line containing the characters with abnormal vertical positions to the line center line of the line.

6. The method according to claim 4 or 5, characterized in that, Determining one or more first characters within the first paragraph based on the first distance between each character and the center line of the line containing that character includes: If the first distance between any character and the center line of the line containing the character is greater than or equal to a third distance threshold, and / or the first distance between any character and the center line of the line containing the character is less than or equal to a fourth distance threshold, then the character is determined to be the first character. The third distance threshold and / or the fourth distance threshold are determined by the average distance, median, or mode of all characters in the line containing the first character to the center line of the line containing the first character. The third distance threshold is greater than or equal to a second distance threshold, and the fourth distance threshold is less than a first distance threshold.

7. The method according to any one of claims 1 to 6, characterized in that, The first requirement also includes: the spacing between adjacent characters within the first paragraph is within a preset spacing threshold range.

8. The method according to claim 7, characterized in that, The adjustment of the text position within the first paragraph to obtain the edited handwritten notes also includes: Adjust the position of the text with abnormal left and right spacing in the first paragraph so that the spacing between adjacent texts in the same line is within a preset spacing threshold range, thus obtaining the edited handwritten notes.

9. The method according to claim 8, characterized in that, Before adjusting the position of text with abnormal left and right spacing within the first paragraph, the method further includes: Determine the spacing between any character in the first paragraph and its adjacent characters; the adjacent characters of any given character and any given character belong to the same line; Based on the spacing between any given character and its adjacent characters, one or more second characters are determined within the first paragraph. The second characters are characters with abnormal left and right spacing within the first paragraph. The spacing between the second character and its adjacent characters does not meet a third requirement. The third requirement is determined by the average, median, or mode of the spacing between all characters in the line containing the second character.

10. The method according to claim 9, characterized in that, The preset spacing threshold range is determined by the average, median, or mode of the spacing between all characters in any line.

11. A method for editing handwritten notes, characterized in that, The method is applied to an electronic device having a display screen, and the method includes: A note-taking interface is displayed on the screen, and the note-taking interface displays handwritten notes, which include one or more paragraphs. Receive an editing command applied to the note interface for a first paragraph, the editing command being a deletion operation or an insertion operation, the first paragraph belonging to one or more of the paragraphs; In response to the editing instruction, at least the first paragraph is reformatted to obtain the reformatted handwritten notes; Based on the final position of the text to be moved in the typed handwritten notes, the text to be moved is moved from its initial position to its final position and displayed. The text to be moved is the text in the first paragraph after typed notes whose initial position and final position are different.

12. The method according to claim 11, characterized in that, The editing instruction is an insertion operation, which instructs the insertion of content into the first paragraph. In response to the editing instruction, at least the first paragraph is reformatted to obtain a formatted handwritten note, including: In response to the editing instruction, if there is no second paragraph below the first paragraph, a first blank area of ​​a preset length is inserted in the first paragraph starting from a first position to obtain the typed handwritten notes, where the first position is the insertion position indicated by the editing instruction; If a second paragraph exists below the first paragraph, determine the paragraph spacing between the first paragraph and the second paragraph; When the paragraph spacing is greater than or equal to the line height of the first paragraph, a first blank area of ​​a preset length is inserted in the first paragraph starting from the first position to obtain the typed handwritten notes; When the paragraph spacing is less than the line height of the first paragraph, the second paragraph is controlled to move away from the first paragraph, and a first blank area of ​​a preset length is inserted in the first paragraph from a first position to obtain the typed handwritten notes.

13. The method according to claim 11, characterized in that, After inserting a first blank area of ​​a preset length in the first paragraph, starting from a first position, to obtain the formatted handwritten notes, the method further includes: Detect the content inserted by the user in the first blank area; If the inserted content occupies more than a first threshold in the first blank area, then continue to insert the first blank area in the first paragraph to obtain the formatted handwritten notes.

14. The method according to claim 11 or 12, characterized in that, Insert a first blank area of ​​a preset length in the first paragraph, starting from the first position, including: Based on the number of lines in the first paragraph, a first blank area of ​​a preset length is inserted from the first position in the first paragraph. The number of lines in the first paragraph is one line, and the preset length is a first preset length. If the number of lines in the first paragraph is multiple lines, the preset length is a second preset length. The first preset length is less than the second preset length.

15. The method according to any one of claims 11 to 14, characterized in that, The editing instruction is the deletion operation, which instructs the deletion of a portion of the text in the first paragraph. The step of moving the text to be moved from its initial position to its final position and displaying it, based on the final position of the text to be moved in the formatted handwritten notes, includes: Control the first group of text in the first paragraph to move from the initial position to the final position corresponding to the first group of text, wherein the first group of text is the text whose initial position and final position are on the same line in the text to be moved; At the moment the first group of text begins to move, the second group of text is controlled to disappear from the initial position of the second group of text and appear at the right end of the initial state of the previous line of text with the first transparency. The second group of text consists of text whose initial position and final position are on different lines among the text to be moved. Control the second group of text to move together with the first group of text until the first group of text and the second group of text are respectively in their final positions. During the movement, the transparency of the second group of text gradually decreases from the first transparency to the second transparency.

16. The method according to any one of claims 11 to 15, characterized in that, The editing command is either the deletion operation or the insertion operation. The step of moving the text to be moved from its initial position to its final position and displaying it, based on the final position of the text to be moved in the formatted handwritten notes, includes: Control the first group of characters in the text to be moved to move from the initial position to the final position. The first group of characters is the text in the text to be moved whose initial position and final position are on the same line. At the moment when the first group of text begins to move, the second group of text is controlled to disappear from the initial position of the second group of text and appear at the final position of the second group of text with the first transparency. The second group of text consists of text whose initial position and final position are on different lines among the text to be moved. During the movement of the first group of text, the transparency of the second group of text at the final position is controlled to gradually decrease from the first transparency until the transparency of the second group of text is 0 at the end of the movement.

17. The method according to any one of claims 11 to 16, characterized in that, The editing command is a deletion operation or an insertion operation. The step of moving the text to be moved from its initial position to its final position and displaying it, based on the final position of the text to be moved in the formatted handwritten notes, includes: According to the playback time order of the first group of text and the second group of text in the text to be moved, move the first group of text and the second group of text to the final position in sequence. The first group of text consists of text in the text to be moved whose initial position and final position are on the same line, and the second group of text consists of text in the text to be moved whose initial position and final position are on different lines.

18. The method according to any one of claims 11 to 16, characterized in that, The editing command is a deletion operation or an insertion operation. The step of moving the text to be moved from its initial position to its final position and displaying it, based on the final position of the text to be moved in the formatted handwritten notes, includes: Control the first group of characters in the text to be moved to move from the initial position to the final position. The first group of characters is the text in the text to be moved whose initial position and final position are on the same line. At the moment when the first group of text begins to move, the second group of text is controlled to disappear from its initial position. The second group of text consists of text whose initial and final positions are on different lines among the text to be moved. When the first group of text moves to its final position, control the second group of text to appear at its final position.

19. The method according to any one of claims 11 to 16, characterized in that, The editing command is an insertion operation. The step of moving the text to be moved from its initial position to its final position and displaying it, based on the final position of the text to be moved in the formatted handwritten notes, includes: Control the first group of characters in the text to be moved to move from the initial position to the final position. The first group of characters is the text in the text to be moved whose initial position and final position are on the same line. At the moment when the first group of text begins to move, the second group of text is controlled to disappear from the initial position of the second group of text and appear at the left end of the initial state of the next line of text with the first transparency. The second group of text consists of text whose initial position and final position are on different lines among the text to be moved. Control the second group of text to move together with the first group of text until the second group of text and the first group of text are respectively in their final positions. During the movement, the transparency of the second group of text gradually decreases from the first transparency to 0%.

20. The method according to claim 19, characterized in that, Below the first paragraph is a second paragraph, and the paragraph spacing between the first paragraph and the second paragraph is greater than the line height of the first paragraph. The method further includes: At the moment the first group of text begins to move, control the second paragraph to move downwards until the first group of text reaches its final position, then control the second paragraph to move to its final position.

21. An electronic device, characterized in that, It includes at least one processor coupled to at least one memory, the at least one processor being configured to read and execute a computer program stored in the at least one memory to cause the method as described in any one of claims 1 to 20 to be performed.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 20.

23. A computer program product containing instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 20.

Citation Information

Cited By

  • Method for editing handwritten note, and electronic device

    EP4769107A1

  • Method for editing handwritten note, and electronic device

    WO2025232373A1