[go: up one dir, main page]

CN110705210A - Chinese font loading method and device - Google Patents

Chinese font loading method and device Download PDF

Info

Publication number
CN110705210A
CN110705210A CN201910880595.7A CN201910880595A CN110705210A CN 110705210 A CN110705210 A CN 110705210A CN 201910880595 A CN201910880595 A CN 201910880595A CN 110705210 A CN110705210 A CN 110705210A
Authority
CN
China
Prior art keywords
font
work
format
packet
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910880595.7A
Other languages
Chinese (zh)
Inventor
黄金
刘纪军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhongwang Eqxiu Technology Co Ltd
Original Assignee
Beijing Zhongwang Eqxiu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhongwang Eqxiu Technology Co Ltd filed Critical Beijing Zhongwang Eqxiu Technology Co Ltd
Priority to CN201910880595.7A priority Critical patent/CN110705210A/en
Publication of CN110705210A publication Critical patent/CN110705210A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a Chinese font loading method and a Chinese font loading device, which are used for determining the font format of a work when a request of a user for browsing the work is received, wherein the font format is adopted when the work is edited; traversing all texts in the works, determining the Chinese texts belonging to the font format, extracting font files corresponding to each character in the Chinese texts from original font packets corresponding to the font format, processing each font file to obtain target font packets, returning the target font packets to a user browser, and triggering the user browser to display the works according to the target font packets.

Description

Chinese font loading method and device
Technical Field
The invention relates to the field of computers, in particular to a method and a device for loading Chinese fonts.
Background
With the formal identification and distribution of HTML5 (abbreviated as H5), WEB page works become an effective means for current internet marketing. A user creates a WEB page work based on H5, not only can simply and conveniently process multimedia content, but also can create a page with powerful functions, and the WEB page work can be quickly forwarded and spread through networked transmission. However, in the WEB page, the memory occupied by the Chinese character (Chinese) font is very large, and an original font packet containing tens of thousands of Chinese characters is particularly larger; moreover, at present, various font formats exist, and different font formats correspond to different original font packages.
At present, when a front end displays a WEB page work, multiple font files are generally required to be loaded for displaying the Chinese fonts in the work, however, an excessively large font packet often causes the WEB page loading speed to become slow, which is very unfavorable for the application of the Chinese fonts in the networked transmission.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a method for loading chinese fonts, which can be applied to various browsers; in constructing a WEB page work based on H5, by applying the method for loading chinese fonts provided by the embodiments of the present invention, a target font package to be loaded can be selected as needed in combination with reality.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a first aspect of an embodiment of the present invention provides a method for loading a chinese font, including:
when a request of a user for browsing a work is received, determining the font format of the work; the font format is adopted when the works are edited;
traversing all texts in the works to determine Chinese texts belonging to the font format;
extracting font files corresponding to each character in the Chinese text from the original font packet corresponding to the font format, and processing each font file to obtain a target font packet;
and returning the target font packet to a user browser, and triggering the user browser to display the works according to the target font packet.
Optionally, the determining the font format of the work includes:
receiving the font identification of the works sent by the front end; the font identification of the work is obtained by the front end through analyzing the request parameters in the request;
and determining the font format of the work based on the corresponding relation between the font identification and the font format.
Optionally, traversing all texts in the work to determine the chinese text belonging to the font format includes:
receiving the work number and the release time of the work sent by the front end; the product number and the release time of the product are obtained by the front end through analyzing the request parameters in the request;
obtaining all texts in the works according to the work numbers and the release time of the works;
and extracting each character corresponding to the font format in all texts of the work to determine the Chinese text.
Optionally, the processing each font file to obtain a target font packet includes:
analyzing the parameters of each font file to obtain the word list information of each font file;
deleting useless word list information in the word list information of each font file to obtain a target font file;
and combining the target font files to obtain a target font packet.
Optionally, the returning the target font packet to the user browser includes:
judging the optimal font format supported by the user browser;
and if the font format of the target font packet is not the optimal font format supported by the user browser, converting the font format of the target font packet into the optimal font format.
A second aspect of the embodiments of the present invention provides a chinese font loading apparatus, including:
the system comprises a determining unit, a processing unit and a display unit, wherein the determining unit is used for determining the font format of a work when a request of a user for browsing the work is received; the font format is adopted when the works are edited;
the traversal unit is used for traversing all texts in the works and determining the Chinese texts belonging to the font format;
the extracting unit is used for extracting a font file corresponding to each character in the Chinese text from the original font packet corresponding to the font format, and processing each font file to obtain a target font packet;
and the return unit is used for returning the target font packet to a user browser and triggering the user browser to display the works according to the target font packet.
Optionally, the determining unit includes:
the first receiving subunit is used for receiving the font identifier of the work sent by the front end; the font identification of the work is obtained by the front end through analyzing the request parameters in the request;
and the determining subunit is used for determining the font format of the work based on the corresponding relation between the font identification and the font format.
Optionally, the traversal unit includes:
the second receiving subunit is used for receiving the work number and the release time of the work sent by the front end; the product number and the release time of the product are obtained by the front end through analyzing the request parameters in the request;
the obtaining subunit is used for obtaining all texts in the works according to the work numbers and the release time of the works;
and the extraction subunit is used for extracting each character corresponding to the font format in all the texts of the work to determine the Chinese text.
Optionally, the extracting unit includes:
the third analysis subunit is used for analyzing the parameters of each font file to obtain the word list information of each font file;
the deleting subunit is used for deleting useless word list information in the word list information of each font file to obtain a target font file;
and the combining subunit is used for combining the target font file to obtain a target font packet.
Optionally, the returning unit includes:
the judging subunit is used for judging the optimal font format supported by the user browser;
and the conversion subunit is configured to, if the font format of the target font packet is not the optimal font format supported by the user browser, convert the font format of the target font packet into the optimal font format.
Compared with the prior art, the invention has the following advantages:
in the Chinese font loading method disclosed by the invention, the font format of the works requested by the user is determined according to the request parameters after the request of the user for browsing the works is received; traversing all texts in the works, determining the Chinese texts belonging to the font format, determining font files corresponding to each character in the Chinese texts, processing to obtain a target font packet, and finally returning the target font packet to a user browser. Therefore, the target font packet returned to the user browser only contains a small number of font files required by displaying the Chinese text in the work, but not a complete font file packet; the method greatly reduces the loading capacity of the user browser to the font file, so that the speed of the user browser when displaying the webpage works is improved, and the application of the Chinese font in network transmission is facilitated.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for loading a chinese font according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of a method for loading a chinese font according to an embodiment of the present invention;
fig. 3 is a flowchart of another method of a method for loading a chinese font according to an embodiment of the present invention;
fig. 4 is a flowchart of another method of a method for loading a chinese font according to an embodiment of the present invention;
fig. 5 is a flowchart of another method for loading a chinese font according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a chinese font loading apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be further noted that, in the research of the prior art, the inventor found that the file size of the chinese font packet (tens of thousands of chinese characters) is obviously too large compared with the english font packet (26 letters). When the browser displays the Chinese text in the webpage, if the whole Chinese font packet is loaded, the loading speed is slowed, so that the speed when the webpage works are displayed is also slowed, and the user experience is reduced.
Moreover, there are thousands of Chinese font packages in the market, and if a plurality of Chinese font packages need to be downloaded when displaying the web page works, the loading speed is conceivably slow.
Therefore, the embodiment of the invention provides a Chinese font loading method, which can effectively solve the problem of slow webpage loading speed when a browser loads a Chinese font packet.
Specifically, with reference to fig. 1, a method for loading a chinese font according to an embodiment of the present invention is described as follows:
s101, when a request of a user for browsing a work is received, determining a font format of the work; and the font format is adopted when the works are edited.
In the method provided by the embodiment of the invention, the work browsed by the user is the WEB page work edited based on H5, and obviously, the process of editing the work occurs before the user initiates a browsing request. The method for editing the works specifically comprises the following steps: after the author of the work enters an H5 editor and inputs the characters of the work, judging whether a user (the author) selects a font format; if not, adopting a local default font, and if so, downloading a font packet corresponding to the font format selected by the user. It should be further noted that if the browser in which the H5 editor is located does not support the font format selected by the user, the local default font is returned and used.
And after the author of the work successfully edits the work, publishing the work, generating a link for browsing the work, and making a browsing request on the work by a user through the link.
When a work browsing request is received, the front end can determine the font identification of the work and further transmits the font identification to the rear end, and the rear end determines the font format of the work according to the font identification. Optionally, as shown in fig. 2, the determining the font format of the work specifically includes:
s201, receiving a font identifier of the work sent by a front end; and the font identification of the work is obtained by the front end through analyzing the request parameters in the request.
As mentioned above, after the release of the work, a link for browsing the work is generated, and the user makes a browsing request for the work through the link. The front end can analyze the request through JavaScript to obtain the work information contained in the link. Specifically, the work information may include a Font identification Font-Family of the work; it should be noted that the font identification of the work may be multiple, which means that multiple font formats are used in the work during editing.
The font identifier of the work acquired in the embodiment of the invention can be one font identifier or multiple font identifiers, but the specific execution modes of determining the font format according to the font identifier are consistent, so that only one font identifier needs to be used for determining one font format in the aspect of description. Specifically, the method for determining the font format according to the font identifier is as follows in step S202.
S202, determining the font format of the work based on the corresponding relation between the font identification and the font format.
The Font identifier Font-Family may be stored in the request parameter in a JSON format, a Font format corresponding to the Font identifier is described in the JSON, and based on a correspondence between the Font identifier Font and the request parameter, a Font format corresponding to the Font identifier, that is, a Font format adopted when the work is edited, may be determined.
S102, traversing all texts in the works, and determining the Chinese texts belonging to the font format.
When the request parameter of the request is analyzed, the product information included in the link is obtained. Furthermore, the work information also comprises the work number and the release time corresponding to the work, and the work can be obtained in an addressing mode according to the work number and the release time. After the work is obtained, all texts in the work can be traversed, namely each character of the work is checked, each character belonging to the font format is determined, and the characters are aggregated into a Chinese text. When the same font format exists, the same characters exist in the work, and the work is determined to be only one character.
Specifically, as shown in fig. 3, the method for determining the chinese text belonging to the font format by traversing all the texts in the work specifically includes:
s301, receiving the work number and the release time of the work sent by the front end; and the work number and the release time of the work are obtained by the front end through analyzing the request parameters in the request.
In the method provided by the embodiment of the invention, the front end analyzes the request parameters in the request through JavaScript, can also obtain the work number of the work and the release time of the work, and after obtaining the work number and the release time of the work, the front end also transmits the work number and the release time to the back end for processing. It should be noted that the operations of the front-end parsing request in step S301 and step S201 may be performed synchronously.
S302, obtaining all texts in the works according to the work numbers and the release time of the works.
After the product number of the product and the release time of the product are obtained through the analysis request parameters, the product number and the release time can be combined into a Uniform Resource Locator (URL) of an access server, the position of a product file is indicated in the URL, the product can be quickly found through addressing, and all text information in the product can be loaded. Wherein, the text information is a set of all characters input when the work is edited; each character is selected as a default font format when the font format to which the character belongs is defined or not defined.
S303, extracting each character corresponding to the font format in all texts of the work to determine the Chinese text.
And further selecting each character consistent with the font format from all the texts of the work according to the determined font format corresponding to the font identification, thereby determining the Chinese text.
In the method provided by the embodiment of the invention, taking a frequently used font format (TTF) of a browser as an example, when the font format is determined to be TTF, each character with the TTF is selected from all texts of the work and combined into a Chinese text. It should be noted that the chinese text may include 26 english letters and 10 arabic numerals, in addition to all chinese characters in the TTF font format in the work.
Because the number of the English letters is only 26, the number of the Arabic numerals is only 10, and the corresponding font files are very small, when the Chinese character is selected, the whole number of the English letters and the whole number of the Arabic numerals can be directly attributed to the Chinese character text by default, and the English letters and the Arabic numerals appearing in the work and whether the font formats of the English letters and the Arabic numerals belong to TTF font formats are not required to be judged, so that the selection time is saved.
It should be noted that, in the method provided by the embodiment of the present invention, the font format includes, but is not limited to, the TTF font format mentioned above, and besides the TTF font format, other font formats that are consistent with the means of the present invention also belong to the protection scope of the present invention.
S103, extracting font files corresponding to each character in the Chinese text from the original font packet corresponding to the font format, and processing each font file to obtain a target font packet.
In the method provided by the embodiment of the invention, the TTF in the common font format of the browser is also taken as an example, and based on the determined TTF font format, the original TTF font packet corresponding to the font server is searched. And after obtaining the TTF font packet, extracting a font file corresponding to each character in the Chinese text by combining the determined Chinese text. It should be noted that, in any font packet, such as TTF, WOFF2, each word in the font packet has a font file corresponding to each word; in the font file, computer identification information such as a mapping relation from a code point to a font shape and a level measurement index is declared, and the computer identification information is an important parameter for constructing characters in a webpage.
Therefore, in step S103, a font file corresponding to each character in the work is obtained based on the font format; and after a plurality of font files are obtained, processing each font file to obtain a target font packet. Specifically, the process of processing each font file, as shown in fig. 4, includes:
s401, analyzing the parameters of each font file to obtain the word list information of each font file.
In each individual font file, meta information and word table information of the font file are included. The meta information stores font name, description, manufacturer, header information, etc., and the character table information stores character code points, font map, etc. And analyzing the font file to select and obtain the word list information.
S402, deleting useless word list information in the word list information of each font file to obtain the target font file.
For Chinese font, there are many useless character table information in the character table information of the Chinese font file, so that the Chinese font file is too large compared with the English font file or the Arabic font file. In fact, part of the table information does not play any role in presenting the font, because it may define the attributes, shapes, etc. of the font when printing. Therefore, it is necessary to delete a large amount of useless table information existing in the table information of each of the font files.
In the method provided by the embodiment of the present invention, taking a frequently used font TTF of a browser as an example, the useless font information in the deleted TTF font file is shown in table 1 below:
TABLE 1
In table 1, the character table information in the serial numbers 1 to 5 is the character table information required for displaying the Chinese character font, and is reserved, and the character table information in the serial numbers 6 to 14 is the character table information which is not required at all when displaying the Chinese character font, so that the size of the character font file is reduced by deleting the useless character table information; and the font file with the useless word list information deleted is the target font file required by the subsequent display works.
And S403, combining the target font files to obtain a target font packet.
After obtaining the multiple target font files, the multiple target font files are combined, optionally, the multiple target font files may be sorted in the combining process, so as to facilitate management and invocation. After the combination is successful, the font packet containing all the target font files is the target font packet. It should be further noted that, for example, when there are only 200 different chinese characters in a work, the target font packet also has corresponding font files corresponding to only the 200 chinese characters and font files of english letters and arabic numerals. As such, the target font packet has a file size that is over a hundred times smaller than the original font packet.
And S104, returning the target font packet to a user browser, and triggering the user browser to display the works according to the target font packet.
In the method provided by the embodiment of the invention, after the target font packet is obtained by processing, the target font packet is returned to the user browser. And after the target font packet is loaded by the user browser, displaying a font effect in the setting on the Chinese in the work according to the font format corresponding to the target font packet.
It should be further noted that, in this presentation process, in addition to the normal presentation, there are two special application scenarios: firstly, the selected font format is special when the work is edited, and some user browsers do not support the font format; secondly, the selected font format is compared and the more preferable font format is supported by part of the user browser when the work is edited. In these two special application scenarios, the font format of the target font packet needs to be converted.
Specifically, the process of converting the font format of the target font packet, as shown in fig. 5, includes:
s501, judging the optimal font format supported by the user browser.
When a user initiates a work browsing request, the front end calls the user browser to set a forbidden list of font formats, so that the font formats supported by the user browser are judged.
S502, if the font format of the target font packet is not the optimal font format supported by the user browser, converting the font format of the target font packet into the optimal font format.
Based on the font format supported by the user browser determined in step S501, the relationship between the font format of the target font packet and the font format of the target font packet obtained by the foregoing processing is determined, and feedback is made. For example, the user browser only supports the TTF font format or the user local default font format, and the target font packet has the TTF font format, and directly returns the TTF font format or converts the TTF font format into the target font packet of the user local default font format; or the user browser supports the font format of WOFF or WOFF2, and the font format of the target font packet is TTF, the TTF font format of the target font packet is converted into the font format of WOFF or WOFF2, and then the converted font format is returned to the user browser.
It should be noted that, in the embodiment of the present invention, the font formats of WOFF and WOFF2 are both superior to the TTF font format, and the font files of the WOFF font format and the WOFF2 font format are smaller, so that the speed of displaying the works by the browser can be increased; but the TTF font format is preferred to be more user browser compatible.
In the Chinese font loading method provided by the invention, when a request of a user for browsing a work is received, the font format of the work is determined; traversing all texts in the works to determine Chinese texts belonging to the font format; extracting font files corresponding to each character in the Chinese text from the original font packet corresponding to the font format, and processing each font file to obtain a target font packet; and returning the target font packet to a user browser, and triggering the user browser to display the works according to the target font packet. Therefore, the target font packet returned to the user browser only contains a small number of font files required by displaying the Chinese text in the works, and the time of the user browser for loading the target font files is greatly shortened, so that the speed of the user browser for displaying the webpage works is improved, and the application of the Chinese fonts in network transmission is facilitated.
An embodiment of the present invention further provides a device for loading a chinese font, as shown in fig. 6, including:
a determining unit 601, configured to determine a font format of a work when a request for browsing the work is received from a user; and the font format is adopted when the works are edited.
And the traversing unit 602 is configured to traverse all texts in the work to determine the chinese text belonging to the font format.
An extracting unit 603, configured to extract a font file corresponding to each character in the chinese text from the original font packet corresponding to the font format, and process each font file to obtain a target font packet.
A returning unit 604, configured to return the target font packet to a user browser, and trigger the user browser to display the work according to the target font packet.
In the Chinese font loading device provided by the invention, when a determining unit 601 receives a request of a user for browsing a work, the font format of the work is determined, a traversing unit 602 determines a Chinese text belonging to the font format in the work, an extracting unit 603 extracts a font file corresponding to each character in the Chinese text from an original font packet corresponding to the font format, a target font packet is obtained after processing, and a returning unit 604 returns the target font packet to a user browser. Therefore, the target font packet returned to the user browser only contains a small number of font files required by displaying the Chinese text in the works, and the time of the user browser for loading the target font files is greatly shortened, so that the speed of the user browser for displaying the webpage works is improved, and the application of the Chinese fonts in network transmission is facilitated.
In addition, in this embodiment, the specific implementation processes of the determining unit 601, the traversing unit 602, the extracting unit 603, and the returning unit 604 can refer to the contents of the method embodiment corresponding to fig. 1, and are not described herein again.
Optionally, in another embodiment of the present invention, the determining unit 601 includes:
the first receiving subunit is used for receiving the font identifier of the work sent by the front end; and the font identification of the work is obtained by the front end through analyzing the request parameters in the request.
And the determining subunit is used for determining the font format of the work based on the corresponding relation between the font identification and the font format.
In this embodiment, the specific execution processes of the first parsing subunit and the determining subunit may refer to the contents of the method embodiment corresponding to fig. 2, which are not described herein again.
Optionally, in another embodiment of the present invention, the traversing unit 602 includes:
the second receiving subunit is used for receiving the work number and the release time of the work sent by the front end; and the work number and the release time of the work are obtained by the front end through analyzing the request parameters in the request.
And the obtaining subunit is used for obtaining all texts in the works according to the work numbers and the release time of the works.
And the extraction subunit is used for extracting each character corresponding to the font format in all the texts of the work to determine the Chinese text.
In this embodiment, the specific execution processes of the second parsing subunit, the obtaining subunit and the extracting subunit may refer to the contents of the method embodiment corresponding to fig. 3, and are not described herein again.
Optionally, in another embodiment of the present invention, the extracting unit 603 includes:
and the third analysis subunit is used for analyzing the parameters of each font file to obtain the word list information of each font file.
And the deleting subunit is used for deleting useless word list information in the word list information of each font file to obtain the target font file.
And the combining subunit is used for combining the target font file to obtain a target font packet.
In this embodiment, for the specific execution process of the third parsing subunit, the deleting subunit and the combining subunit, reference may be made to the content of the method embodiment corresponding to fig. 4, which is not described herein again.
Optionally, in another embodiment of the present invention, the returning unit 604 includes:
and the judging subunit is used for judging the optimal font format supported by the user browser.
And the conversion subunit is configured to, if the font format of the target font packet is not the optimal font format supported by the user browser, convert the font format of the target font packet into the optimal font format.
In this embodiment, for specific execution processes of the determining subunit and the converting subunit, reference may be made to the contents of the method embodiment corresponding to fig. 5, which is not described herein again.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A loading method of Chinese font is characterized by comprising the following steps:
when a request of a user for browsing a work is received, determining the font format of the work; the font format is adopted when the works are edited;
traversing all texts in the works to determine Chinese texts belonging to the font format;
extracting font files corresponding to each character in the Chinese text from the original font packet corresponding to the font format, and processing each font file to obtain a target font packet;
and returning the target font packet to a user browser, and triggering the user browser to display the works according to the target font packet.
2. The loading method of claim 1, wherein said determining a font format for the work comprises:
receiving the font identification of the works sent by the front end; the font identification of the work is obtained by the front end through analyzing the request parameters in the request;
and determining the font format of the work based on the corresponding relation between the font identification and the font format.
3. The loading method of claim 1, wherein traversing all text in the work to determine chinese text in the font format comprises:
receiving the work number and the release time of the work sent by the front end; the product number and the release time of the product are obtained by the front end through analyzing the request parameters in the request;
obtaining all texts in the works according to the work numbers and the release time of the works;
and extracting each character corresponding to the font format in all texts of the work to determine the Chinese text.
4. The loading method according to claim 1, wherein said processing each font file to obtain a target font packet comprises:
analyzing the parameters of each font file to obtain the word list information of each font file;
deleting useless word list information in the word list information of each font file to obtain a target font file;
and combining the target font files to obtain a target font packet.
5. The loading method according to claim 1, wherein the returning the target font packet to the user browser comprises:
judging the optimal font format supported by the user browser;
and if the font format of the target font packet is not the optimal font format supported by the user browser, converting the font format of the target font packet into the optimal font format.
6. A loading apparatus for chinese fonts, comprising:
the system comprises a determining unit, a processing unit and a display unit, wherein the determining unit is used for determining the font format of a work when a request of a user for browsing the work is received; the font format is adopted when the works are edited;
the traversal unit is used for traversing all texts in the works and determining the Chinese texts belonging to the font format;
the extracting unit is used for extracting a font file corresponding to each character in the Chinese text from the original font packet corresponding to the font format, and processing each font file to obtain a target font packet;
and the return unit is used for returning the target font packet to a user browser and triggering the user browser to display the works according to the target font packet.
7. The loading device according to claim 6, wherein the determination unit comprises:
the first receiving subunit is used for receiving the font identifier of the work sent by the front end; the font identification of the work is obtained by the front end through analyzing the request parameters in the request;
and the determining subunit is used for determining the font format of the work based on the corresponding relation between the font identification and the font format.
8. The loading device of claim 6, wherein the traverse unit comprises:
the second receiving subunit is used for receiving the work number and the release time of the work sent by the front end; the product number and the release time of the product are obtained by the front end through analyzing the request parameters in the request;
the obtaining subunit is used for obtaining all texts in the works according to the work numbers and the release time of the works;
and the extraction subunit is used for extracting each character corresponding to the font format in all the texts of the work to determine the Chinese text.
9. The loading device according to claim 6, wherein the extraction unit comprises:
the third analysis subunit is used for analyzing the parameters of each font file to obtain the word list information of each font file;
the deleting subunit is used for deleting useless word list information in the word list information of each font file to obtain a target font file;
and the combining subunit is used for combining the target font file to obtain a target font packet.
10. The loading device according to claim 6, wherein the return unit comprises:
the judging subunit is used for judging the optimal font format supported by the user browser;
and the conversion subunit is configured to, if the font format of the target font packet is not the optimal font format supported by the user browser, convert the font format of the target font packet into the optimal font format.
CN201910880595.7A 2019-09-18 2019-09-18 Chinese font loading method and device Pending CN110705210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910880595.7A CN110705210A (en) 2019-09-18 2019-09-18 Chinese font loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910880595.7A CN110705210A (en) 2019-09-18 2019-09-18 Chinese font loading method and device

Publications (1)

Publication Number Publication Date
CN110705210A true CN110705210A (en) 2020-01-17

Family

ID=69194531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910880595.7A Pending CN110705210A (en) 2019-09-18 2019-09-18 Chinese font loading method and device

Country Status (1)

Country Link
CN (1) CN110705210A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986854A (en) * 2021-11-10 2022-01-28 网易(杭州)网络有限公司 Font file compression method and device, storage medium and processor
CN117033672A (en) * 2023-08-23 2023-11-10 北京饼干科技有限公司 Slide deriving method, slide deriving device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093565A1 (en) * 2009-10-16 2011-04-21 Extensis Inc. Serving Font Files in Varying Formats Based on User Agent Type
CN105677646A (en) * 2014-11-17 2016-06-15 北京大学 Word stock generation method and system, and server
CN106502968A (en) * 2016-10-12 2017-03-15 北京奇虎科技有限公司 The method and device of data processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110093565A1 (en) * 2009-10-16 2011-04-21 Extensis Inc. Serving Font Files in Varying Formats Based on User Agent Type
CN105677646A (en) * 2014-11-17 2016-06-15 北京大学 Word stock generation method and system, and server
CN106502968A (en) * 2016-10-12 2017-03-15 北京奇虎科技有限公司 The method and device of data processing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986854A (en) * 2021-11-10 2022-01-28 网易(杭州)网络有限公司 Font file compression method and device, storage medium and processor
CN117033672A (en) * 2023-08-23 2023-11-10 北京饼干科技有限公司 Slide deriving method, slide deriving device and storage medium

Similar Documents

Publication Publication Date Title
EP2399234B1 (en) Font handling for viewing documents on the web
CN108804707B (en) Page processing method and device and related equipment
CN107784516B (en) Advertisement putting method and device
CN106844635B (en) Method and device for editing elements in webpage
CN102779167B (en) The method and system of display web page in the terminal
US8914355B1 (en) Display-content alteration for user interface devices
CN108717437B (en) Search result display method and device and storage medium
CN112001153B (en) Text processing method, device, computer equipment and storage medium
CN107704615B (en) Webpage font display method and system based on Chinese font subset
KR20130066603A (en) Initiating font subsets
CN102063483A (en) Serving font files in varying formats based on user agent type
CN102591874B (en) Prompt method, terminal and server
CN108595697B (en) Webpage integration method, device and system
CN110928767A (en) Webpage analysis method, device, equipment and storage medium
CN104063401A (en) Method and device for merging web page style addresses
CN112905928B (en) Webpage refreshing method and device, electronic equipment and storage medium
CN110990732A (en) Loading method, device and equipment based on webpage and storage medium
CN104965871A (en) Page loading method and device and electronic equipment
WO2022048141A1 (en) Image processing method and apparatus, and computer readable storage medium
CN105979393A (en) Web page display method and device, and intelligent television system
CN113360106B (en) Webpage printing method and device
CN113297425B (en) Document conversion method, device, server and storage medium
CN110705210A (en) Chinese font loading method and device
CN109992580A (en) Method and device for processing list data, storage medium, and computer equipment
US8656371B2 (en) System and method of report representation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200117