CN103365894B - A kind of font format conversion method and device - Google Patents

A kind of font format conversion method and device Download PDF

Info

Publication number
CN103365894B
CN103365894B CN201210094319.6A CN201210094319A CN103365894B CN 103365894 B CN103365894 B CN 103365894B CN 201210094319 A CN201210094319 A CN 201210094319A CN 103365894 B CN103365894 B CN 103365894B
Authority
CN
China
Prior art keywords
font
embedding
format
coding
word
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.)
Active
Application number
CN201210094319.6A
Other languages
Chinese (zh)
Other versions
CN103365894A (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 Sursen Electronic Technology Co., Ltd.
Original Assignee
TIANJIN SCHOLAR SOFTWARE 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 TIANJIN SCHOLAR SOFTWARE TECHNOLOGY Co Ltd filed Critical TIANJIN SCHOLAR SOFTWARE TECHNOLOGY Co Ltd
Priority to CN201210094319.6A priority Critical patent/CN103365894B/en
Priority to PCT/CN2012/075861 priority patent/WO2013143217A1/en
Publication of CN103365894A publication Critical patent/CN103365894A/en
Application granted granted Critical
Publication of CN103365894B publication Critical patent/CN103365894B/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

Embodiments provide a kind of font format conversion method and device.Wherein this font format conversion method includes: a kind of font format conversion method, and the second font format for being saved in same embedding word stream by the information taked all embedding words is converted to be taked to embed the first font format that word information is saved in the embedding word stream of correspondence respectively by fontname;It is characterized in that, including: obtain the embedding word stream information of the document comprising the second font format;From embedding of the second font format, word stream reads attribute information one by one that embed word, the attribute information according to each embedding word, generate a corresponding font coding file respectively by different font codings;Create font Code Mapping Tables and font coding mapping, font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by corresponding font coding information registering to font Code Mapping Tables.Utilize technical scheme so that support that the UOML standard interface of the first font format can access its second font format document do not supported.

Description

A kind of font format conversion method and device
Technical field
The present invention relates to field of information processing, especially one font format conversion method and device.
Background technology
UOML is the abbreviation of destructuring operation markup language (UnstructuredOperationMarkupLanguage), and it operates interface by standard set unstructured data and different document formats is realized unified access.The document of various different-formats needs to provide respective UOML to drive, and is used for accessing, revising respective document.
When utilizing UOML standard that different document formats is conducted interviews, owing to the UOML font format supported is different from the font format that some document formats are supported, cause the problem that the embedding word information utilizing these document formats to preserve can not directly use UOML interface to conduct interviews.
Summary of the invention
The purpose of the embodiment of the present invention there are provided a kind of font format conversion method and device so that utilizes UOML standard interface can access its font format document do not supported.
A kind of font format conversion method that the embodiment of the present invention provides, the second font format for being saved in same embedding word stream by the information taked all embedding words is converted to be taked to embed the first font format that word information is saved in the embedding word stream of correspondence respectively by fontname;Including:
Obtain the embedding word stream information of the document comprising the second font format;
From embedding of the second font format, word stream reads attribute information one by one that embed word, the attribute information according to each embedding word, generate a corresponding font coding file respectively by different font codings;
Create font Code Mapping Tables and font coding mapping, font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by corresponding font coding information registering to font Code Mapping Tables.
A kind of font format conversion equipment that the embodiment of the present invention provides, the second font format for being saved in same embedding word stream by the information taked all embedding words is converted to be taked to embed the first font format that word information is saved in the embedding word stream of correspondence respectively by fontname;Including:
For obtaining the module embedding word stream information of the document comprising the second font format;
For word stream reading attribute information one by one that embed word from embedding of the second font format, the attribute information according to each embedding word, the module of a corresponding font coding file is generated respectively by different font codings;
For creating font Code Mapping Tables and font coding mapping, font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by the module in corresponding font coding information registering to font Code Mapping Tables.
Utilize technical scheme so that support that the UOML standard interface of the first font format can access its second font format document do not supported.
Accompanying drawing explanation
Fig. 1 is the flow chart of a kind of font format conversion method in one embodiment of the invention.
Fig. 2 is the flow chart of a kind of font format conversion method in another embodiment of the present invention.
Fig. 3 is the flow chart of a kind of font format conversion method in another embodiment of the present invention.
Detailed description of the invention
Below in conjunction with drawings and Examples, technical scheme is described in detail.
First, it will be understood by those skilled in the art that font format here refers to the graphic designs being applied to all numerals, symbol, Chinese character and alphabetic character, it is possible to be called form or printed words, such as TrueType font, PostScript font, inteilectual's font etc.;Wherein every kind of font comprises again the font coding of multiple different-style feature, such as regular script, the Song typeface, Arial etc..
In an embodiment of the present invention, UOML standard interface support is class Truetype font format, this font format is taked to be saved in, by embedding word information, the mode being embedded into document in the embedding word stream of correspondence more respectively by fontname, in this application, this type of font format is designated the first font format by us.And what actually also have that many font formats take is the mode being embedded into document in same embedding word stream again that the information of all embedding words is saved in, the SEP form of such as inteilectual company, in this application, this type of font format is designated the second font format by us.Utilize font conversion method and device that the embodiment of the present invention provides, when utilizing UOML standard interface to access the document comprising the second font format, described second font format is converted to the first font format, in the content edited is preserved, described first font format is converted to the second font format.
Fig. 1 show a kind of font conversion method that the embodiment of the present invention provides.As it is shown in figure 1, this font conversion method comprises the steps:
Step 101: when opening the document comprising the second font format, first determines whether whether include embedding word information in document, if it has, perform step 102;If it is not, flow process terminates.
In one particular embodiment of the present invention, embed word stream and refer to the set embedding word information of font format.In certain document, such as embedded in the font coding 2 kinds different of the second font format, respectively 20 characters of regular script coding, the Song typeface 30 characters of coding, these process embedding character are by the document, embed character by 50 of these 2 kinds of kinds of characters codings to store together, formed and embed word stream.
Step 102: obtain the embedding word stream information of the document comprising the second font format.
Step 103: read the attribute information embedding word word stream one by one from embedding of the second font format, the attribute information according to each embedding word, generate a corresponding font coding file respectively by different font codings.
It will be understood by those skilled in the art that the attribute information embedding word may include that in the side-play amount of the font number of character, font coding, character contour information side-play amount in word stream and/or character outline self one or more.
As above in example, to the process embedding word stream it is: one by one from embedding reading 50 embedding characters word stream, and analyze the font coding information of each embedding character, 2 font coding files are generated by font coding difference, respectively the font coding file of regular script coding and the font of Song typeface coding encode file, wherein the font coding document memory of regular script coding puts the character of 20 regular script codings, and the font coding document memory of Song typeface coding puts the character of 30 Song typeface codings.
Step 104: create font Code Mapping Tables (Fontlist) and font coding mapping (FontMap), font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by corresponding font coding information registering to font Code Mapping Tables.
In an embodiment of the present invention, need to read out the File header information of embedding word stream from the embedding word stream of the second font format, the attribute information of all embedding words is read out by File header information, by the attribute information of each embedding word, in embedding word stream, unique inquiry the profile information of corresponding character can be read.Due in some cases, the coordinate system that first font format and the second font format adopt in profile information is different and initial point position is different, even hint information also can be variant (as some font format would be likely to occur hint information, some font format is likely not to have hint information), therefore when carrying out font conversion, also need to that the profile information of the second font format is carried out conversion and generate the character contour information meeting the first font format, and be saved in the font coding file of correspondence.
By above several steps, complete the conversion to the first font of second font, the interface that in UOMLSDK, embedding word is correlated with now can be used to carry out the second font document embedding the document functions such as word setting, amendment or deletion so that the document comprising the second font format can be operated by direct use UOML standard interface.Wherein, include the operation of document document is conducted interviews, arrange, revise, deletion etc..
Complete document is arranged operation, after amendment or deleting, when document is preserved, it is necessary to the embedding word information that the word information that embeds of the first font format in now document converts the second font format to preserved.This process is as in figure 2 it is shown, comprise the steps:
Step 201: create the embedded font message file of the second font format, for the embedded font information depositing the second font.
Step 202: take out the font Code Mapping Tables (FontList) in document.
Step 203: travel through this font Code Mapping Tables, encodes according to font, accesses each the font coding mapping (FontMap) in font Code Mapping Tables.If current font coding mapping does not comprise embedding word stream, then continue the next font coding mapping of traversal.If font coding mapping includes embedding word stream, then from this font coding mapping, take out it embed word stream, the content embedding word stream is sequentially stored into the embedded font message file of the second font format.
Step 204: delete the embedding word stream in font coding mapping;As also having the font coding mapping not traveled through, forward step 203 to and continue with next font coding mapping, until all of font coding mapping traversal is complete.
Step 205: close the embedded font message file of the second font format created in step 201, read by file content in core buffer, the second font format obtaining current document embeds word stream, is arranged by file content and completes in this stream to preserve.
In an embodiment of the present invention, need also exist for generating, by the profile information of the first font format carries out conversion, the character contour information meeting the second font format, and be saved in the embedded font message file of the second font format.
Fig. 3 show the flow chart of a kind of font conversion method that one embodiment of the invention provides.In this embodiment, described second font is inteilectual's font format.The present embodiment mainly describes and utilizes UOML standard interface to access the inteilectual's document (SEP document) originally cannot supported.
Step 301: open the SEP document embedding word information containing inteilectual's font format, in the process opening SEP document, takes out the embedding word stream in SEP document from the root node of SEP document.
Step 302: whether judge to embed in word stream has embedding word information;If there being the embedding word information embedded in word stream that obtains, and then perform step 303;Otherwise perform step 314;
Step 303: read the attribute information embedding word word stream one by one from embedding of inteilectual's font format, the attribute information according to each embedding word, generate a corresponding TTF font file respectively by different font codings.
Wherein, from embedding the File header information reading out embedding word stream word stream, read out the attribute information of all embedding words by File header information, by the attribute information of each embedding word, in embedding word stream, unique inquiry reads the profile information (Glyph) of corresponding character.Owing to inteilectual's font format is different from the coordinate system adopted in the profile information of TrueType (Glyph) form and initial point position different, and in the profile information of inteilectual's font format, lacked some information (such as hint) in TrueType form profile information, need that inteilectual's character contour information is carried out conversion and generate the character contour information comprising hint information meeting TrueType form, and be saved in the TTF file of correspondence.
Step 304: find out the font coding mapping (SEP_FontMap) of correspondence in the font Code Mapping Tables (SEP_Fontlist) of SEP document by the fontname of every kind of font, take the embedding word stream of font coding mapping, by the TTF font file curriculum offering of this kind of font coding correspondence to embedding in word stream, and by corresponding font coding information registering font Code Mapping Tables in SEP document.
Step 305: utilize and embed the relevant interface of word in UOMLSDK and SEP document is configured, revises or the document function such as deletion.
Step 306: judge whether to preserve operation SEP document carried out by UOML interface.If preserved, performing step 307, otherwise performing step 314.
Step 307: create inteilectual's embedded font message file, be used for depositing inteilectual's embedded font information.
Step 308: take out word coding body mapping table (SEP_FontList) in SEP document.
Step 309: travel through this font Code Mapping Tables, accesses each font in font Code Mapping Tables and maps (SEP_FontMap).
Step 310: judge whether to comprise embedded font;If it is not, then execution step;If it is, perform step 311.
Step 311: take out its subobject then mapping from this font and embed word stream, the content embedding word stream is sequentially stored into inteilectual's embedded font message file;Delete the embedding word stream in font map element simultaneously.
Now, need to use the dynamic base interface of TrueType character library to travel through the TrueType character outline information that each font coding is corresponding, owing to there is no hint information in the character outline information of inteilectual's font format, and different from the coordinate system that TrueType layout character profile information adopts and initial point, this is accomplished by: to character outline, the TrueType character outline information got is carried out coordinate transform according to inteilectual's font format;And the more point of interpolation can keep the attractive in appearance of font with control character profile when rendering;The character outline information of the inteilectual's font format generated after conversion is stored in inteilectual's word embed in message file;And increase, in inteilectual's word embedding message file, the embedding word attribute information that this character is corresponding.
Step 312: judge whether that having traveled through all of font maps, if it is, perform step 313;Otherwise return and perform step 309.
Step 313: close inteilectual's embedded font message file, read in core buffer by the file content obtained, the inteilectual's font obtaining current document embeds word stream, is arranged by file content and completes in this stream to preserve.
Step 314: close SEP document.
Utilize the technical scheme shown in Fig. 3, the problem that the embedding word information solving to preserve in SEP document can not directly use UOML interface to conduct interviews so that history SEP document can use the UOML interface of standard to conduct interviews, revise.
The embodiment of the present invention additionally provides a kind of font format conversion equipment, and the second font format for being saved in same embedding word stream by the information taked all embedding words is converted to be taked to embed the first font format that word information is saved in the embedding word stream of correspondence respectively by fontname;Including:
For obtaining the module embedding word stream information of the document comprising the second font format;
For word stream reading attribute information one by one that embed word from embedding of the second font format, the attribute information according to each embedding word, the module of a corresponding font coding file is generated respectively by different font codings;
For creating font Code Mapping Tables and font coding mapping, font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by the module in corresponding font coding information registering to font Code Mapping Tables.
In an alternative embodiment of the invention, this device may further comprise:
For creating the module of the embedded font message file of the second font format;
For taking out the module of the font Code Mapping Tables in document;
For traveling through this font Code Mapping Tables, encode according to font, the module of each the font coding mapping in access font Code Mapping Tables;
Embed word stream for taking out it from this font coding mapping, the content embedding word stream is sequentially stored into the module of the embedded font message file of the second font format;
For deleting the module embedding word stream in font coding mapping.
Particular embodiments described above; the purpose of the present invention, technical scheme and beneficial effect have been further described; it is it should be understood that; the foregoing is only presently preferred embodiments of the present invention; it is not intended to limit protection scope of the present invention; all within the spirit and principles in the present invention, any amendment of making, equivalent replacement, improvement etc., should be included within protection scope of the present invention.

Claims (9)

1. a font format conversion method, the second font format for being saved in same embedding word stream by the information taked all embedding words is converted to be taked to embed the first font format that word information is saved in the embedding word stream of correspondence respectively by fontname;It is characterized in that, including:
Obtain the embedding word stream information of the document comprising the second font format;
From embedding of the second font format, word stream reads attribute information one by one that embed word, the attribute information according to each embedding word, generate a corresponding font coding file respectively by different font codings;
Create font Code Mapping Tables and font coding mapping, font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by corresponding font coding information registering to font Code Mapping Tables.
2. the method for claim 1, it is characterised in that the attribute information of described embedding word includes: one or more in the side-play amount of the font number of character, font coding, character contour information side-play amount in word stream and/or character outline self.
3. the method for claim 1, it is characterised in that the coordinate system that described first font format and the second font format adopt in profile information is different and initial point position is different, farther includes:
The profile information of the second font format is carried out changing the character contour information meeting the first font format that generates, and is saved in the font coding file of correspondence.
4. the method for claim 1, it is characterised in that farther include:
The interface that in UOMLSDK, embedding word is relevant is used to carry out the second font document embedding the document function that word is arranged.
5. method as claimed in claim 4, it is characterised in that the document function that described embedding word is arranged includes the amendment for embedding word or deletion.
6. method as claimed in claim 4, it is characterised in that when described document function is preserved, farther include:
Create the embedded font message file of the second font format;
Take out the font Code Mapping Tables in document;
Travel through this font Code Mapping Tables, encode according to font, access each the font coding mapping in font Code Mapping Tables;
From this font coding mapping, take out it embed word stream, the content embedding word stream is sequentially stored into the embedded font message file of the second font format;
Delete the embedding word stream in font coding mapping.
7. method as claimed in claim 6, it is characterised in that the coordinate system that described first font format and the second font format adopt in profile information is different and initial point position is different, and described method farther includes:
Generate, by the profile information of the first font format being carried out conversion, the character contour information meeting the second font format, and be saved in the embedded font message file of the second font format.
8. a font format conversion equipment, the second font format for being saved in same embedding word stream by the information taked all embedding words is converted to be taked to embed the first font format that word information is saved in the embedding word stream of correspondence respectively by fontname;It is characterized in that, including:
For obtaining the module embedding word stream information of the document comprising the second font format;
For word stream reading attribute information one by one that embed word from embedding of the second font format, the attribute information according to each embedding word, the module of a corresponding font coding file is generated respectively by different font codings;
For creating font Code Mapping Tables and font coding mapping, font coding file content corresponding for font coding is arranged in the embedding word stream of corresponding font coding mapping, by the module in corresponding font coding information registering to font Code Mapping Tables.
9. device as claimed in claim 8, it is characterised in that farther include:
For creating the module of the embedded font message file of the second font format;
For taking out the module of the font Code Mapping Tables in document;
For traveling through this font Code Mapping Tables, encode according to font, the module of each the font coding mapping in access font Code Mapping Tables;
Embed word stream for taking out it from this font coding mapping, the content embedding word stream is sequentially stored into the module of the embedded font message file of the second font format;
For deleting the module embedding word stream in font coding mapping.
CN201210094319.6A 2012-03-29 2012-03-29 A kind of font format conversion method and device Active CN103365894B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201210094319.6A CN103365894B (en) 2012-03-29 2012-03-29 A kind of font format conversion method and device
PCT/CN2012/075861 WO2013143217A1 (en) 2012-03-29 2012-05-22 Method and device for converting font format

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210094319.6A CN103365894B (en) 2012-03-29 2012-03-29 A kind of font format conversion method and device

Publications (2)

Publication Number Publication Date
CN103365894A CN103365894A (en) 2013-10-23
CN103365894B true CN103365894B (en) 2016-07-13

Family

ID=49258136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210094319.6A Active CN103365894B (en) 2012-03-29 2012-03-29 A kind of font format conversion method and device

Country Status (2)

Country Link
CN (1) CN103365894B (en)
WO (1) WO2013143217A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631968B (en) * 2013-12-17 2017-01-18 天津书生软件技术有限公司 Method and device for realizing font imbedding of document
CN105224509A (en) * 2014-05-30 2016-01-06 北大方正集团有限公司 A kind of method and device generating font format
CN106033412B (en) * 2015-03-20 2019-07-26 广州金山移动科技有限公司 A kind of text conversion method and device
CN108536398A (en) * 2018-01-18 2018-09-14 艾体威尔电子技术(北京)有限公司 A method of realizing Chinese and English different fonts printing
CN109656821B (en) * 2018-12-11 2022-06-07 万兴科技股份有限公司 Test method and device
CN116306498B (en) * 2023-05-16 2023-09-12 福昕鲲鹏(北京)信息科技有限公司 Text rendering method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310561A (en) * 2000-02-21 2001-08-29 肯伍德公司 Character display technique
CN101493811A (en) * 2008-01-24 2009-07-29 鸿富锦精密工业(深圳)有限公司 Font automatic identification and conversion system and method
CN101699426A (en) * 2009-11-06 2010-04-28 上海传知信息科技发展有限公司 Document format conversion system and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1294355A (en) * 2000-11-27 2001-05-09 英业达集团(南京)电子技术有限公司 Instant translation method able to recognize simplified and unsimplified characters
JP2007261123A (en) * 2006-03-29 2007-10-11 Kyocera Mita Corp Image forming apparatus, electronic storage medium used in it and image formation program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310561A (en) * 2000-02-21 2001-08-29 肯伍德公司 Character display technique
CN101493811A (en) * 2008-01-24 2009-07-29 鸿富锦精密工业(深圳)有限公司 Font automatic identification and conversion system and method
CN101699426A (en) * 2009-11-06 2010-04-28 上海传知信息科技发展有限公司 Document format conversion system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
TrueType Collection字体的析构;李尘一等;《内蒙古科技与经济》;20050915;全文 *
基于AutoCAD数字地形图批量文字字体替换器设计与实践;刘增达等;《城市勘测》;20080831(第4期);全文 *

Also Published As

Publication number Publication date
WO2013143217A1 (en) 2013-10-03
CN103365894A (en) 2013-10-23

Similar Documents

Publication Publication Date Title
CN103365894B (en) A kind of font format conversion method and device
CN101727674B (en) Method for marking picture in file, and method for reproducing mark of picture in file
US6565609B1 (en) Translating data into HTML while retaining formatting and functionality for returning the translated data to a parent application
CN104461484A (en) Front-end template implementation method and device
CN103500118B (en) A kind of Cascading Style Sheet optimization method and device
US7982737B2 (en) System and method for independent font substitution of string characters
EP1376387A2 (en) Word-processing document stored in a single XML file
US7844898B2 (en) Exporting a document in multiple formats
JP2002318798A (en) Method and system for user-controllable data grouping in structural document translation
CN102750337B (en) Producing method and device for font
CN108399172B (en) Vector diagram generation method and device
CN103268340B (en) Format reflowable file based on hierarchy type index is set up and method for drafting
CN103902513A (en) Method and device for displaying fonts in terminal device
US7370060B2 (en) System and method for user edit merging with preservation of unrepresented data
CN103678685A (en) Webpage labeling method and device
WO2009000141A1 (en) Representation method, system and device of layout file logical structure information
RU2406142C2 (en) System and method of storing documents in serial binary format
CN101504662A (en) Data conversion method and apparatus
CN111104557A (en) Heterogeneous document processing system and method based on standard document markup language specification
CN111562919A (en) Method, system and storage medium for generating front-end webpage code based on PSD file
CN101655835B (en) Method for text message processing, text message output and character retrieval in electronic document and device thereof
CN102063416B (en) Method and system for embedding double-byte fonts into PDF file
US7730388B2 (en) Converting an enhanced metafile into a chronologically independent object property list for conversion into a PDF document
CN105512096B (en) A kind of optimization method and device based on font embedded in document
CN102110108B (en) Method and device for processing galley proof file

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20181207

Address after: 100029 Changxin Building 408-409, 39 Anding Road, Chaoyang District, Beijing

Patentee after: Beijing Sursen Electronic Technology Co., Ltd.

Address before: 300308 Tianjin Dongli Airport Economic Zone, Second Floor, Building 9, East District, Airport Business Park, No. 80 Huanbei Road

Patentee before: Tianjin Scholar Software Technology Co., Ltd.

TR01 Transfer of patent right