CN110362790A - Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file - Google Patents

Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file Download PDF

Info

Publication number
CN110362790A
CN110362790A CN201910512670.4A CN201910512670A CN110362790A CN 110362790 A CN110362790 A CN 110362790A CN 201910512670 A CN201910512670 A CN 201910512670A CN 110362790 A CN110362790 A CN 110362790A
Authority
CN
China
Prior art keywords
font
font file
metamessage
file
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.)
Granted
Application number
CN201910512670.4A
Other languages
Chinese (zh)
Other versions
CN110362790B (en
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 Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201910512670.4A priority Critical patent/CN110362790B/en
Publication of CN110362790A publication Critical patent/CN110362790A/en
Application granted granted Critical
Publication of CN110362790B publication Critical patent/CN110362790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography

Abstract

Embodiment of the disclosure provides processing method, device, electronic equipment and the readable storage medium storing program for executing of a kind of font file, which comprises reads the first font file;Font metamessage is extracted from first font file according to font file rule;The corresponding target word voxel information of target text is extracted from the font metamessage;The second font file is generated according to the target word voxel information;Second font file is back to front-end interface, to show the target text.The second font file through overcompression is back to front-end interface by the above method, can be to avoid distortion phenomenon of picture during scaling, and the production complexity relative to the second font file of SVG file is lower.

Description

Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file
Technical field
Embodiment of the disclosure is related to network technique field more particularly to a kind of processing method of font file, device, electricity Sub- equipment and readable storage medium storing program for executing.
Background technique
In the publicity property webpage such as commercial paper, it will usually use the special Chinese character written-form in non-standard library, such as characters in a fancy style Body.And due to Chinese text substantial amounts, so that font APMB package is very big, cause webpage offered load excessive.
In the prior art, in order to solve the problems, such as that webpage offered load is larger, two schemes is generallyd use and are loaded in special Text body.The first scheme loads special Chinese character written-form in the form of picture;Second scheme, by special Chinese character written-form with The load of SVG (Scalable Vector Graphics, scalable vector graphics) format.
However, for the first above-mentioned scheme, picture will lead to distortion during scaling;For second scheme, SVG The complex manufacturing process degree of file is higher.
Summary of the invention
Embodiment of the disclosure provides processing method, device, electronic equipment and the readable storage medium storing program for executing of a kind of font file, User type can be predicted jointly by history feature sequence and current signature, help to improve the accuracy of prediction.
It is according to an embodiment of the present disclosure in a first aspect, provide a kind of processing method of font file, the method packet It includes:
Read the first font file;
Font metamessage is extracted from first font file according to font file rule;
The corresponding target word voxel information of target text is extracted from the font metamessage;
The second font file is generated according to the target word voxel information;
Second font file is back to front-end interface, to show the target text.
Second aspect according to an embodiment of the present disclosure provides a kind of processing unit of font file, described device packet It includes:
First font file read module, for reading the first font file;
Font metamessage extraction module, for extracting font member from first font file according to font file rule Information;
Target word voxel information extraction module, for extracting the corresponding target word of target text from the font metamessage Voxel information;
Font metamessage conversion module, for generating the second font file according to the target word voxel information;
Target text display module, for second font file to be back to front-end interface, to show the target Text.
The third aspect according to an embodiment of the present disclosure, provides a kind of electronic equipment, comprising:
Processor, memory and it is stored in the computer journey that can be run on the memory and on the processor Sequence, the processor realize the processing method of aforementioned font file when executing described program.
Fourth aspect according to an embodiment of the present disclosure provides a kind of readable storage medium storing program for executing, when in the storage medium Instruction by electronic equipment processor execute when so that electronic equipment is able to carry out the processing method of aforementioned font file.
Embodiment of the disclosure provides a kind of processing method and processing device of font file, which comprises reads the One font file;Font metamessage is extracted from first font file according to font file rule;Believe from the font member The corresponding target word voxel information of target text is extracted in breath;The second font file is generated according to the target word voxel information; Second font file is back to front-end interface, to show the target text.The above method is by second through overcompression Font file is back to front-end interface, can be to avoid distortion phenomenon of picture during scaling, and relative to SVG file second The production complexity of font file is lower.
Detailed description of the invention
In order to illustrate more clearly of the technical solution of embodiment of the disclosure, below by the description to embodiment of the disclosure Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only the implementation of the disclosure Some embodiments of example for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these drawings.
Fig. 1 shows the process method step flow chart of the font file in a kind of embodiment of the disclosure;
Fig. 2 shows the process method step flow charts of the font file in another embodiment of the disclosure;
Fig. 3 (A, B, C, D) respectively illustrates the structural schematic diagram of font metamessage in embodiment of the disclosure;
Fig. 4 shows the structure chart of the processing unit of the font file in a kind of embodiment of the disclosure;
Fig. 5 shows the structure chart of the processing unit of the font file in another embodiment of the disclosure;
Fig. 6 shows the structure chart of the electronic equipment in a kind of embodiment of the disclosure.
Specific embodiment
Below in conjunction with the attached drawing in embodiment of the disclosure, the technical solution in embodiment of the disclosure is carried out clear Chu is fully described by, it is clear that described embodiment is embodiment of the disclosure a part of the embodiment, rather than whole realities Apply example.Based on the embodiment in embodiment of the disclosure, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, belong to embodiment of the disclosure protection range.
Embodiment one
Referring to Fig.1, it illustrates the step flow chart of the processing method of the font file in a kind of embodiment of the disclosure, It is specific as follows.
Step 101, the first font file is read.
The equipment that the embodiment of the present invention is suitable for showing function with screen, for example, mobile phone, tablet computer etc. are mobile eventually End, or, personal computer.It especially data and shows, and shows interior when above equipment needs to obtain from remote server There are sytlized fonts in appearance.
In practical applications, sytlized font is usually stored in remote server in the form of font file, when front end asks When seeking sytlized font, font file is sent to front end and is shown.
It is appreciated that a large amount of font file constitutes font file database, it is stored in remote server.The present invention is real It applies example to be described in detail from remote server side, specifically, remote server is when receiving font file request, from font Font file is read in document data bank.
Step 102, font metamessage is extracted from first font file according to font file rule.
Wherein, font metamessage is the key message for indicating font information.It is appreciated that the concrete form of font metamessage It is related to font file rule, it usually needs the key message that font information is indicated from multiple dimensions, to form multiple dimensions Font metamessage.It indexes to obtain index information for example, character code is mapped as pel, is pel by pel index translation Position obtains location information, is defined to obtain profile information to pel profile, and the corresponding index information of a large amount of texts constitutes rope Draw information table, the corresponding location information of a large amount of texts constitutes location information table, and the corresponding profile information of a large amount of texts constitutes profile Information table.
Step 103, the corresponding target word voxel information of target text is extracted from the font metamessage.
Wherein, target text can be the sytlized font text in displayed page, send word to remote server in front end When body file request, need to carry target text in request.
It is appreciated that needing to mention from the font metamessage of each dimension when font metamessage includes multiple dimensions The corresponding font metamessage of target text is taken to obtain target word voxel information.For example, it is desired to from index information table, location information In table, profile information table extract the index information of target text, the location information of target text, target text profile information, As target word voxel information.
In practical applications, the target text carried in request can be indicated with unique words identification, and index information Table, location information table store words identification in profile information table, so as to obtain target text according to words identification Target word voxel information.
Step 104, the second font file is generated according to the target word voxel information.
Wherein, the second font file is preferentially regular with the first font file font file having the same.
Specifically, firstly, extracting the information such as font name, font type from the head information of the first font file;Then, Font name, font type and target word voxel information are added in newly created second font file.
In practical applications, the second font file can also be converted into other rules, this hair according to practical application request Bright embodiment is without restriction to its.
Step 105, second font file is back to front-end interface, to show the target text.
Wherein, front-end interface is the page for requesting sytlized font, can be to be mounted on mobile phone, tablet computer, individual calculus Application program on machine.For example, browser, so that browser interface is made when user accesses a Webpage on a web browser Font file is requested to the remote server of browser for front-end interface, remote server returns to the second font file of generation To browser, and shown on its interface.
It is appreciated that the second font file is the font file through overcompression, relative to by the font file of all texts It is back to front-end interface, since the occupancy size of the second font file is smaller, Internet resources are accounted for help to reduce With, the loading velocity of font file and webpage is improved, it, can be to avoid simultaneously as what the present invention generated is the second font file Distortion phenomenon of picture during scaling, and the production complexity relative to the second font file of SVG file is lower.
In conclusion embodiment of the disclosure provides a kind of processing method of font file, which comprises read First font file;Font metamessage is extracted from first font file according to font file rule;From the font member The corresponding target word voxel information of target text is extracted in information;The second font text is generated according to the target word voxel information Part;Second font file is back to front-end interface, to show the target text.The above method is by through overcompression Two font files are back to front-end interface, can be to avoid distortion phenomenon of picture during scaling, and relative to SVG file The production complexity of two font files is lower.
Embodiment two
Referring to Fig. 2, it illustrates the specific steps of the processing method of the font file in another embodiment of the disclosure Rapid flow chart, it is specific as follows.
Step 201, the first font file is read.
The step is referred to the detailed description of step 101, and details are not described herein.
Step 202, first font file is converted into stack cache object from binary stream.
In practical applications, when reading file in a manner of binary stream, and computer program can not be directly to binary system Stream is handled, to need to be converted to binary stream into stack cache object, for example, ArrayBuffer.
Step 203, font metamessage, the word are extracted from the stack cache object according to preset fon Voxel information includes to separate mark.
It is appreciated that font metamessage is as the item in stack cache object, Ke Yizhi after being converted to stack cache object It connects the therefrom corresponding item of extraction font metamessage and obtains font metamessage, include a large amount of texts in the font metamessage obtained here Font metamessage.
In a kind of typical font file, font metamessage cmap is for storing index information, font metamessage loca For storage location information, font metamessage glyf is for storing profile information, so as to extract from stack cache object Cmap, loca, glyf, obtain font metamessage cmap, loca, glyf.
Optionally, in another embodiment of the invention, the fon includes believing for each font member Origin identification, the end of identification of breath, the step 203 include sub-step A1:
Sub-step A1 reads font metamessage according to the origin identification, end of identification from the stack cache object, The font metamessage includes: index information, location information, profile information.
Wherein, origin identification is used to indicate the initial position of a font metamessage, and end of identification is for indicating a word The end position of voxel information can store in sequence in practical applications, for example, as described in Fig. 3 (A), cmap, loca, Glyf is stored in sequence, and next position of first origin identification is the initial position of cmap, until end of identification;Second Next position of a origin identification is the initial position of loca, until next end of identification;Under third origin identification The initial position that one position is glyf, until next end of identification.
Step 204, the font not text in preset standard fontlib is extracted from the configuration of the font of target webpage, is obtained Target text.
Wherein, the webpage that target webpage can be shown on interface for needs.In practical applications, front-end interface is to distally When server request is directed to the web data of target webpage, back-end server can obtain word from the web data of target webpage Body configuration, compares to configuring font with standard letter library, obtains the font not text in standard letter library.
It is appreciated that standard letter library can be the library of other normal fonts except sytlized font, so that target text is Sytlized font.
Step 205, according to mark is separated, remaining text except the target text is deleted from each font metamessage Corresponding font metamessage, obtains target word voxel information.
It in embodiments of the present invention, include the font metamessage of multiple texts in the font metamessage of each dimension, it is multiple There is segmentation mark between font metamessage between text.For example, there are N number of objects in cmap as shown in Fig. 3 (B) Cmap1, cmap2 ... cmapN, it is intermediate to be divided by segmentation mark, thus when the target word voxel information in cmap is cmap2 When, other font metamessages except the separation mark before and after cmap2 are deleted;As shown in Fig. 3 (C), there are N number of right in loca The locaN as loca1, loca2 ..., it is intermediate to be divided by segmentation mark, so that the target word voxel information in loca is When loca2, other font metamessages except the separation mark before and after loca2 are deleted;As shown in Fig. 3 (D), exist in glyf N number of object glyf1, glyf2 ... glyfN, it is intermediate to be divided by segmentation mark, thus when the target word voxel information in glyf When for glyf2, other font metamessages except the separation mark before and after glyf2 are deleted.
It is appreciated that under normal circumstances, the object number stored in cmap, loca, glyf is identical.
It step 206, will be in the newly-built stack cache object of target word voxel information write-in.
Specifically, firstly, stack cache object is created, for example, ArrayBuffer;Then, target word voxel information is written In stack cache object.
It is appreciated that it is corresponding with the stack cache object in step 202, unlike, it is only deposited in stack cache object herein Target word voxel information is stored up, and the stack cache object in step 202 stores the font metamessage of all texts.
Step 207, the newly-built stack cache object is converted into binary stream.
The step process opposite each other with step 202 only includes target word voxel information in binary stream here, and It include the font metamessage of all texts in binary stream in step 202.
Step 208, by the newly-built font file of binary stream write-in, the second font file is obtained.
Specifically, firstly, the font file of one blank of creation is as the second font file;Then, binary stream is write Enter in the second font file.
It is appreciated that only include target font file in the second font file here.
Step 209, the load request to the target webpage is received.
In embodiments of the present invention, remote server can also be pre-generated by step 201 to 208 and be directed to target webpage The second font file, thus when receiving the load request to target webpage, before directly the second font file is back to Interface is held, can also be saved the second font file of generation, and after the first time load request of target webpage in next time The second font file of preservation is directly back to front-end interface when receiving the load request to the target webpage.
Step 210, in response to the load request, second font file is added to the response of the target webpage In data.
Wherein, response data includes all data shown in target webpage, certainly includes the second font file.
Step 211, the response data is back to front-end interface, the front-end interface calls second font file Show the target text.
Second font file can be back to front-end interface in company with response data by the embodiment of the present invention together, and in front end When showing interface response data, sytlized font text therein is shown with the second font file.
In conclusion embodiment of the disclosure provides a kind of processing method of font file, which comprises read First font file;Font metamessage is extracted from first font file according to font file rule;From the font member The corresponding target word voxel information of target text is extracted in information;The second font text is generated according to the target word voxel information Part;Second font file is back to front-end interface, to show the target text.The above method is by through overcompression Two font files are back to front-end interface, can be to avoid distortion phenomenon of picture during scaling, and relative to SVG file The production complexity of two font files is lower.
Embodiment three
Referring to Fig. 4, it illustrates the structure chart of the processing unit of the font file in another embodiment of the disclosure, It is specific as follows.
First font file read module 301, for reading the first font file.
Font metamessage extraction module 302, for extracting word from first font file according to font file rule Voxel information.
Target word voxel information extraction module 303, for extracting the corresponding mesh of target text from the font metamessage Marking-up voxel information.
Font metamessage conversion module 304, for generating the second font file according to the target word voxel information;
Target text display module 305, for second font file to be back to front-end interface, to show the mesh Mark text.
In conclusion embodiment of the disclosure provides a kind of processing unit of font file, described device includes: first Font file read module, for reading the first font file;Font metamessage extraction module, for according to font file rule Font metamessage is extracted from first font file;Target word voxel information extraction module, for believing from the font member The corresponding target word voxel information of target text is extracted in breath;Font metamessage conversion module, for according to the target font Metamessage generates the second font file;Target text display module, for second font file to be back to front-end interface, To show the target text.The second font file through overcompression is back to front-end interface by the above method, can be to avoid figure Distortion phenomenon of piece during scaling, and the production complexity relative to the second font file of SVG file is lower.
Embodiment three is the corresponding Installation practice of embodiment one, and detailed description is referred to embodiment one, herein no longer It repeats.
Example IV
Referring to Fig. 5, it illustrates the structure chart of the processing unit of the font file in a kind of embodiment of the disclosure, tools Body is as follows.
First font file read module 401, for reading the first font file.
Font metamessage extraction module 402, for extracting word from first font file according to font file rule Voxel information;Optionally, in another embodiment of the invention, the font metamessage extraction module 402, comprising:
First font file transform subblock 4021 delays for first font file to be converted to stack from binary stream Deposit object.
Font metamessage extracting sub-module 4022 is used for according to preset fon from the stack cache object Extract font metamessage.
Target text determining module 403, for extracting font not in preset standard word from the configuration of the font of target webpage Text in body library, obtains target text.
Target word voxel information extraction module 404, for extracting the corresponding mesh of target text from the font metamessage Marking-up voxel information;Optionally, in embodiments of the present invention, the font metamessage includes to separate mark, the target font Metamessage extraction module 404 includes:
Target word voxel information extracting sub-module 4041, for being identified according to the separation, from each font metamessage The corresponding font metamessage of remaining text except the target text is deleted, target word voxel information is obtained.
Font metamessage conversion module 405, for generating the second font file according to the target word voxel information;It is optional Ground, in an embodiment of the present invention, the font metamessage conversion module 405, comprising:
Submodule 4051 is written in target word voxel information, for caching the newly-built stack of target word voxel information write-in In object.
Stack cache object transform subblock 4052, for the newly-built stack cache object to be converted to binary stream.
Submodule 4053 is written in second font file, for obtaining in the newly-built font file of binary stream write-in To the second font file.
Target text display module 406, for second font file to be back to front-end interface, to show the mesh Mark text;Optionally, in an embodiment of the present invention, the target text display module 406, comprising:
Load request receiving submodule 4061, for receiving the load request to the target webpage.
Second font file loads submodule 4062, is used in response to the load request, by second font file It is added in the response data of the target webpage.
Target text shows submodule 4063, for the response data to be back to front-end interface, the front-end interface Second font file is called to show the target text.
Optionally, in another embodiment of the invention, the fon includes believing for each font member Origin identification, the end of identification of breath, the font metamessage extracting sub-module 4022 include:
Font metamessage extraction unit, for being read from the stack cache object according to the origin identification, end of identification Font metamessage is taken, the font metamessage includes: index information, location information, profile information.
In conclusion embodiment of the disclosure provides a kind of processing unit of font file, described device includes: first Font file read module, for reading the first font file;Font metamessage extraction module, for according to font file rule Font metamessage is extracted from first font file;Target word voxel information extraction module, for believing from the font member The corresponding target word voxel information of target text is extracted in breath;Font metamessage conversion module, for according to the target font Metamessage generates the second font file;Target text display module, for second font file to be back to front-end interface, To show the target text.The second font file through overcompression is back to front-end interface by the above method, can be to avoid figure Distortion phenomenon of piece during scaling, and the production complexity relative to the second font file of SVG file is lower.
Example IV is the corresponding Installation practice of embodiment two, and detailed description is referred to embodiment two, herein no longer It repeats.
Embodiment of the disclosure additionally provides a kind of electronic equipment, referring to Fig. 6, comprising: processor 501, memory 502 with And it is stored in the computer program 5021 that can be run on the memory 502 and on the processor, the processor 501 is held The processing method of the font file of previous embodiment is realized when row described program.
Embodiment of the disclosure additionally provides a kind of readable storage medium storing program for executing, when the instruction in the storage medium is set by electronics When standby processor executes, so that electronic equipment is able to carry out the processing method of the font file of previous embodiment.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, embodiment of the disclosure is also not for any particular programming language.It should be understood that can be with The content of embodiment of the disclosure described herein is realized using various programming languages, and is retouched above to what language-specific was done Stating is preferred forms in order to disclose embodiment of the disclosure.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the disclosure The embodiment of example can be practiced without these specific details.In some instances, it is not been shown in detail well known Methods, structures and technologies, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of the exemplary embodiment of embodiment of the disclosure, each feature of embodiment of the disclosure is sometimes by together It is grouped into single embodiment, figure or descriptions thereof.However, it is as follows that the method for the disclosure should not be construed to reflection Be intended to: embodiment of the disclosure i.e. claimed requires more more than feature expressly recited in each claim Feature.More precisely, as reflected in the following claims, inventive aspect is single less than disclosed above All features of embodiment.Therefore, it then follows thus claims of specific embodiment are expressly incorporated in the specific embodiment party Formula, wherein separate embodiments of each claim as embodiment of the disclosure itself.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
The various component embodiments of embodiment of the disclosure can be implemented in hardware, or in one or more processing The software module run on device is realized, or is implemented in a combination thereof.It will be understood by those of skill in the art that can be in reality Trample the middle place that font file according to an embodiment of the present disclosure is realized using microprocessor or digital signal processor (DSP) Manage some or all functions of some or all components in equipment.Embodiment of the disclosure is also implemented as holding Some or all device or device programs of row method as described herein.Such realization embodiment of the disclosure Program can store on a computer-readable medium, or may be in the form of one or more signals.Such letter It number can be downloaded from an internet website to obtain, be perhaps provided on the carrier signal or be provided in any other form.
It should be noted that above-described embodiment illustrates rather than to embodiment of the disclosure embodiment of the disclosure It is limited, and those skilled in the art can be designed replacement without departing from the scope of the appended claims and implement Example.In the claims, any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of element or step not listed in the claims.Word "a" or "an" located in front of the element is not There are multiple such elements for exclusion.Embodiment of the disclosure can be by means of including the hardware of several different elements and borrowing Help properly programmed computer to realize.In the unit claims listing several devices, several in these devices A can be is embodied by the same item of hardware.The use of word first, second, and third does not indicate any suitable Sequence.These words can be construed to title.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
The foregoing is merely the preferred embodiments of embodiment of the disclosure, not to limit the implementation of the disclosure Example, all made any modifications, equivalent replacements, and improvements etc. within the spirit and principle of embodiment of the disclosure should all include Within the protection scope of embodiment of the disclosure.
The above, the only specific embodiment of embodiment of the disclosure, but the protection scope of embodiment of the disclosure It is not limited thereto, anyone skilled in the art, can in the technical scope that embodiment of the disclosure discloses Change or replacement are readily occurred in, should all be covered within the protection scope of embodiment of the disclosure.Therefore, embodiment of the disclosure Protection scope should be subject to the protection scope in claims.

Claims (10)

1. a kind of processing method of font file, which is characterized in that the described method includes:
Read the first font file;
Font metamessage is extracted from first font file according to font file rule;
The corresponding target word voxel information of target text is extracted from the font metamessage;
The second font file is generated according to the target word voxel information;
Second font file is back to front-end interface, to show the target text.
2. the method according to claim 1, wherein described literary from first font according to font file rule The step of font metamessage is extracted in part, comprising:
First font file is converted into stack cache object from binary stream;
Font metamessage is extracted from the stack cache object according to preset fon.
3. according to the method described in claim 2, it is characterized in that, the fon includes believing for each font member Origin identification, the end of identification of breath, it is described to extract font member from the stack cache object according to preset fon The step of information, comprising:
According to the origin identification, end of identification, font metamessage, the font metamessage are read from the stack cache object It include: index information, location information, profile information.
4. according to the method described in claim 3, it is characterized in that, the font metamessage include separate mark, it is described from institute State the step of corresponding target word voxel information of target text is extracted in font metamessage, comprising:
It is identified according to the separation, the corresponding word of remaining text except the target text is deleted from each font metamessage Voxel information obtains target word voxel information.
5. according to claim 1 to method described in 4 any items, which is characterized in that described according to the target word volume elements Information generates the step of the second font file, comprising:
It will be in the newly-built stack cache object of target word voxel information write-in;
The newly-built stack cache object is converted into binary stream;
By in the newly-built font file of binary stream write-in, the second font file is obtained.
6. according to the method described in claim 5, it is characterized in that, the target text obtains as follows:
The font not text in preset standard fontlib is extracted from the configuration of the font of target webpage, obtains target text.
7. according to the method described in claim 6, it is characterized in that, described be back to front end circle for second font file Face, the step of to show the target text, comprising:
Receive the load request to the target webpage;
In response to the load request, second font file is added in the response data of the target webpage;
The response data is back to front-end interface, the front-end interface calls second font file to show the target Text.
8. a kind of processing unit of font file, which is characterized in that described device includes:
First font file read module, for reading the first font file;
Font metamessage extraction module, for extracting font member letter from first font file according to font file rule Breath;
Target word voxel information extraction module, for extracting the corresponding target word volume elements of target text from the font metamessage Information;
Font metamessage conversion module, for generating the second font file according to the target word voxel information;
Target text display module, for second font file to be back to front-end interface, to show the target text.
9. a kind of electronic equipment characterized by comprising
Processor, memory and it is stored in the computer program that can be run on the memory and on the processor, It is characterized in that, the processor realizes the font file as described in one or more in claim 1-7 when executing described program Processing method.
10. a kind of readable storage medium storing program for executing, which is characterized in that when the instruction in the storage medium is held by the processor of electronic equipment When row, so that electronic equipment is able to carry out the processing side of the font file as described in one or more in claim to a method 1-7 Method.
CN201910512670.4A 2019-06-13 2019-06-13 Font file processing method and device, electronic equipment and readable storage medium Active CN110362790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910512670.4A CN110362790B (en) 2019-06-13 2019-06-13 Font file processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910512670.4A CN110362790B (en) 2019-06-13 2019-06-13 Font file processing method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110362790A true CN110362790A (en) 2019-10-22
CN110362790B CN110362790B (en) 2023-10-27

Family

ID=68217308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910512670.4A Active CN110362790B (en) 2019-06-13 2019-06-13 Font file processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110362790B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826005A (en) * 2019-11-13 2020-02-21 北大方正集团有限公司 File generation method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043764A (en) * 2009-10-16 2011-05-04 埃克斯坦西斯股份有限公司 Reduced glyph font files
US20110126191A1 (en) * 2009-11-25 2011-05-26 Red Hat, Inc. Method for extracting font metadata from font files into searchable metadata for package distribution
CN103425631A (en) * 2013-07-19 2013-12-04 百度在线网络技术(北京)有限公司 Method and device for acquiring font files of target characters in document files
CN105630511A (en) * 2016-02-18 2016-06-01 青岛海信移动通信技术股份有限公司 Font switching method and terminal equipment
CN106502968A (en) * 2016-10-12 2017-03-15 北京奇虎科技有限公司 The method and device of data processing
KR20170092875A (en) * 2016-02-04 2017-08-14 (주)폰트릭스 Method of creating and displaying prgrammed fonts and device implementing thereof
CN107679022A (en) * 2017-09-07 2018-02-09 北京京东尚科信息技术有限公司 Uncommon word processing method and its system
CN108073585A (en) * 2016-11-08 2018-05-25 北京国双科技有限公司 Network font loading method, device and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043764A (en) * 2009-10-16 2011-05-04 埃克斯坦西斯股份有限公司 Reduced glyph font files
US20110126191A1 (en) * 2009-11-25 2011-05-26 Red Hat, Inc. Method for extracting font metadata from font files into searchable metadata for package distribution
CN103425631A (en) * 2013-07-19 2013-12-04 百度在线网络技术(北京)有限公司 Method and device for acquiring font files of target characters in document files
KR20170092875A (en) * 2016-02-04 2017-08-14 (주)폰트릭스 Method of creating and displaying prgrammed fonts and device implementing thereof
CN105630511A (en) * 2016-02-18 2016-06-01 青岛海信移动通信技术股份有限公司 Font switching method and terminal equipment
CN106502968A (en) * 2016-10-12 2017-03-15 北京奇虎科技有限公司 The method and device of data processing
CN108073585A (en) * 2016-11-08 2018-05-25 北京国双科技有限公司 Network font loading method, device and system
CN107679022A (en) * 2017-09-07 2018-02-09 北京京东尚科信息技术有限公司 Uncommon word processing method and its system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826005A (en) * 2019-11-13 2020-02-21 北大方正集团有限公司 File generation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110362790B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN110362370B (en) Webpage language switching method and device and terminal equipment
US9977770B2 (en) Conversion of a presentation to Darwin Information Typing Architecture (DITA)
US10592738B2 (en) Cognitive document image digitalization
US20130181995A1 (en) Handwritten character font library
WO2010036457A2 (en) Editing 2d structures using natural input
CN104111922A (en) Processing method and device of streaming document
CN110462613A (en) Automatically generate document
CN101561725A (en) Method and system of fast handwriting input
CN110502711A (en) Page display method, device, electronic equipment and readable storage medium storing program for executing
CN113835692A (en) Dictionary data processing method and device, electronic equipment and computer storage medium
CN104111913A (en) Processing method and device of streaming document
CN111695518A (en) Method and device for labeling structured document information and electronic equipment
CN113656763A (en) Method and device for determining small program feature vector and electronic equipment
CN104375814A (en) Generation method and device of an interface document
WO2011019336A1 (en) Image element searching
US10261987B1 (en) Pre-processing E-book in scanned format
CN110609981A (en) Text processing method and device, electronic equipment and computer readable storage medium
WO2018208412A1 (en) Detection of caption elements in documents
CN110362790A (en) Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file
US9916361B2 (en) Dynamically mapping zones
CN101971171A (en) Method and apparatus for the page-by-page provision of an electronic document as a computer graphic
CN103870543A (en) Method and device for reconstructing document file
US10970533B2 (en) Methods and systems for finding elements in optical character recognition documents
CN114548040A (en) Note processing method, electronic device and storage medium
CN114048174A (en) OFD document processing method and device and electronic equipment

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
GR01 Patent grant
GR01 Patent grant