User terminal-based interface rendering method and device, font adjustment method
By obtaining font scaling factors and performing rule calculations in mobile terminal applications, and exchanging font strategies, dynamic font adjustment is achieved. This solves the problems of high code intrusion and large workload in existing technologies, meets user needs, and reduces the workload of adjustment.
Patent Information
- Application Number
- CN202211405878.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-11-10
AI Technical Summary
In existing technologies, adjusting the font of a mobile terminal application's display page requires modifying the source code one by one, resulting in high code intrusion and a large workload.
By obtaining the font scaling factor, performing rule calculations using the target operating system's font setting interface and historical font strategies, the target font size is obtained. The new font strategy is then exchanged with the historical font strategy, and the view elements on the terminal interface are rendered using the exchanged strategy, thus achieving dynamic font adjustment.
It achieves dynamic font adjustment at low cost, meets user needs and preferences, reduces the workload of business personnel, and avoids intrusive modifications to the original code.
Smart Images

Figure CN115827126B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology and other related technical fields, in particular, to a user terminal-based interface rendering method and device, and a font adjustment method. BACKGROUND
[0002] To meet the user's use requirements and adapt to the needs of the aging population, mobile terminal applications need to support font adjustment of terminal display pages to improve text recognition and operation sensitivity, meet user use requirements and preference settings.
[0003] In the prior art, when adjusting the font of the display page of the mobile terminal application, the business personnel generally need to view the application program source code one by one, and manually modify the code for setting the font size. This adjustment method has high invasiveness to the original code, and has large workload, and is prone to omissions.
[0004] In view of the above problems, no effective solution has been proposed so far. SUMMARY
[0005] The embodiments of the present application provide a user terminal-based interface rendering method and device, and a font adjustment method, to at least solve the technical problem of high invasiveness to the original code and large workload caused by modifying the source code one by one to adjust the font in related technologies.
[0006] According to an aspect of an embodiment of the present application, a user terminal-based interface rendering method is provided, comprising: in response to a font adjustment request initiated by a user terminal, obtaining a font scaling factor; using a font setting interface of a target operating system to perform rule operation on the font scaling factor and a font size in a historical font strategy to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying a font on a terminal interface of the user terminal in a historical time period; exchanging a new font strategy to which the target font size belongs and the historical font strategy; and rendering a view element to be displayed on the terminal interface using the exchanged historical font strategy and the new font strategy, wherein the view element at least includes a font displayed according to the target font size.
[0007] Optionally, after responding to the font adjustment request initiated by the user terminal and obtaining the font scaling factor, it further includes: obtaining font setting information in the font adjustment request, wherein the font setting information includes at least one of the following: font weight symbol and corresponding font weight setting information, font size symbol and corresponding symbol parameter, font descriptor and corresponding font description information; adding a new font strategy corresponding to each font setting information.
[0008] Optionally, after adding the new font strategy corresponding to each font setting information, the method further comprises: analyzing whether the user terminal and the terminal interface are in a white list, wherein the white list stores terminal identifiers and interface identifiers that are allowed to adjust the font in the view element; and in a case where the user terminal and the terminal interface are in the white list, encapsulating the step of obtaining the font scaling coefficient as a preset font adjustment strategy.
[0009] Optionally, the step of performing rule operation on the font scaling coefficient and the font size in the historical font strategy by using a font setting interface of a target operating system to obtain a target font size comprises: inputting the preset font adjustment strategy into the font setting interface of the target operating system; calling the preset font adjustment strategy in an implementation body of each new font strategy by using the font setting interface of the target operating system to obtain the font scaling coefficient, wherein the new font strategy comprises a strategy name and the implementation body, and the implementation body is an encapsulated class that can be called by the target operating system to display a target font on the terminal interface; and performing rule operation on the font scaling coefficient and the font size of a historical font in the historical font strategy to obtain the target font size.
[0010] Optionally, after obtaining the target font size, the method further comprises: based on the target font size in the new font strategy, calling an implementation body in the historical font strategy to perform scaling processing on the historical font.
[0011] Optionally, the step of exchanging the new font strategy to which the target font size belongs and the historical font strategy comprises: exchanging an implementation body of the new font strategy to which the target font size belongs and an implementation body in the historical font strategy after a preset exchange condition is met, wherein the preset exchange condition at least comprises an exchange time point.
[0012] Optionally, the step of rendering the view element to be displayed on the terminal interface by using the exchanged historical font strategy and the new font strategy comprises: based on the exchanged historical font strategy, performing font dynamic adjustment on a first type of view element on the terminal interface, wherein the first type of view element is a view element that needs to be subjected to font dynamic adjustment.
[0013] Optionally, the interface rendering method further comprises: based on the exchanged new font strategy, performing font fixed operation on a second type of view element on the terminal interface, wherein the second type of view element is a view element that does not need to be subjected to font dynamic adjustment.
[0014] According to another aspect of the embodiments of the present application, a user terminal-based font adjustment method is also provided, comprising: in response to a font adjustment request initiated by a user terminal, obtaining a font scaling factor; performing a rule operation on the font scaling factor and font sizes in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on a terminal interface of the user terminal in a historical time period; exchanging a new font strategy to which the target font size belongs with the historical font strategy; dynamically adjusting a first type of font on the terminal interface based on the exchanged historical font strategy, wherein the first type of font refers to a font that needs to be dynamically adjusted; and fixing a second type of font on the terminal interface based on the exchanged new font strategy, wherein the second type of font refers to a font that does not need to be dynamically adjusted.
[0015] According to another aspect of the embodiments of the present application, a user terminal-based interface rendering device is also provided, comprising: a first obtaining unit configured to, in response to a font adjustment request initiated by a user terminal, obtain a font scaling factor; a first operation unit configured to perform a rule operation on the font scaling factor and font sizes in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on a terminal interface of the user terminal in a historical time period; a first exchanging unit configured to exchange a new font strategy to which the target font size belongs with the historical font strategy; and a rendering unit configured to render a view element to be displayed on the terminal interface by using the exchanged historical font strategy and the new font strategy, wherein the view element at least includes a font displayed according to the target font size.
[0016] Optionally, the first obtaining unit comprises: a first obtaining module configured to obtain font setting information in the font adjustment request, wherein the font setting information comprises at least one of the following: a font weight symbol and corresponding font weight setting information, a font size symbol and corresponding font size parameter, and a font descriptor and corresponding font description information; and a first adding module configured to add a new font strategy corresponding to each of the font setting information.
[0017] Optionally, the first obtaining unit further comprises: a first analysis module configured to analyze whether the user terminal and the terminal interface are in a white list, wherein the white list stores terminal identifiers and interface identifiers that are allowed to adjust fonts in view elements; and a first packaging module configured to, in a case where the user terminal and the terminal interface are in the white list, package the step of obtaining the font scaling factor as a preset font adjustment strategy.
[0018] Optionally, the first operation unit comprises: a first input module, configured to input the preset font adjustment strategy into a font setting interface of the target operating system; a first calling module, configured to call the preset font adjustment strategy in an implementation body of each new font strategy by using the font setting interface of the target operating system, to obtain the font scaling coefficient, wherein the new font strategy comprises a strategy name and the implementation body, and the implementation body refers to an encapsulated class capable of being called by the target operating system to display a target font on the terminal interface; and a first operation module, configured to perform rule operation on the font scaling coefficient and a font size of a historical font in the historical font strategy, to obtain the target font size.
[0019] Optionally, the first operation unit further comprises: a first processing module, configured to perform scaling processing on the historical font by calling an implementation body in the historical font strategy based on the target font size in the new font strategy.
[0020] Optionally, the first exchange unit comprises: a first exchange module, configured to exchange an implementation body of a new font strategy to which the target font size belongs and an implementation body in the historical font strategy after a preset exchange condition is met, wherein the preset exchange condition at least comprises an exchange time point.
[0021] Optionally, the rendering unit comprises: a first adjustment module, configured to perform font dynamic adjustment on a first type of view element on the terminal interface based on the exchanged historical font strategy, wherein the first type of view element refers to a view element that needs to be subjected to font dynamic adjustment.
[0022] Optionally, the terminal-based interface rendering apparatus further comprises: a first fixing module, configured to perform font fixing operation on a second type of view element on the terminal interface based on the exchanged new font strategy, wherein the second type of view element refers to a view element that does not need to be subjected to font dynamic adjustment.
[0023] According to another aspect of the embodiments of the present application, there is also provided a user terminal based font adjustment apparatus, comprising: a second obtaining unit configured to obtain a font scaling factor in response to a font adjustment request initiated by a user terminal; a second operation unit configured to perform a rule operation on the font scaling factor and a font size in a historical font policy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font policy refers to a policy for displaying a font on a terminal interface of the user terminal in a historical time period; a second exchanging unit configured to exchange a new font policy to which the target font size belongs with the historical font policy; an adjustment unit configured to dynamically adjust a first type of font on the terminal interface based on the exchanged historical font policy, wherein the first type of font refers to a font that needs to be dynamically adjusted; and a fixing unit configured to fix a second type of font on the terminal interface based on the exchanged new font policy, wherein the second type of font refers to a font that does not need to be dynamically adjusted.
[0024] According to another aspect of the embodiments of the present application, there is also provided a computer readable storage medium comprising a stored computer program, wherein the computer program, when executed, controls a device in which the computer readable storage medium is located to perform any of the above user terminal based interface rendering methods or the above user terminal based font adjustment method.
[0025] According to another aspect of the embodiments of the present application, there is also provided an electronic device comprising one or more processors and memory, the memory configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the above user terminal based interface rendering methods or the above user terminal based font adjustment method.
[0026] In the present disclosure, the following steps are adopted: in response to a font adjustment request initiated by a user terminal, a font scaling factor is obtained; a rule operation is performed on the font scaling factor and a font size in a historical font policy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font policy refers to a policy for displaying a font on a terminal interface of the user terminal in a historical time period; a new font policy to which the target font size belongs is exchanged with the historical font policy; and the exchanged historical font policy and the new font policy are used to render a view element to be displayed on the terminal interface, wherein the view element at least includes a font displayed according to the target font size.
[0027] In the present disclosure, the font size to be adjusted is calculated by the font scaling factor and the font size in the historical font strategy, the font size is uniformly adjusted based on the historical font strategy and the new font strategy, the dynamic adjustment of the font is realized at low cost, the user use demand and preference setting are well met, and the font adjustment is realized in a non-invasive manner through unified modification, the workload of the business personnel for font adjustment is greatly reduced, and thus the technical problem that the original code is highly invasive and the workload is large due to the adjustment of the font by modifying the source code one by one in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0029] Figure 1 is a flowchart of an optional user terminal-based interface rendering method according to an embodiment of the present application;
[0030] Figure 2 is a user font size preference setting page schematic diagram according to an embodiment of the present application;
[0031] Figure 3 is a principle diagram of an optional user terminal-based font adjustment method according to an embodiment of the present application;
[0032] Figure 4 is a flowchart of an optional user terminal-based font adjustment method according to an embodiment of the present application;
[0033] Figure 5 is a schematic diagram of an optional user terminal-based interface rendering device according to an embodiment of the present application;
[0034] Figure 6 is a schematic diagram of an optional user terminal-based font adjustment device according to an embodiment of the present application;
[0035] Figure 7 is a hardware structure block diagram of an electronic device (or mobile device) of a user terminal-based font adjustment method according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to better understand the technical scheme of the present application by those skilled in the art, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0037] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0038] It should be noted that the user terminal-based interface rendering method and device in the present disclosure can be used in the case of rendering a user terminal page in the field of financial technology, and can also be used in the case of rendering a user terminal page in any field other than the field of financial technology. The application field of the user terminal-based interface rendering method and device in the present disclosure is not limited.
[0039] It should be noted that the related information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties. For example, an interface is provided between the system and the related user or institution. Before obtaining the related information, the interface needs to send a request for obtaining to the aforementioned user or institution, and after receiving the consent information fed back by the aforementioned user or institution, the related information is obtained.
[0040] The present application can be applied to various interface rendering devices / products / systems (for example, various mobile terminals, PC terminals, chat software, shopping software), the font size to be adjusted is obtained through the font scaling factor, the font size is uniformly adjusted based on the historical font strategy and the new font strategy, and the dynamic adjustment of the font is realized in a non-intrusive and low-cost manner, which well meets the user's use demand and preference setting, and is liberated from modifying the original code one by one through the unified modification manner, thereby reducing the font adjustment workload.
[0041] The application will be described in detail below in connection with various embodiments.
[0042] Embodiment one
[0043] According to the embodiments of the present application, a method for rendering user terminal-based interface is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0044] Figure 1 is a flowchart of an optional method for rendering user terminal-based interface according to the embodiments of the present application, as shown in Figure 1 , the method comprises the following steps:
[0045] Step S101, in response to a font adjustment request initiated by the user terminal, obtaining a font scaling factor;
[0046] Step S102, using the font setting interface of the target operating system to perform rule operation on the font scaling factor and the font size in the historical font strategy to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on the terminal interface of the user terminal in a historical time period;
[0047] Step S103, exchanging the new font strategy to which the target font size belongs with the historical font strategy;
[0048] Step S104, using the exchanged historical font strategy and the new font strategy to render the view element to be displayed on the terminal interface, wherein the view element at least includes a font displayed according to the target font size.
[0049] By the above steps, first, in response to the font adjustment request initiated by the user terminal, the font scaling factor is obtained, and then the font scaling factor is calculated with the font size in the historical font strategy by using the font setting interface of the target operating system to obtain the target font size, wherein the historical font strategy refers to the strategy for displaying the font on the terminal interface of the user terminal in the historical time period, and then the new font strategy to which the target font size belongs is exchanged with the historical font strategy, and finally the historical font strategy and the new font strategy after the exchange are used to render the view element to be displayed on the terminal interface, wherein the view element at least includes: the font displayed according to the target font size. In this embodiment, the font size that needs to be adjusted is calculated by the font scaling factor and the font size in the historical font strategy, and the font size is uniformly adjusted based on the historical font strategy and the new font strategy, so that the dynamic adjustment of the font is realized at low cost, the user's use demand and preference setting are well met, and the font adjustment workload of the business personnel is greatly reduced in a non-intrusive manner by the unified modification manner, thereby solving the technical problems of high invasiveness and large workload of the original code caused by adjusting the font by modifying the source code one by one in the related art.
[0050] The above steps will be described in detail below.
[0051] First of all, it should be pointed out that the implementation body and the method body involved in this embodiment are one meaning. In the font strategy (or called font method), generally, the method name and the implementation body are included, that is, after the method name of the strategy is defined, the content of the implementation body (in the compilation process, generally, the content of the implementation body is represented by a pair of braces) is introduced to realize the dynamic adjustment of the font.
[0052] Step S101, in response to the font adjustment request initiated by the user terminal, the font scaling factor is obtained.
[0053] It should be pointed out that the user terminal is taken as the implementation subject in the embodiment of the application, and the user terminal includes but is not limited to: a mobile phone, a PC terminal, an iPad, a drawing display, and the like. In the process of using the terminal by the user, the application interface applied to the user terminal, such as a financial APP, a chat APP and the like, has the user preference setting demand, and the user can adjust the page font, page picture, page background and the like according to the own demand. The embodiment of the application takes the financial APP font size adjustment as an example for illustration, as shown in Figure 2 , Figure 2It is a user font size preference setting page schematic diagram according to an embodiment of the application, when the user modifies the font on the terminal preference setting interface, the page will display my account, remittance, investment and finance, exclusive deposit, family account, all font and corresponding pictures, and click button, for switching the text size, the user clicks the button according to the demand, will display "set, will change the font size of APP home page, my account, remittance, etc. If there is any problem in the use process, please feedback to our bank" prompt, and the user can observe the change of the font in real time according to the content displayed on the preference setting page, until the font that meets the demand of itself is selected. When receiving the event notification of the user's modification of the font size preference setting, the corresponding font size scaling factor is stored in the specified position accessible globally, for example, the setting standard corresponds to the scaling factor 1, the setting reduction corresponds to the scaling factor less than 1, and the setting enlargement corresponds to the scaling factor 2.
[0054] In the embodiment of the application, after obtaining the font scaling factor in response to the font adjustment request initiated by the user terminal, the method further comprises: obtaining font setting information in the font adjustment request, wherein the font setting information comprises at least one of the following: font weight symbol and corresponding font weight setting information, font size symbol and corresponding symbol parameter, font descriptor and corresponding font description information; adding a new font strategy corresponding to each font setting information.
[0055] It should be noted that when adjusting the font size, the font weight, font size, font descriptor and other aspects of the font information will be involved, wherein the font weight is used to indicate the thickness of the font, the thicker the font, the larger the font weight, and the most common ones are standard body and bold body; The font size directly indicates the size of the font, for example, 10, 12, etc., and the font descriptor is used to describe and specify the basic information of the font, for example, font-family_name is used to specify the name of the font, and font-style_ormal is used to describe the style of the font.
[0056] Since different operating systems do not have the same symbols set by the font, different symbol description methods need to be set for different terminal operating systems, for example, for the ios operating system, the font weight is represented by [UIFont systemFontOfSize:weight:], the font size is represented by [UIFont systemFontOfSize:], the font descriptor is represented by [UIFont fontWithDescriptor:size:], the default font is represented by [UIFont systemFontOfSize:], the bold font is represented by [UIFont boldSystemFontOfSize:], and the italic font is represented by [UIFont italicSystemFontOfSize:].
[0057] In the embodiment of the application, after adding the new font strategy corresponding to each font setting information, the user terminal and the terminal interface are analyzed to determine whether they are in a whitelist list, wherein the whitelist list stores terminal identifiers and interface identifiers that are allowed to adjust the font in the view element; and in the case that the user terminal and the terminal interface are in the whitelist list, the step of obtaining the font scaling coefficient is encapsulated as a preset font adjustment strategy.
[0058] It should be noted that when the font is dynamically adjusted, a strategy for obtaining a font size scaling coefficient needs to be encapsulated, in which the user-set font size scaling coefficient is read, and it is determined whether the current mobile phone model and the current page are in a whitelist list that requires font dynamic adjustment; if they are in the whitelist list, the user-set scaling coefficient is returned, and the adjustment is performed according to the scaling coefficient; if they are not in the whitelist list, the default coefficient 1 is returned, and the font size cannot be adjusted.
[0059] In step S102, the font scaling coefficient is subjected to rule operation with the font size in the historical font strategy by using the font setting interface of the target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying the font on the terminal interface of the user terminal in a historical time period.
[0060] Optionally, the type of rule operation provided in the embodiment can include, but is not limited to, multiplication, addition, and subtraction, and the embodiment is illustratively described by using multiplication.
[0061] In the embodiment of the present application, the step of obtaining the target font size by performing rule operation on the font scaling factor and the font size in the historical font strategy by using the font setting interface of the target operating system comprises: inputting the preset font adjustment strategy into the font setting interface of the target operating system; obtaining the font scaling factor by calling the preset font adjustment strategy in the implementation body of each new font strategy by using the font setting interface of the target operating system, wherein the new font strategy comprises a strategy name and an implementation body, and the implementation body refers to an encapsulated class that can be called by the target operating system to display the target font on the terminal interface; and performing rule operation on the font scaling factor and the font size of the historical font in the historical font strategy to obtain the target font size.
[0062] Optionally, the font setting interface of the target operating system in the embodiment of the present application can refer to an interface corresponding to the UIFont class used in the iOS operating system.
[0063] It should be noted that, Figure 3 is a schematic diagram of an optional user terminal-based font adjustment method according to the embodiment of the present application, as Figure 3 shown, when obtaining a new font strategy, in the implementation body of each new font strategy, the encapsulated strategy for obtaining the scaling factor is first called, and then the old font strategy (corresponding to the historical font strategy) is called, and then the strategy return value is multiplied by the font size in the old font strategy to obtain the scaled font size. In the embodiment of the present application, after obtaining the target font size, the implementation body of the historical font strategy is further called to perform scaling processing on the historical font based on the target font size in the new font strategy. That is, after multiplying the strategy return value by the font size in the old font strategy to obtain the scaled font size, the implementation body of the old font strategy is called to scale the font according to the scaled font size in the new font strategy.
[0064] Step S103: exchanging the new font strategy to which the target font size belongs and the historical font strategy.
[0065] In the embodiment of the present application, the step of exchanging the new font strategy to which the target font size belongs and the historical font strategy comprises: exchanging the implementation body of the new font strategy to which the target font size belongs and the implementation body in the historical font strategy after a preset exchange condition is met, wherein the preset exchange condition at least comprises an exchange time point.
[0066] For example, by using the dynamic runtime feature of the iOS operating system, the implementation bodies (also referred to as method bodies) of the two sets of new font strategies and the old font strategy are exchanged in the +(void)load method (used to determine the exchange opportunity (i.e., the aforementioned exchange time point) and implement the loading of a class) of the UIFont class.
[0067] In step S104, the exchanged historical font strategy and the new font strategy are used to render a view element to be displayed on a terminal interface, wherein the view element at least includes a font displayed according to a target font size.
[0068] In the embodiment of the present application, the step of rendering the view element to be displayed on the terminal interface by using the exchanged historical font strategy and the new font strategy includes: performing font dynamic adjustment on a first type of view element on the terminal interface based on the exchanged historical font strategy, wherein the first type of view element refers to a view element that needs to be dynamically adjusted in font.
[0069] Optionally, the view element can be a view applied to a mobile phone APP, a PC end Web interface, and the like, and the view element includes but is not limited to a picture, a note, a symbol, and a character.
[0070] It should be noted that the view element that needs to be dynamically adjusted in font is kept to use the historical font strategy to achieve dynamic adjustment of the font size.
[0071] Optionally, the interface rendering method further includes: performing font fixing operation on a second type of view element on the terminal interface based on the exchanged new font strategy, wherein the second type of view element refers to a view element that does not need to be dynamically adjusted in font.
[0072] It should be noted that the view element that does not need to be dynamically adjusted in font can be implemented to have a fixed font size by calling the new font strategy.
[0073] Through the above embodiment, the font size that needs to be adjusted is obtained through the font scaling coefficient, the historical font strategy and the new font strategy are used to uniformly adjust the font size, the dynamic adjustment of the font is realized in a non-intrusive and low-cost manner, the use demand and preference setting of the user are well met, and the uniform modification manner is used to release from modifying the original code one by one, thereby reducing the font adjustment workload, and further solving the technical problem that the original code is highly intrusive and has a large workload in the related art by modifying the source code one by one to adjust the font.
[0074] The present application will be described in detail below in combination with another optional embodiment.
[0075] Embodiment Two
[0076] According to the embodiment of the present application, a method embodiment for adjusting font based on a user terminal is further provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0077] Figure 4 is a flow chart of an optional user terminal-based font adjustment method according to an embodiment of the present application, as shown in the figure, the method comprises the following steps: Figure 4
[0078] In step S401, a font scaling factor is obtained in response to a font adjustment request initiated by the user terminal.
[0079] In step S402, the font scaling factor is subjected to rule operation with font sizes in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on a terminal interface of the user terminal in a historical time period.
[0080] In step S403, a new font strategy to which the target font size belongs is exchanged with the historical font strategy.
[0081] In step S404, a first type of font on the terminal interface is dynamically adjusted based on the exchanged historical font strategy, wherein the first type of font refers to a font that needs to be dynamically adjusted.
[0082] In step S405, a second type of font on the terminal interface is fixed based on the exchanged new font strategy, wherein the second type of font refers to a font that does not need to be dynamically adjusted.
[0083] Through the above steps, in response to a font adjustment request initiated by the user terminal, a font scaling factor is obtained; the font scaling factor is subjected to rule operation with font sizes in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on a terminal interface of the user terminal in a historical time period; a new font strategy to which the target font size belongs is exchanged with the historical font strategy; a first type of font on the terminal interface is dynamically adjusted based on the exchanged historical font strategy, wherein the first type of font refers to a font that needs to be dynamically adjusted; and a second type of font on the terminal interface is fixed based on the exchanged new font strategy, wherein the second type of font refers to a font that does not need to be dynamically adjusted. In the embodiment of the present application, a font size that needs to be adjusted is calculated based on a font scaling factor and font sizes in a historical font strategy, and the font size is uniformly adjusted based on the historical font strategy and a new font strategy, thereby achieving dynamic adjustment of the font at low cost, well meeting user usage requirements and preference settings, and achieving font adjustment in a non-intrusive manner through unified modification, thereby greatly reducing the workload of business personnel for font adjustment, and further solving the technical problem in the related art that high invasiveness and heavy workload are caused in adjusting the font by modifying the source code one by one.
[0084] The following section will explain in detail each of the above implementation steps.
[0085] Step S401: Respond to the font adjustment request initiated by the user terminal and obtain the font scaling factor.
[0086] It should be noted that the embodiments of the present invention use a user terminal as the implementation subject. This user terminal includes, but is not limited to, mobile phones, PCs, iPads, and drawing displays. During user operation, the application interfaces on the user terminal, such as financial apps and chat apps, have user preference settings. Users can adjust page fonts, images, backgrounds, etc., according to their own needs. The embodiments of the present invention illustrate the adjustment of font size in a financial app, as shown below. Figure 2 As shown, when a user modifies the font on the terminal preference settings interface, the page displays fonts and corresponding images for categories such as My Account, Transfers & Remittances, Investment & Wealth Management, Dedicated Deposits, Family Accounts, and All, as well as buttons for switching text sizes. Clicking a button displays a message stating, "After setting, the font size of the APP homepage, My Account, Transfers & Remittances, and other pages will change. If you encounter any problems during use, please provide feedback to our bank." Users can observe the font changes in real-time based on the content displayed on the preference settings page until they select a font that meets their needs. When an event notification is received regarding a user modifying the font size preference setting, the corresponding font size scaling factor is stored in a globally accessible specified location. For example, setting "Standard" corresponds to a scaling factor of 1, setting "Shrink" corresponds to a scaling factor less than 1, and setting "Enlarge" corresponds to a scaling factor of 4.
[0087] In this embodiment of the invention, after responding to a font adjustment request initiated by a user terminal and obtaining the font scaling factor, the method further includes: obtaining font setting information in the font adjustment request, wherein the font setting information includes at least one of the following: weight symbol and corresponding weight setting information, font size symbol and corresponding symbol parameter, font descriptor and corresponding font description information; and adding a new font strategy corresponding to each font setting information.
[0088] It should be noted that adjusting font size involves multiple aspects of font information, such as font weight, font size, and font descriptor. Font weight indicates the thickness of the font; the thicker the font, the greater the weight. The most common types are standard and bold. Font size directly indicates the size of the font, such as 10-point or 14-point. Font descriptor describes and specifies the basic information of the font. For example, font-family_name specifies the name of the font, and font-style_ormal describes the style of the font.
[0089] Since different operating systems do not have the same symbols set by the font, different symbol description methods need to be set for different terminal operating systems, for example, for the ios operating system, the font weight is represented by [UIFont systemFontOfSize:weight:], the font size is represented by [UIFont systemFontOfSize:], the font descriptor is represented by [UIFont fontWithDescriptor:size:], the default font is represented by [UIFont systemFontOfSize:], the bold font is represented by [UIFont boldSystemFontOfSize:], and the italic font is represented by [UIFont italicSystemFontOfSize:].
[0090] In the embodiment of the application, after adding the new font strategy corresponding to each font setting information, the user terminal and the terminal interface are analyzed to determine whether they are in a whitelist list, wherein the whitelist list stores terminal identifiers and interface identifiers that are allowed to adjust the font in the view element; and in the case that the user terminal and the terminal interface are in the whitelist list, the step of obtaining the font scaling coefficient is encapsulated as a preset font adjustment strategy.
[0091] It should be noted that when the font is dynamically adjusted, a strategy for obtaining a font size scaling coefficient needs to be encapsulated, in which the user-set font size scaling coefficient is read, and it is determined whether the current mobile phone model and the current page are in a whitelist list that requires font dynamic adjustment; if they are in the whitelist list, the user-set scaling coefficient is returned, and the adjustment is performed according to the scaling coefficient; if they are not in the whitelist list, the default coefficient 1 is returned, and the font size cannot be adjusted.
[0092] In step S402, the font scaling coefficient is subjected to rule operation with the font size in the historical font strategy by using the font setting interface of the target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying the font on the terminal interface of the user terminal in a historical time period.
[0093] Optionally, the type of rule operation provided in the embodiment can include, but is not limited to, multiplication, addition, and subtraction, and the embodiment is illustratively described by using multiplication.
[0094] In the embodiment of the present application, the step of performing rule operation on the font scaling factor and the font size in the historical font strategy to obtain the target font size includes: inputting the preset font adjustment strategy into the font setting interface of the target operating system; calling the preset font adjustment strategy in each implementation body of the new font strategy by using the font setting interface of the target operating system to obtain the font scaling factor, wherein the new font strategy includes a strategy name and an implementation body, and the implementation body refers to an encapsulated class that can be called by the target operating system to display the target font on the terminal interface; and performing rule operation on the font scaling factor and the font size of the historical font in the historical font strategy to obtain the target font size.
[0095] Optionally, the font setting interface of the target operating system in the embodiment can refer to an interface corresponding to the UIFont class used in the iOS operating system.
[0096] It should be noted that, as shown in Figure 3 In the embodiment of the present application, after obtaining the target font size, the step further includes: performing scaling processing on the historical font by calling the implementation body of the historical font strategy based on the target font size in the new font strategy. That is, after multiplying the strategy return value by the font size in the old font strategy to obtain the scaled font size, the embodiment can call the implementation body of the old font strategy to scale the font according to the scaled font size in the new font strategy.
[0097] In step S403, the new font strategy to which the target font size belongs is exchanged with the historical font strategy.
[0098] In the embodiment of the present application, the step of exchanging the new font strategy to which the target font size belongs with the historical font strategy includes: exchanging the implementation body of the new font strategy to which the target font size belongs with the implementation body in the historical font strategy after a preset exchange condition is met, wherein the preset exchange condition at least includes an exchange time point.
[0099] For example, by using the dynamic runtime feature of the iOS operating system, the implementation bodies (also referred to as method bodies) of the two sets of new font strategies and the old font strategy are exchanged in the +(void)load method (used to determine the exchange timing (i.e., the aforementioned exchange time point) and implement the loading of a class) of the UIFont class.
[0100] In step S404, the first type of font on the terminal interface is dynamically adjusted based on the exchanged historical font strategy, wherein the first type of font refers to the font that needs to be dynamically adjusted.
[0101] It should be noted that the view element that needs to be dynamically adjusted is kept using the historical font strategy to achieve dynamic adjustment of the font size, and the view element can be a view applied to a mobile phone APP, a PC end Web interface, and the like, and the view element includes but is not limited to a picture, a note, a symbol, and a character. In this embodiment, the first type of font and the second type of font are used for illustrative purposes.
[0102] In step S405, the second type of font on the terminal interface is fixed based on the exchanged new font strategy, wherein the second type of font refers to the font that does not need to be dynamically adjusted.
[0103] It should be noted that when the font is adjusted, there can be fonts that can be adjusted and fonts that cannot be adjusted. The view element that needs to be dynamically adjusted is kept using the exchanged historical font strategy to achieve dynamic adjustment of the font size. A few view elements that do not need to be dynamically adjusted can be adjusted by calling the new font strategy to achieve a fixed font size.
[0104] Through the above embodiment, the font size that needs to be adjusted is obtained through the font scaling coefficient, the historical font strategy and the new font strategy are used to uniformly adjust the font size, the dynamic adjustment of the font is realized in a non-intrusive and low-cost manner, the user's use demand and preference setting are well met, and the font adjustment workload is reduced by the unified modification manner, thereby solving the technical problem that the original code is highly invasive and the workload is large in the related art by adjusting the font by modifying the source code one by one.
[0105] The application will be described in detail below with reference to another alternative embodiment.
[0106] Embodiment Three
[0107] The embodiment provides a user terminal-based interface rendering device, and each implementation unit included in the user terminal-based interface rendering device corresponds to each implementation step in the first embodiment.
[0108] Figure 5 is a schematic diagram of an alternative user terminal-based interface rendering device according to an embodiment of the application, as shown in Figure 5 The user terminal-based interface rendering device includes a first acquisition unit 51, a first calculation unit 52, a first exchange unit 53, and a rendering unit 54, wherein
[0109] The first obtaining unit 51 is configured to obtain a font scaling factor in response to a font adjustment request initiated by the user terminal.
[0110] The first operation unit 52 is configured to perform a rule operation on the font scaling factor and a font size in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on a terminal interface of the user terminal in a historical time period.
[0111] The first exchange unit 53 is configured to exchange a new font strategy to which the target font size belongs with the historical font strategy.
[0112] The rendering unit 54 is configured to render a view element to be displayed on the terminal interface by using the exchanged historical font strategy and the new font strategy, wherein the view element at least includes a font displayed according to the target font size.
[0113] The above-mentioned interface rendering apparatus based on the user terminal, by the first obtaining unit 51, obtains a font scaling factor in response to a font adjustment request initiated by the user terminal; by the first operation unit 52, performs a rule operation on the font scaling factor and a font size in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying fonts on a terminal interface of the user terminal in a historical time period; by the first exchange unit, exchanges a new font strategy to which the target font size belongs with the historical font strategy; and by the rendering unit 54, renders a view element to be displayed on the terminal interface by using the exchanged historical font strategy and the new font strategy, wherein the view element at least includes a font displayed according to the target font size. In this embodiment, the font size to be adjusted is calculated by the font scaling factor and the font size in the historical font strategy, the font size is uniformly adjusted based on the historical font strategy and the new font strategy, the dynamic adjustment of the font is realized at low cost, the use demand and preference setting of the user are well met, and the font is adjusted in a non-invasive manner by the unified modification, thereby greatly reducing the workload of the business personnel for font adjustment, and further solving the technical problems of high invasiveness and large workload of the original code caused by adjusting the font by modifying the source code one by one in the related art.
[0114] Optionally, the first obtaining unit 51 includes a first obtaining module configured to obtain font setting information in the font adjustment request, wherein the font setting information includes at least one of the following: a font weight symbol and corresponding font weight setting information, a font size symbol and corresponding font size parameter, and a font descriptor and corresponding font description information; and a first adding module configured to add a new font strategy corresponding to each font setting information.
[0115] Optionally, the first obtaining unit 51 further comprises a first analysis module configured to analyze whether the user terminal and the terminal interface are in a white list, wherein the white list stores terminal identifiers and interface identifiers that are allowed to adjust the font in the view element; and a first encapsulation module configured to encapsulate the step of obtaining the font scaling coefficient as a preset font adjustment strategy in the case that the user terminal and the terminal interface are in the white list.
[0116] Optionally, the first operation unit 52 comprises a first transmission module configured to transmit the preset font adjustment strategy to a font setting interface of the target operating system; a first calling module configured to call the preset font adjustment strategy in an implementation body of each new font strategy by using the font setting interface of the target operating system, to obtain the font scaling coefficient, wherein the new font strategy comprises a strategy name and an implementation body, and the implementation body refers to an encapsulated class that can be called by the target operating system to display the target font on the terminal interface; and a first operation module configured to perform rule operation on the font scaling coefficient and the font size of the historical font in the historical font strategy, to obtain the target font size.
[0117] Optionally, the first operation unit 52 further comprises a first processing module configured to perform scaling processing on the historical font by calling the implementation body in the historical font strategy based on the target font size in the new font strategy.
[0118] Optionally, the first exchange unit 53 comprises a first exchange module configured to exchange the implementation body of the new font strategy to which the target font size belongs and the implementation body in the historical font strategy after a preset exchange condition is met, wherein the preset exchange condition at least comprises an exchange time point.
[0119] Optionally, the rendering unit 54 comprises a first adjustment module configured to perform font dynamic adjustment on the first type of view element on the terminal interface based on the exchanged historical font strategy, wherein the first type of view element refers to the view element that needs to be dynamically adjusted.
[0120] Optionally, the interface rendering apparatus based on the user terminal further comprises a first fixing module configured to perform font fixing operation on the second type of view element on the terminal interface based on the exchanged new font strategy, wherein the second type of view element refers to the view element that does not need to be dynamically adjusted.
[0121] Figure 6 is a schematic diagram of an optional font adjustment apparatus based on a user terminal according to an embodiment of the present application, as shown in Figure 6 , which comprises a second obtaining unit 61, a second operation unit 62, a second exchange unit 63, an adjustment unit 64, and a fixing unit 65, wherein
[0122] The second obtaining unit 61 is configured to obtain a font scaling factor in response to a font adjustment request initiated by the user terminal;
[0123] The second operation unit 62 is configured to perform a rule operation on the font scaling factor and a font size in a historical font strategy by using a font setting interface of a target operating system to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying a font on a terminal interface of the user terminal in a historical time period.
[0124] The second exchange unit 63 is configured to exchange a new font strategy to which the target font size belongs with the historical font strategy.
[0125] The adjustment unit 64 is configured to dynamically adjust a first type of font on the terminal interface based on the exchanged historical font strategy, wherein the first type of font refers to a font that needs to be dynamically adjusted.
[0126] The fixing unit 65 is configured to fix a second type of font on the terminal interface based on the exchanged new font strategy, wherein the second type of font refers to a font that does not need to be dynamically adjusted.
[0127] The above font adjustment device based on the user terminal obtains the font scaling factor in response to the font adjustment request initiated by the user terminal through the second obtaining unit 61, performs the rule operation on the font scaling factor and the font size in the historical font strategy by using the font setting interface of the target operating system through the second operation unit 62 to obtain the target font size, wherein the historical font strategy refers to the strategy for displaying the font on the terminal interface of the user terminal in the historical time period. The second exchange unit 63 exchanges the new font strategy to which the target font size belongs with the historical font strategy. The adjustment unit 64 dynamically adjusts the first type of font on the terminal interface based on the exchanged historical font strategy, wherein the first type of font refers to the font that needs to be dynamically adjusted. The fixing unit 65 fixes the second type of font on the terminal interface based on the exchanged new font strategy, wherein the second type of font refers to the font that does not need to be dynamically adjusted.
[0128] In the embodiment, the font size that needs to be adjusted is calculated by the font scaling factor and the font size in the historical font strategy, the font size is uniformly adjusted based on the historical font strategy and the new font strategy, the dynamic adjustment of the font is realized at low cost, the use demand and the preference setting of the user are well met, the unified modification is used to liberate from modifying the original code one by one, the font adjustment is realized in a non-invasive manner, the work load of the business personnel is greatly reduced, and thus the technical problem that the original code is highly invasively modified and the work load is large in the related art is solved.
[0129] The user terminal-based interface rendering apparatus described above can further include a processor and a memory, and the first acquisition unit 51, the first calculation unit 52, the first exchange unit 53, and the rendering unit 54 are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.
[0130] The processor described above includes a core, and the core calls the corresponding program units in the memory. The core can be one or more, and the user terminal interface is rendered by adjusting the core parameters.
[0131] The memory described above can include a non-permanent memory in a computer readable medium, a random access memory (RAM), and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one memory chip.
[0132] According to another aspect of the embodiments of the present application, a computer readable storage medium including a stored computer program is also provided, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to perform the user terminal-based interface rendering method or the user terminal-based font adjustment method described above when the computer program is running.
[0133] According to another aspect of the embodiments of the present application, an electronic device is also provided, including one or more processors and a memory, and the memory is used to store one or more programs, wherein the one or more programs make the one or more processors realize the user terminal-based interface rendering method or the user terminal-based font adjustment method described above when the one or more programs are executed by the one or more processors.
[0134] The present application also provides a computer program product adapted to execute the program with the following method steps when executed on a data processing device: in response to a font adjustment request initiated by a user terminal, acquiring a font scaling factor; using a font setting interface of a target operating system to perform a rule operation on the font scaling factor and a font size in a historical font strategy to obtain a target font size, wherein the historical font strategy refers to a strategy for displaying a font on a terminal interface of the user terminal in a historical time period; exchanging a new font strategy to which the target font size belongs and the historical font strategy; and rendering a view element to be displayed on the terminal interface using the exchanged historical font strategy and the new font strategy, wherein the view element at least includes a font displayed according to the target font size.
[0135] Figure 7 is a hardware structure block diagram of an electronic device (or a mobile device) according to the user terminal-based interface rendering method of the embodiments of the present application. As shown in Figure 7As shown, the electronic device can include one or more (shown in FIG. 7 as 702a, 702b, 702n) processors 702 (which can include, but are not limited to, processing devices such as microprocessors, MCUs, or programmable logic devices, FPGAs, etc.), a memory 704 for storing data. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art can understand that Figure 7 The structure shown is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the electronic device can also include more or fewer components than those shown in Figure 7 the above embodiment, or have a different configuration than that shown in the above embodiment. Figure 7
[0136] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0137] In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0138] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented by other ways. Among them, the above-mentioned device embodiments are only schematic, for example, the division of units can be a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0139] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed to multiple units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0140] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0141] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0142] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A user interface rendering method based on a user terminal, characterized in that, include: Respond to the font adjustment request initiated by the user terminal and obtain the font scaling factor; The target font size is obtained by performing a rule-based calculation on the font scaling factor and the font size in the historical font strategy using the font setting interface of the target operating system. The historical font strategy refers to the strategy for displaying fonts on the terminal interface of the user terminal during a historical period. Exchange the new font strategy to which the target font size belongs with the historical font strategy; The historical font strategy and the new font strategy after the exchange are used to render the view elements to be displayed on the terminal interface, wherein the view elements include at least: a font displayed according to the target font size; The step of obtaining the font scaling factor includes: passing a preset font adjustment strategy to the font setting interface of the target operating system; using the font setting interface of the target operating system to call the preset font adjustment strategy in the implementation of each new font strategy to obtain the font scaling factor, wherein the new font strategy includes: strategy name and implementation, the implementation refers to a wrapper class that can be called by the target operating system to display the target font on the terminal interface; The step of exchanging the new font strategy to which the target font size belongs with the historical font strategy includes: after satisfying the preset exchange conditions, exchanging the implementation of the new font strategy to which the target font size belongs with the implementation in the historical font strategy; The step of rendering view elements to be displayed on the terminal interface using the swapped historical font strategy and the new font strategy includes: dynamically adjusting the font of a first type of view element on the terminal interface based on the swapped historical font strategy, wherein the first type of view element refers to view elements that need to be dynamically adjusted in font; and fixing the font of a second type of view element on the terminal interface based on the swapped new font strategy, wherein the second type of view element refers to view elements that do not need to be dynamically adjusted in font.
2. The interface rendering method according to claim 1, characterized in that, After responding to a font adjustment request initiated by the user terminal and obtaining the font scaling factor, the process also includes: Obtain the font setting information in the font adjustment request, wherein the font setting information includes at least one of the following: weight symbol and corresponding weight setting information, font size symbol and corresponding symbol parameters, font descriptor and corresponding font description information; Add a new font strategy corresponding to each of the aforementioned font settings.
3. The interface rendering method according to claim 2, characterized in that, After adding a new font strategy corresponding to each of the aforementioned font settings, the following is also included: Analyze whether the user terminal and the terminal interface are in the whitelist list, wherein the whitelist list stores terminal identifiers and interface identifiers that allow adjustment of fonts in view elements; When the user terminal and the terminal interface are in the whitelist, the step of obtaining the font scaling factor is encapsulated as a preset font adjustment strategy.
4. The interface rendering method according to claim 3, characterized in that, The step of using the target operating system's font settings interface to perform a rule-based calculation between the font scaling factor and the font size in the historical font strategy to obtain the target font size includes: The target font size is obtained by performing a rule-based calculation between the font scaling factor and the font size of the historical font in the historical font strategy.
5. The interface rendering method according to claim 4, characterized in that, After obtaining the target font size, the following is also included: Based on the target font size in the new font strategy, the implementation of the historical font strategy is invoked to scale the historical font.
6. The interface rendering method according to claim 1, characterized in that, The step of exchanging the new font policy to which the target font size belongs with the historical font policy includes: The preset exchange conditions include at least the exchange time point.
7. A font adjustment method based on a user terminal, characterized in that, include: Respond to the font adjustment request initiated by the user terminal and obtain the font scaling factor; The target font size is obtained by performing a rule-based calculation on the font scaling factor and the font size in the historical font strategy using the font setting interface of the target operating system. The historical font strategy refers to the strategy for displaying fonts on the terminal interface of the user terminal during a historical period. Exchange the new font strategy to which the target font size belongs with the historical font strategy; Based on the historical font strategy after the exchange, the first type of font on the terminal interface is dynamically adjusted, wherein the first type of font refers to the font that needs to be dynamically adjusted. Based on the new font strategy after the exchange, the second type of font on the terminal interface is fixed, wherein the second type of font refers to a font that does not require dynamic font adjustment; The step of obtaining the font scaling factor includes: passing a preset font adjustment strategy to the font setting interface of the target operating system; using the font setting interface of the target operating system to call the preset font adjustment strategy in the implementation of each new font strategy to obtain the font scaling factor, wherein the new font strategy includes: strategy name and implementation, the implementation refers to a wrapper class that can be called by the target operating system to display the target font on the terminal interface; The step of exchanging the new font strategy to which the target font size belongs with the historical font strategy includes: after satisfying the preset exchange conditions, exchanging the implementation of the new font strategy to which the target font size belongs with the implementation in the historical font strategy.
8. A user interface rendering device based on a user terminal, characterized in that, include: The first acquisition unit is used to respond to the font adjustment request initiated by the user terminal and acquire the font scaling factor; The first calculation unit is used to perform a rule-based calculation on the font scaling factor and the font size in the historical font strategy using the font setting interface of the target operating system to obtain the target font size. The historical font strategy refers to the strategy for displaying fonts on the terminal interface of the user terminal during a historical period. The first exchange unit is used to exchange the new font strategy to which the target font size belongs with the historical font strategy; A rendering unit is used to render the view elements to be displayed on the terminal interface using the swapped historical font strategy and the new font strategy, wherein the view elements include at least: a font displayed according to the target font size; The first processing unit includes: a first input module, used to input a preset font adjustment strategy into the font setting interface of the target operating system; and a first calling module, used to call the preset font adjustment strategy in the implementation of each new font strategy using the font setting interface of the target operating system to obtain the font scaling factor, wherein the new font strategy includes: a strategy name and the implementation, and the implementation refers to a wrapper class that can be called by the target operating system to display the target font on the terminal interface; The first exchange unit includes: a first exchange module, used to exchange the implementation of the new font strategy to which the target font size belongs with the implementation in the historical font strategy after a preset exchange condition is met; The rendering unit includes: a first adjustment module, used to dynamically adjust the font of a first type of view element on the terminal interface based on the exchanged historical font strategy, wherein the first type of view element refers to the view element that needs to be dynamically adjusted in font. The first fixing module is used to fix the font of the second type of view elements on the terminal interface based on the new font strategy after the exchange, wherein the second type of view elements refers to view elements that do not require dynamic font adjustment.
9. A font adjustment device based on a user terminal, characterized in that, include: The second acquisition unit is used to respond to the font adjustment request initiated by the user terminal and acquire the font scaling factor; The second calculation unit is used to perform a rule-based calculation on the font scaling factor and the font size in the historical font strategy using the font setting interface of the target operating system to obtain the target font size. The historical font strategy refers to the strategy for displaying fonts on the terminal interface of the user terminal during a historical period. The second exchange unit is used to exchange the new font strategy to which the target font size belongs with the historical font strategy; An adjustment unit is used to dynamically adjust the first type of font on the terminal interface based on the historical font strategy after the exchange, wherein the first type of font refers to the font that needs to be dynamically adjusted. A fixing unit is used to fix the second type of font on the terminal interface based on the new font strategy after the exchange, wherein the second type of font refers to a font that does not require dynamic font adjustment; The step of obtaining the font scaling factor includes: passing a preset font adjustment strategy to the font setting interface of the target operating system; using the font setting interface of the target operating system to call the preset font adjustment strategy in the implementation of each new font strategy to obtain the font scaling factor, wherein the new font strategy includes: strategy name and implementation, the implementation refers to a wrapper class that can be called by the target operating system to display the target font on the terminal interface; The step of exchanging the new font strategy to which the target font size belongs with the historical font strategy includes: after satisfying the preset exchange conditions, exchanging the implementation of the new font strategy to which the target font size belongs with the implementation in the historical font strategy.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the user terminal-based interface rendering method according to any one of claims 1 to 6 or the user terminal-based font adjustment method according to claim 7.
11. An electronic device, characterized in that, The device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the user terminal-based interface rendering method of any one of claims 1 to 6 or the user terminal-based font adjustment method of claim 7.
Citation Information
Patent Citations
Method, device and system for zooming webpage fonts
CN104239326A
Dynamic zooming of content with overlays
US20140143652A1