Text format setting method and apparatus, and electronic device
By providing an independent formatting window and multiple selection operations in the document editing application, the problems of low batch formatting efficiency and format legacy in the existing technology are solved, and efficient text format application and management are achieved.
Patent Information
- Application Number
- PCT/CN2024/077906
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2024-02-21
- Publication Date
- 2024-09-06
AI Technical Summary
Existing document editing applications are inefficient when formatting text content in batches, and can easily lead to formatting problems.
A text format setting method and device are provided. By displaying the format setting window in the document display interface, the user can independently set the target text format and apply it to the corresponding text content through multiple selection operations to avoid errors in the text content. When setting the format, the original format will be affected.
It improves the efficiency of batch formatting, avoids formatting problems left during the formatting process, and simplifies the operation of applying the same target text format multiple times.
Smart Images

Figure CN2024077906_06092024_PF_FP
Abstract
Description
Text format setting method, device and electronic device
[0001] This application claims priority to Chinese Patent Application No. 202310208420.8 filed on February 27, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] Embodiments of the present disclosure relate to a text formatting method, device, and electronic device. Background Art
[0003] Users can edit text using a document editing application. After editing the text or during the text editing process, users can set or adjust the text format, such as setting the font, size, color, alignment, etc.
[0004] When there is a lot of text, users want to batch format multiple texts in the text. Current document editing applications provide batch formatting tools such as the format brush, which can be used to batch format multiple paragraphs in the text.
[0005] In some application scenarios, when using batch formatting tools to batch format text, there is a problem of low efficiency due to inconvenient operation.
[0006] Summary of the Invention
[0007] The embodiments of the present disclosure provide a text formatting method, device, and electronic device to overcome the problem of low efficiency in batch formatting of texts by batch formatting tools in related technologies.
[0008] In a first aspect, an embodiment of the present disclosure provides a method for setting a text format, the method comprising:
[0009] Display text content and format setting window in the document display interface;
[0010] Determine the target text format set by the user in the format setting window;
[0011] In response to receiving multiple selection operations on the text content, the target text format is applied to the target text corresponding to each selection operation.
[0012] In a second aspect, an embodiment of the present disclosure provides a text formatting device, comprising:
[0013] A display unit, configured to display text content and a format setting window in a document display interface;
[0014] A determination unit, used for determining a target text format set by a user in a format setting window;
[0015] The application unit is configured to, in response to receiving multiple selection operations on the text content, apply the target text format to the target text corresponding to each selection operation.
[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text formatting method as described in the first aspect and various possible methods involved in the first aspect.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the text formatting method as described in the first aspect and various possible methods involved in the first aspect are implemented.
[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned first aspect and various text formatting methods that may be involved in the first aspect.
[0019] The text formatting method, device and electronic device provided in this embodiment display text content and a formatting window in a document display interface; determine the target text format set by the user in the formatting window; and in response to receiving multiple selection operations on the text content, apply the target text format to the target text corresponding to each selection operation. Since a separate formatting window is provided outside the text content, the text formatting process is independent of the text content. The text format editing process does not affect the original format of the text content. In addition, the target text format set in the formatting window can be applied to the target text indicated by multiple selection operations. After one operation is completed, there is no need to perform any operation on the formatting window again. The target text format can be applied to other texts in the document again through selection operations, thereby improving the efficiency of batch text formatting. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, a brief introduction will be given below to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] FIG1 is a flowchart of a text formatting method according to an embodiment of the present disclosure;
[0022] FIG2 is a second flow chart of a text formatting method provided by an embodiment of the present disclosure;
[0023] FIG3A is a schematic diagram of a document display interface;
[0024] FIG3B is a schematic diagram of a document display interface;
[0025] FIG4 is a third flow chart of a text formatting method provided by an embodiment of the present disclosure;
[0026] FIG5 is a schematic diagram of a format setting window;
[0027] FIG6 is a schematic diagram of a format setting window;
[0028] FIG7 is a structural block diagram of a text format setting device provided by an embodiment of the present disclosure; and
[0029] FIG8 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0031] Currently, the Format Painter is a tool for batch formatting text. Batch formatting relies on the Format Painter feature. To use the Format Painter, users must first apply the target text formatting from the main document, then apply the Format Painter to the text they want to batch format.
[0032] To use the format brush for batch formatting, you need to set the format in the main text. That is to say, you need to select part of the text from the main text and format it, such as adding a background color, bolding, setting the text color, setting the font size or font, etc. During the above formatting process, the original format of the text will be changed. During the formatting process, some formats are set for this part of the text. If you abandon the formatting during the formatting process, you need to cancel the application of the above partial formats to this part of the text. If the user forgets to cancel the above application, these partial formats will be left in the text content, causing inconvenience to the user.
[0033] In addition, when using the format brush for batch formatting, the user needs to first select the text that has been formatted, and then click the format brush icon to absorb the format from the edited text. After absorbing the format, the user can apply the absorbed format to some text by selecting some text from the text content and pressing a button. However, if you need to continue to use the edited format on other text in the above text content, you need to select the edited text again, and then use the format brush to absorb the format, and then select other text to apply the absorbed format. In this way, the efficiency of batch formatting text is not high.
[0034] In order to improve the above-mentioned problem, the solution provided by the present disclosure displays a format setting window independent of the text content in the document. The user can set the target text format in the format setting window. After setting the target text format, the user can use at least one selection operation to apply the target text format to the target text indicated by the at least one selection operation. Since the format setting window is independent of the text content, the process of the user setting the format in the format setting window will not affect the format of the text content, and therefore no formatting legacy will be generated during the format setting process due to the abandonment of the format setting. In addition, after the target text format is set, the target text format can be applied to multiple target texts of the text content by at least one selection operation of the user, thereby improving the efficiency of batch formatting. In addition, the batch formatting tool is also enriched.
[0035] Please refer to Figure 1, which is a flowchart of a text formatting method provided by an embodiment of the present disclosure. The method includes:
[0036] The text formatting method in the present disclosure may be executed by any electronic device, including a terminal device, or a server providing services to the terminal device.
[0037] S101: Displaying text content and a format setting window in a document display interface.
[0038] The document page here can be an online document page or an offline document page.
[0039] The text content in the above document pages can be edited in real time or historically.
[0040] The above text content may include words, symbols, numbers, letters, etc.
[0041] In some application scenarios, the format setting window may be a floating window or a pop-up window. In these application scenarios, the format setting window may be set above the text content.
[0042] In some embodiments, the format setting window may be set on one side of the text content, that is, the text content and the format setting window are displayed side by side in the document display interface.
[0043] In one example, the format setting window can be displayed on the right side of the text content. As shown in FIG2 , the format setting window 202 is set on the right side of the text content 201 .
[0044] In one example, the format setting window may also be displayed on the left side of the text content.
[0045] In these embodiments, the user can browse the text content and the format setting window simultaneously without obstruction in the document display interface.
[0046] S102: Determine the target text format set by the user in the format setting window.
[0047] In some embodiments, the user can use the formatting items in the toolbar of the document editing application to set the target text format in the format setting window.
[0048] In one example, the user can enter reference text in the formatting window and then apply the format selected in the toolbar to the reference text.
[0049] In one example, the formatting window may display default reference texts, and the user may apply a selected format to the reference texts.
[0050] For example, you can select text in the formatting window and then click a formatting option in the toolbar on the document display interface to apply that formatting option to the text. By doing this multiple times, you can apply the formats corresponding to different formatting options to the text in sequence. When the formatting operation is complete, the combination of these different formats can be used as the target text format.
[0051] As an implementation, a control can be provided in the formatting window to indicate the completion of the formatting operation. The user can trigger the control. When the execution entity receives the user's triggering operation on the control, the formatting operation can be considered to be completed.
[0052] As another implementation, while the user is editing a format in the formatting window, for any formatting operation, the execution entity combines the formatting set before the formatting operation with the formatting set in the current formatting operation. Upon detecting that the user has performed a selection operation on text content, the combined format before the user's selection operation on the text content may be used as the target text format.
[0053] When the user sets the target text format in the format setting window, the format of the text content will not be changed.
[0054] S103: In response to receiving multiple selection operations on text content, applying a target text format to the target text corresponding to each selection operation.
[0055] After the user sets the target text format in the format setting window, the user can select the target text to which the target text format is applied from the text content.
[0056] In one example, a user can perform multiple selection operations on text content. Each selection operation selects a portion of the text content, and the text selected by the selection operation can be used as the target text of the selection operation. After the selection operation is completed, the target text format can be applied to the target text.
[0057] It is understandable that the user may also perform a selection operation to select all texts to be applied with the target text format as the target text. After detecting that the user's selection operation is completed, the target text format is applied to the target text selected in the selection operation.
[0058] In some embodiments, the above step S103 includes: in response to receiving a selection operation on the first content in the text content, changing the format of the first content to the target text format; and in response to receiving a selection operation on the second content in the above text content, changing the format of the second content to the target text format.
[0059] In these embodiments, the first content and the second content may be components of text content, respectively. In some application scenarios, there may be no overlapping content between the first content and the second content.
[0060] That is to say, after the target text format is determined in step S102, the user can select the partial content to which the target text format is to be applied through multiple selection operations. After selecting the above partial content, the target text format can be automatically applied to the partial content selected in each selection operation.
[0061] Illustratively, a user selects first content A in a first selection operation, and the execution entity may apply the target text format to the first content A. Immediately after the user performs the first selection operation, a second selection operation may be performed, in which the user selects second content B, and the execution entity may apply the target text format to the second content B.
[0062] In these embodiments, after setting the target text format, the user can apply the target text format to the different contents by performing selection operations on the different contents in the text content, thereby simplifying the operation of applying the same target text format by selecting different text contents through multiple selection operations.
[0063] In some embodiments, the above step S103 further includes: while displaying the format setting window, receiving multiple selection operations on the text content, and applying the target text format to the target text corresponding to each selection operation.
[0064] In these embodiments, after the target text format is set in the format setting window, the document display interface may continue to display the format setting window. The user may then perform a content selection operation in the document content.
[0065] That is, while the format setting window and the document content are displayed in the document display interface, the target text format can be applied to the content selected in each selection operation in sequence according to the multiple selection operations received from the user on the document content.
[0066] In these embodiments, by simultaneously displaying the format setting window and the document content in the document display interface, the target text format is applied to the portion of the text content corresponding to each selection operation according to the multiple selection operations performed on the document content, so that the user can check whether the format applied to the portion of the text content is the same as the target text format set in the format setting window, which is beneficial for the user to confirm the accuracy of the format applied to the selected content.
[0067] In other words, after the user sets the target text format in the Format Settings window, they can apply the target text format to multiple target texts by selecting them multiple times. There's no need to perform any operations in the Format Settings window before selecting each target text to apply the target text format. This simplifies the process of applying the same target text format to different target texts through multiple operations.
[0068] In this embodiment, the text content and the format setting window are displayed in the document display interface; the target text format set by the user in the format setting window is determined; and based on at least one selection operation performed on the text content, the target text format is applied to the target text indicated by each selection operation. Since a separate format setting window is provided outside the text content, the text format setting process is independent of the text. The text format editing process does not affect the original format of the text content. In addition, the target text format set in the format setting window can be applied to the target text indicated by multiple selection operations. After one operation is completed, there is no need to perform any operation on the format setting window again. The target text format can be applied to other texts in the document through selection operations again, thereby improving the efficiency of batch formatting.
[0069] Please refer to Figure 2, which is a second flow chart of a text formatting method provided by an embodiment of the present disclosure. The method includes:
[0070] S201: Displaying text content in a document display interface; the document display interface includes a first control.
[0071] S202: In response to detecting a triggering operation performed on the first control, displaying a format setting window in the document display interface.
[0072] The following description is made in conjunction with Figure 3A and Figure 3B : Figure 3A is a schematic diagram of a document display interface; Figure 3B is a schematic diagram of a document display interface.
[0073] As shown in FIG3A , a document display interface 301 displays the text "XX…XX," where "X" represents any text, symbol, or letter. A first control 302 may be displayed in the document display interface. The first control 302 may include any text, symbol, or letter. The first control may be a control for indicating the display of a formatting window.
[0074] When the user needs to set formatting, they can perform a triggering operation on the first control 302, such as clicking or touching. Upon detecting that the user has triggered the first control 302, a formatting window 304 can be displayed on the document display interface 301, as shown in FIG3B . At the same time, the document display interface 301 also displays text content 303. In some application scenarios, the formatting window and the text content do not overlap.
[0075] It can be understood that when the formatting window is displayed on one side of the text content, after the formatting window is triggered to be displayed in the document display interface, the original text content display area in the document display interface can be narrowed, so that the above-mentioned text content and formatting window can be displayed side by side in the document display interface.
[0076] The user can set the target text format in the displayed format setting window.
[0077] S203: Determine the target text format set by the user in the format setting window.
[0078] S204: In response to receiving multiple selection operations on the text content, applying the target text format to the target text corresponding to each selection operation.
[0079] The specific implementation of steps S203 and S204 can refer to the relevant parts of the embodiment shown in FIG1 , which will not be described in detail here.
[0080] S205: The format setting window further includes a second control for closing the format setting window; in response to receiving a trigger operation performed on the second control, hiding the format setting window in the document display interface.
[0081] 3B , a second control 305 may be displayed in the format setting window 304. The identifier of the second control may include any text, symbol and / or letter, etc. The second control may be a control for indicating hiding the format setting window.
[0082] The user can perform a trigger operation on the second control, such as clicking or touching, to hide the format setting window in the document display interface.
[0083] After the format setting window is hidden in the document display interface, the display area of the text content may be adjusted so that the display area of the text content fits the entire document display interface.
[0084] Compared to the embodiment shown in FIG1 , the text formatting method provided in this embodiment emphasizes the display and hiding of the formatting window. Therefore, within the document display interface, the user can access the formatting window as needed to set the target text format and apply the target text format to the text content. After the target text format is set, the formatting window can be hidden, allowing the entire text interface to display the text content. In other words, the formatting window can be displayed and hidden as needed by the user, improving the user experience.
[0085] Please refer to Figure 4, which is a flowchart diagram of a text formatting method provided by an embodiment of the present disclosure. The method includes:
[0086] S401: Displaying text content and a format setting window in a document display interface; the format setting window includes: a format selection area and a format preview area, the format selection area includes multiple format options, and the preview format area is used to display the application effect of the format option selected by the user on the text.
[0087] The following description will be made in conjunction with FIG5 , which shows a schematic diagram of a format setting window. As shown in FIG5 , the format setting window includes a select format area 501 and / or a preview format area 502 .
[0088] The format selection area 501 may include a plurality of format options. For example, the format option "T" for setting the text as body text, the format option "H1" for setting the text as a first-level heading, the format option "H2" for setting the text as a second-level heading, the format option "H3" for setting the text as a third-level heading, the format option "Hn" for setting the text as an n-level heading, the format option 504 for setting the text as an ordered list, the format option 505 for setting the text as an unordered list, the format option "B" for bolding the text, the format option "I" for italicizing the text, the format option 506 for underlining the text, and the like. The format options described herein and shown in FIG. 5 are merely exemplary descriptions of the format options and are not intended to be exhaustive.
[0089] The user can select a format option in the format selection area, and correspondingly, the text in the preview format area can display the display effect of the format corresponding to the format option selected by the user.
[0090] For example, as shown in FIG. 5 , when the user clicks the format option 507 for adding a strikethrough to text, the text displayed in the preview format area 502 may be struckthrough.
[0091] In addition, the format setting window also displays a format setting window logo 503 , which is similar to the “batch format setting” in FIG5 .
[0092] By providing a format selection area in the format setting window and providing multiple format options for users to choose from in the format selection area, it is convenient for users to set the target text format, which can improve the efficiency of users setting the target text format. In addition, a preview format area is provided in the format setting window, and users can browse the application effect of the selected format in the preview format area. This allows users to preview the application effect of the target text format in the text before applying the target text format to the text content, so that the format in the text content is not affected before the user determines the target text format. This is conducive to achieving the mutual independence of format setting and text content display. It avoids the formatting legacy caused by the process of setting the target text format in the text content.
[0093] S402: Determine a target text format according to the triggering operations successively received from the user on at least one format option in the format selection area.
[0094] S403: Displaying the application effect of the formatting option selected by the user on the text in the preview format area.
[0095] The user may perform a trigger operation on a format option each time, thereby selecting the format corresponding to the sub-format option as a component of the target text format.
[0096] It should be understood that the target text format may include a single format or a combined format formed by combining multiple formats.
[0097] The target text format may be determined based on triggering actions that the user performs multiple times on different formatting options.
[0098] If the user performs an even number of trigger operations on a format option, the format corresponding to the format option will not be determined as a component of the target text format. If the user performs an odd number of trigger operations on a format option, the format corresponding to the format option will be determined as a component of the target text format.
[0099] The formats indicated by the different format options corresponding to the multiple triggering operations of the user may be combined to obtain the target text format.
[0100] If at least one format option includes format options of different categories, formats corresponding to the at least one format option are combined to obtain the target text format.
[0101] In some embodiments, if the user triggers operations corresponding to the same category of formats multiple times, the format of the category corresponding to the last trigger operation of the user is used as a component of the target text format.
[0102] Illustratively, if the user performs trigger operations on the format option "H1" and the format option "H2" in sequence, the format "secondary title" corresponding to the format option "H2" will be used as a component of the target text format.
[0103] Illustratively, if at least one format option includes "T", "B" and a format option for applying a background color, the text format indicated by the "T" format option, the bold format indicated by the "B" format option and the format for applying a background color are combined to obtain the target text format.
[0104] It is understood that each time a user triggers a formatting option, the formatting effect corresponding to the triggering operation may be displayed in the preview format area, for example, the corresponding formatting and the historical effects may be superimposed and applied to the text in the preset area.
[0105] In these embodiments, by determining the target text format based on different types of formats triggered by the user, the user can determine the target text format desired by the user based on the format preview effect in the preview area before applying each format to the text content, thereby improving the user experience.
[0106] In some embodiments, if a format option is triggered, the format option is highlighted in the select format area.
[0107] Illustratively, the highlighting of the format option includes increasing the area of the display region of the format option.
[0108] Illustratively, the highlighting of the format option includes setting the display color of the identifier of the format option to a display color different from that of the identifiers of other untriggered format options.
[0109] In these embodiments, by highlighting the triggered formatting options, the user can understand which formats have been applied as components of the target text format, making it easier for the user to determine whether to continue using other formats or revise the already applied formats.
[0110] In some embodiments, if a format option is triggered, the background color of the format option is displayed as a color different from the background colors of other format options that are not triggered.
[0111] Illustratively, in the format selection area, the background color of unselected format options is displayed as a first color, and the background color of triggered format options is displayed as a second color.
[0112] Here, the first color and the second color can be different colors. The first color and the second color can be various colors.
[0113] Schematically, before the format option "B" is triggered by the trigger operation, the background color of the format option "B" is displayed as gray or white. After being triggered, the background color of the format option "B" is displayed as yellow.
[0114] In these embodiments, by displaying the background color of the formatting option as a different color from the background colors of other untriggered formatting options, the user can quickly understand which formats have been selected and which have not been selected. This facilitates the user's decision whether to continue using other formats or revise already applied formats, thereby improving the efficiency of setting target text formats.
[0115] S404: In response to receiving multiple selection operations on text content, applying a target text format to the target text corresponding to each selection operation.
[0116] The specific implementation of step S404 may refer to step S103 shown in FIG1 , and will not be described in detail here.
[0117] Compared to the embodiment shown in FIG1 , the text formatting method provided in this embodiment emphasizes setting the target text format based on the formatting options provided in the formatting window and provides a preview of the target text format. This improves the efficiency of setting the target text format in the formatting window and facilitates improving the efficiency of applying the target text format to text content.
[0118] In some optional implementations of the text formatting method shown in FIG1 , FIG2 and FIG4 , the formatting window further includes a format application switch for indicating application of the format;
[0119] And step S103 in FIG. 1 , step S204 in FIG. 2 , and step S404 in FIG. 4 may include:
[0120] In response to detecting that the format application switch is in the on state, according to at least one selection operation performed by the user on the text content, the target text format is applied to the target text respectively indicated by each selection operation.
[0121] Please refer to Figure 6, which is a schematic diagram of the format setting window. The format setting window includes a format application switch 601. The user selects a format by triggering a format option in the Select Format area, and then browses the format application effect in the Preview Format area to finally determine the target text format. After setting the target text format, the application switch can be turned on, that is, the application switch is set to the on state. When the application switch is turned on, the user can apply the target text format to the text in the text content.
[0122] It is understandable that the user may turn on the format application switch before performing a trigger operation on the format option, or may turn on the format application switch after the user has set the target text format.
[0123] When the Apply switch is on, users can select text content to apply the target text formatting to the target text indicated by the selection operation.
[0124] It is understood that the user can also turn off the application switch. In other words, set the application switch to the off state. When the application switch is off, the user cannot apply the formatting in the formatting window to any text in the text content.
[0125] In these embodiments, a format application switch is set in the format setting window, and the user operates the application switch to turn the application switch on or off, thereby controlling whether the target text format is applied to the text content. This is conducive to achieving controllability of the target text format application and can improve the user experience.
[0126] Corresponding to the text formatting method of the above embodiment, FIG7 is a structural block diagram of a text formatting device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Referring to FIG7 , the device 70 includes: a display unit 701, a determination unit 702, and an application unit 703. Among them:
[0127] Display unit 701, used to display text content and format setting window in the document display interface;
[0128] A determining unit 702 is used to determine the target text format set by the user in the format setting window;
[0129] The applying unit 703 is configured to apply the target text format to the target text corresponding to each selection operation in response to receiving multiple selection operations on the text content.
[0130] In some embodiments of the present disclosure, the format setting window is set on one side of the text content.
[0131] In some embodiments of the present disclosure, the display unit 701 is further configured to:
[0132] Displaying text content in a document display interface; the document display interface includes a first control;
[0133] In response to detecting a triggering operation performed on the first control, a format setting window is displayed in the document display interface.
[0134] In some embodiments of the present disclosure, the format setting window includes: a selection format area and / or a preview format area, wherein:
[0135] The Select Format area includes several formatting options;
[0136] The preview format area is used to display the effect of the formatting options selected by the user on the text.
[0137] In some embodiments of the present disclosure, the display unit 701 is further configured to:
[0138] If a format option is triggered, the format option is highlighted in the Select Format area.
[0139] In some embodiments of the present disclosure, the display unit 701 is further configured to display the background color of the formatting option as a color different from the background colors of other formatting options that have not been triggered. In some embodiments of the present disclosure, the formatting window further includes a second control for closing the formatting window; and the display unit 701 is further configured to hide the formatting window from the document display interface in response to receiving a triggering operation on the second control.
[0140] In some embodiments of the present disclosure, the determining unit 702 is further configured to determine the target text format according to the triggering operations successively received from the user on at least one format option in the format selection area.
[0141] In some embodiments of the present disclosure, the determining unit 702 is further configured to: if the at least one format option includes format options of different categories, combine the formats corresponding to the at least one format option to obtain the target text format.
[0142] In some embodiments of the present disclosure, the apparatus 70 further includes a display unit (not shown in the figure), and the display unit is configured to display the application effect of the target text format in the preview format area.
[0143] In some embodiments of the present disclosure, the format setting window further includes a format application switch for indicating the application of the format; the application unit 703 is further configured to:
[0144] In response to detecting that the format application switch is in the on state, according to at least one selection operation performed on the text content, the target text format is applied to the target text respectively indicated by each selection operation.
[0145] In some embodiments of the present disclosure, the application unit 703 is further used to: in response to receiving a selection operation on the first content in the text content, change the format of the first content to the target text format; and in response to receiving a selection operation on the second content in the text content, change the format of the second content to the target text format.
[0146] In some embodiments of the present disclosure, the applying unit 703 is further configured to: receive multiple selection operations on text content while displaying the format setting window, and apply the target text format to the target text corresponding to each selection operation.
[0147] In order to implement the above embodiment, the embodiment of the present disclosure further provides an electronic device.
[0148] Referring to FIG8 , a schematic diagram of the structure of an electronic device 800 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 800 may be various terminal devices or servers. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG8 is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0149] As shown in Figure 8, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0150] Typically, the following devices may be connected to the I / O interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although FIG8 shows an electronic device 800 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0151] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0152] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0153] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0154] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0155] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0157] The units described in the embodiments of the present disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, a display unit may also be described as a "unit that displays text content and a formatting window in a document display interface."
[0158] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0159] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0160] In a first aspect, according to one or more embodiments of the present disclosure, a text formatting method is provided, comprising:
[0161] Display text content and format setting window in the document display interface;
[0162] Determine the target text format set by the user in the format setting window;
[0163] In response to receiving multiple selection operations on text content, a target text format is applied to the target text corresponding to each selection operation.
[0164] According to one or more embodiments of the present disclosure, a format setting window is set on one side of the text content.
[0165] According to one or more embodiments of the present disclosure, displaying text content and a format setting window in a document display interface includes:
[0166] Displaying text content in a document display interface; the document display interface includes a first control;
[0167] In response to detecting a triggering operation performed on the first control, a format setting window is displayed in the document display interface.
[0168] According to one or more embodiments of the present disclosure, the format setting window includes: a format selection area and / or a format preview area, wherein:
[0169] The Select Format area includes several formatting options;
[0170] The preview format area is used to display the effect of the formatting options selected by the user on the text.
[0171] According to one or more embodiments of the present disclosure, the method further includes: if a format option is triggered, highlighting the format option in the format selection area.
[0172] According to one or more embodiments of the present disclosure, highlighting the format option includes:
[0173] The background color of the format option is displayed as a color different from the background colors of other format options that have not been triggered. According to one or more embodiments of the present disclosure, the format setting window further includes a second control for closing the format setting window;
[0174] And the method further comprises:
[0175] In response to receiving a trigger operation performed on the second control, hiding the format setting window in the document display interface.
[0176] According to one or more embodiments of the present disclosure, determining a target text format set by a user in a format setting window includes:
[0177] A target text format is determined according to trigger operations performed by the user on at least one format option received successively.
[0178] According to one or more embodiments of the present disclosure, determining a target text format based on successively received triggering operations performed by a user on at least one format option includes:
[0179] If at least one format option includes format options of different categories, formats corresponding to the at least one format option are combined to obtain the target text format.
[0180] According to one or more embodiments of the present disclosure, the method further includes: displaying the application effect of the target text format in the preview format area.
[0181] According to one or more embodiments of the present disclosure, the format setting window further includes a format application switch;
[0182] and applying a target text format to the target text indicated by the selection operation according to the received selection operation performed on the text in the document, including:
[0183] In response to detecting that the format application switch is in the on state, according to at least one selection operation performed on the text content, the target text format is applied to the target text respectively indicated by each selection operation.
[0184] According to one or more embodiments of the present disclosure, in response to receiving multiple selection operations on text content, applying a target text format to the target text corresponding to each selection operation includes:
[0185] In response to receiving a selection operation on first content in the text content, the format of the first content is changed to a target text format; and in response to receiving a selection operation on second content in the text content, the format of the second content is changed to the target text format.
[0186] According to one or more embodiments of the present disclosure, in response to receiving multiple selection operations on text content, applying a target text format to the target text corresponding to each selection operation includes:
[0187] While the format setting window is displayed, multiple selection operations on the text content are received, and the target text format is applied to the target text corresponding to each selection operation.
[0188] In a second aspect, according to one or more embodiments of the present disclosure, a text formatting device is provided, comprising:
[0189] A display unit, configured to display text content and a format setting window in a document display interface;
[0190] A determination unit, used for determining a target text format set by a user in a format setting window;
[0191] The applying unit is configured to apply the target text format to the target text corresponding to each selection operation in response to receiving multiple selection operations on the text content.
[0192] According to one or more embodiments of the present disclosure, a format setting window is set on one side of the text content.
[0193] According to one or more embodiments of the present disclosure, the display unit is further configured to:
[0194] Displaying text content in a document display interface; the document display interface includes a first control;
[0195] In response to detecting a triggering operation performed on the first control, a format setting window is displayed in the document display interface.
[0196] According to one or more embodiments of the present disclosure, the format setting window includes: a format selection area and / or a format preview area, wherein:
[0197] The Select Format area includes several formatting options;
[0198] The preview format area is used to display the effect of the formatting options selected by the user on the text.
[0199] According to one or more embodiments of the present disclosure, the display unit is further configured to:
[0200] If a format option is triggered, the format option is highlighted in the Select Format area.
[0201] According to one or more embodiments of the present disclosure, the display unit is further configured to display the background color of the formatting option as a color different from the background colors of other formatting options that have not been triggered. According to one or more embodiments of the present disclosure, the formatting window also includes a second control for closing the formatting window; and the display unit is further configured to hide the formatting window from the document display interface in response to receiving a triggering operation performed on the second control.
[0202] According to one or more embodiments of the present disclosure, the determining unit is further configured to determine the target text format according to trigger operations successively received from the user on at least one format option in the format selection area.
[0203] According to one or more embodiments of the present disclosure, the determining unit is further configured to: if the at least one format option includes format options of different categories, combine the formats corresponding to the at least one format option to obtain the target text format.
[0204] According to one or more embodiments of the present disclosure, the device further includes a display unit, and the display unit is configured to display the application effect of the target text format in the preview format area.
[0205] According to one or more embodiments of the present disclosure, the format setting window further includes a format application switch for indicating application of the format; and the application unit is further configured to:
[0206] In response to detecting that the format application switch is in the on state, according to at least one selection operation performed on the text content, the target text format is applied to the target text respectively indicated by each selection operation.
[0207] According to one or more embodiments of the present disclosure, the application unit is further configured to: in response to receiving a selection operation on a first content in the text content, change the format of the first content to a target text format; and in response to receiving a selection operation on a second content in the text content, change the format of the second content to the target text format. According to one or more embodiments of the present disclosure, the application unit is further configured to: while displaying the format setting window, receive multiple selection operations on the text content, and apply the target text format to the target text corresponding to each selection operation.
[0208] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0209] Memory stores computer-executable instructions;
[0210] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the above first aspect and various text formatting methods that may be involved in the first aspect.
[0211] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the text formatting method as described in the first aspect and various possible methods involved in the first aspect are implemented.
[0212] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the above first aspect and various text formatting methods that may be involved in the first aspect.
[0213] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the present disclosure.
[0214] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0215] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A text formatting method, comprising: Display text content and format setting window in the document display interface; Determine the target text format set by the user in the format setting window; In response to receiving multiple selection operations on the text content, the target text format is applied to the target text corresponding to each selection operation.
2. The method according to claim 1, wherein The format setting window is set on one side of the text content.
3. The method according to claim 1 or 2, wherein: Displaying the text content and format setting window in the document display interface includes: Displaying text content in the document display interface; the document display interface includes a first control; In response to detecting a triggering operation performed on the first control, the format setting window is displayed in the document display interface.
4. The method according to any one of claims 1 to 3, wherein: The format setting window includes: a format selection area and / or a format preview area, wherein: The select format area includes a plurality of format options; The preview format area is used to display the application effect of the format option selected by the user on the text.
5. The method according to claim 4, further comprising: If a format option is triggered, the format option is highlighted in the selected format area.
6. The method according to claim 5, wherein: The formatting options described in Highlight include: Displays the background color of this format option as a different color from the background colors of other format options that have not been triggered.
7. The method according to any one of claims 1 to 6, wherein: The format setting window further includes a second control for closing the format setting window; And the method further comprises: In response to receiving a trigger operation performed on the second control, hiding the format setting window in the document display interface.
8. The method according to claim 4, wherein Determining the target text format set by the user in the format setting window includes: The target text format is determined according to trigger operations performed by the user on at least one of the format options received successively.
9. The method according to claim 8, wherein The determining the target text format according to the triggering operations performed by the user on at least one of the format options received successively includes: If at least one of the format options includes format options of different categories, the formats corresponding to the at least one format option are combined to obtain the target text format.
10. The method according to claim 8, further comprising: The application effect of the target text format is displayed in the preview format area.
11. The method according to any one of claims 1 to 10, wherein: The format setting window also includes a format application switch; as well as In response to receiving multiple selection operations on the text content, applying the target text format to the target text corresponding to each selection operation includes: When the format application switch is in an on state, in response to receiving multiple selection operations on the text content, the target text format is applied to the target text corresponding to each selection operation.
12. The method according to any one of claims 1 to 10, wherein: In response to receiving multiple selection operations on the text content, applying the target text format to the target text corresponding to each selection operation includes: In response to receiving a selection operation on a first content in the text content, the format of the first content is changed to the target text format; and in response to receiving a selection operation on a second content in the text content, the format of the second content is changed to the target text format.
13. The method according to any one of claims 1 to 10, wherein: In response to receiving multiple selection operations on the text content, applying the target text format to the target text corresponding to each selection operation includes: While displaying the format setting window, multiple selection operations on the text content are received, and the target text format is applied to the target text corresponding to each selection operation.
14. A text formatting device, comprising: A display unit configured to display text content and a format setting window in a document display interface; A determining unit configured to determine a target text format set by the user in the format setting window; The application unit is configured to, in response to receiving multiple selection operations on the text content, The target text format is applied to the target text corresponding to each selection operation.
15. An electronic device comprising a processor and a memory, wherein: The memory stores computer-executable instructions; When the processor executes the computer-executable instructions stored in the memory, the processor executes the text formatting method according to any one of claims 1 to 13.
16. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the text formatting method according to any one of claims 1 to 13 is implemented.
17. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the text formatting method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Webpage document editing method and device, terminal and storage medium
CN110728112A
Text processing method and device and storage medium
CN110929484A
Text format setting method and device and electronic equipment
CN116151189A
Interactive formatting interface
US20020188637A1
System and method for maintaining text formatting consistency within an electronic document
US7111238B1
