CN101996192A - Word stock combining method and system - Google Patents

Word stock combining method and system Download PDF

Info

Publication number
CN101996192A
CN101996192A CN 200910090995 CN200910090995A CN101996192A CN 101996192 A CN101996192 A CN 101996192A CN 200910090995 CN200910090995 CN 200910090995 CN 200910090995 A CN200910090995 A CN 200910090995A CN 101996192 A CN101996192 A CN 101996192A
Authority
CN
China
Prior art keywords
character library
combined
parameter
maxp
numerical value
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
CN 200910090995
Other languages
Chinese (zh)
Other versions
CN101996192B (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.)
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
Beijing Founder Electronics 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 Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN 200910090995 priority Critical patent/CN101996192B/en
Publication of CN101996192A publication Critical patent/CN101996192A/en
Application granted granted Critical
Publication of CN101996192B publication Critical patent/CN101996192B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)

Abstract

The invention belongs to the technical field of word processing and in particular discloses a word stock combining method used for combining at least two word stocks to form a new word stock. The method comprises the following steps of: (10) setting the numerical values of all corresponding parameters in a maxp table of a combined word stock on the basis of the numerical values of all parameters in maxp tables of word stocks to be combined; and (20) combining file headers and all tables in the word stocks to be combined one by one to form a new combined word stock. In addition, the invention also discloses a word stock combining system. The system mainly comprises a maxp table setting unit and a combining and processing unit, wherein the maxp table setting unit is used for setting the numerical values of all corresponding parameters in the maxp table in the combined word stock on the basis of the numerical values of all parameters in the maxp tables of the word stocks to be combined; and the combining and processing unit is used for combining the file headers and all tables in the word stocks to be combined one by one to form a new combined word stock. The method and the system not only can be used for quickly and efficiently combining the word stocks, but also can guarantee that the combined word stock has good quality and reliability.

Description

A kind of character library merges method and system
Technical field
The invention belongs to the word processing technical field, be specifically related to a kind of method and system that merge character library.
Background technology
At present, the word-base technology of comparative maturity mainly is divided into two classes: matrix font word-base technology and skeleton font word-base technology.This two classes technology adopts different organizational forms to realize the storage of font.
For example, the matrix font storage mode adopts scale-of-two to store the matrix font of fixed size, just the storage mode of the black and white bitmap of often saying.In this storage mode, because the data organization mode is simple, so the merging of dot matrix word library is also fairly simple, direct.For example, the merging of code table and data can be carried out respectively, the merging of character library can be realized according to concrete data organization mode.
The skeleton font storage mode adopts one or more closed curve profiles to describe font, and the mechanism that curve is adjusted is provided simultaneously, makes character library manufacturer to be controlled the display effect of font under some size.Though this can guarantee the demonstration or the print quality of character library, simultaneously also for the operation of character library has increased difficulty, make the editing operation of character library become not as the matrix font storage mode direct like that.
Particularly, after the distribution of the character library of skeleton font storage mode, it is made amendment, then will depend on former character library manufacturer, that is, by former manufacturer this character library is converted to its internal format and makes amendment, and after modification, reissue as need.If above-mentioned modification relates to character library and merges such operation at two above character libraries, then also need to develop in addition the merging that special software is realized internal format, and then conversion generates final character library.That is to say that above-mentioned character library merging method is a kind of indirect mode, its reliability depends on the independently developed above-mentioned special software of each character library manufacturer, and this method also exist merging process loaded down with trivial details, should not guarantee problems such as final mass.
Summary of the invention
For solving the problems of the technologies described above, the invention provides a kind of character library and merge method and system, it not only can be based on the existing character library form of character library to be combined and quickness and high efficiency ground carries out the merging of character library, has good quality and reliability but also can guarantee to merge the back character library.
For this reason, the invention provides a kind of character library merging method, be used at least two character libraries are merged and the new character library in formation merging back.This method comprises the steps: 10) numerical value of each relevant parameter in the maxp table that merges the back character library is set based on the numerical value of each parameter in the maxp of the character library to be combined table (Maximum profile, greatest requirements table); 20) file header in the character library to be combined and each table is merged one by one and form new character library after the merging.
Wherein, specifically in described step 10) carry out following operation: read the numerical value of the parameter m axFunctionDefs in the maxp table of each character library to be combined, and with the numerical value of these numerical value sums as this parameter m axFunctionDefs in the maxp table that merges the back character library; Read the numerical value of all the other each parameters except that parameter m axFunctionDefs in the maxp table of character library to be combined, and for each parameter, numerical value in its maxp table in each character library to be combined is compared, get the numerical value of wherein maximum numerical value as this parameter in the maxp table that merges the back character library.
Wherein, in described step 20) also comprise character library radix set-up procedure before: promptly, under the character library radix that character library to be combined adopted situation inequality, be that standard is adjusted the radix of character library to be combined with predetermined merging back character library radix.
Wherein, in described step 20) also comprise character library baseline set-up procedure before: promptly, under the character library baseline that character library to be combined adopted situation inequality, be that standard is adjusted the baseline of character library to be combined with predetermined merging back character library baseline.
Wherein, in described step 20) also comprise function numbering set-up procedure before: promptly, function numbering in character library to be combined exists under the situation of conflict, to fpgm table (Font program, the font program list), prep table (CVT Program, the controlling value program list) and/or the numbering of the related function in the glyf table (Glyph data, primitive data table) adjust.
Particularly, can realize the adjustment of related function numbering in the fpgm table like this: promptly, read the numerical value of the parameter m axFunctionDefs in the maxp table of each character library to be combined, keep the function numbering in the fpgm table of first character library constant, each function in the fpgm table of other character libraries to be combined is numbered the numerical value sum that adds the maxFunctionDefs in this character library sequence number each character library before respectively, to eliminate function numbering collision problem.
Particularly, can realize the adjustment of related function numbering in the prep table like this: promptly, for the called function numbering in the prep table of each character library to be combined, adjust according to the function numbering regulation rule that fpgm table in the same character library is adopted, to eliminate function numbering collision problem.
Particularly, can realize the adjustment of related function numbering in the glyf table like this: promptly, for the called function numbering in the glyf table of each character library to be combined, adjust according to the function numbering regulation rule that fpgm table in the same character library or prep table are adopted, to eliminate function numbering collision problem.
Wherein, in described step 20) also comprise the set-up procedure of font composing parameter before: promptly, adopted in character library to be combined under the situation of different character library radixes and/or character library baseline, with predetermined merging back character library radix is standard, and the parameter relevant with the composing of font level in the hmtx table of character library to be combined adjusted; And/or be standard with predetermined merging back character library radix and/or baseline, to adjusting in the vmtx table of character library to be combined with the font relevant parameter of vertically setting type.
Wherein, in described step 20) also comprise such step before: promptly, under the character library radix that character library to be combined adopted situation inequality, be standard with predetermined merging back character library radix, the correlation parameter in the cvt table of character library to be combined is adjusted.
In addition, the present invention also provides a kind of character library combination system, is used at least two character libraries are merged and the new character library in formation merging back.This system comprises: maxp table is provided with the unit, and it is provided with the numerical value of each relevant parameter in the maxp table that merges the back character library based on the numerical value of each parameter in maxp table of character library to be combined; Merge and processing unit, it merges the file header in the character library to be combined and each table one by one and forms new character library after the merging.
Wherein, described maxp table is provided with the unit and specifically comprises maxp table intrinsic parameter read module, accumulation process module and comparison process module.Described maxp table intrinsic parameter read module, parameter during its maxp that reads each character library to be combined shows, and the numerical value of the parameter m axFunctionDefs that read transferred to the accumulation process module, will transfer to the comparison process module except that the numerical value of all the other each parameters the parameter m axFunctionDefs; Described accumulation process module, its numerical value with the maxFunctionDefs in the maxp table of each character library to be combined adds up, and the numerical value of sum as this parameter m axFunctionDefs in the maxp table that merges the back character library that will add up; Described comparison process module is carried out such operation: promptly, for each parameter, the numerical value in the maxp table of this parameter in each character library to be combined is compared, get the numerical value of wherein maximum numerical value as this parameter in the maxp table that merges the back character library.
Character library combination system provided by the invention can also comprise character library radix adjustment unit and/or character library baseline adjustment unit.Wherein, character library radix adjustment unit is used under the character library radix that adopts in the character library to be combined situation inequality, is that standard is adjusted the radix of character library to be combined with predetermined merging back character library radix; Character library baseline adjustment unit is used under the character library baseline that adopts in the character library to be combined situation inequality, is that standard is adjusted the baseline of character library to be combined with predetermined merging back character library baseline.
Character library combination system provided by the invention can also comprise function numbering adjustment unit, and it is used for existing under the situation of conflict in the function numbering of character library to be combined, and the related function numbering in fpgm table, prep table and/or the glyf table is adjusted.
Character library combination system provided by the invention can also comprise font composing parameter adjustment unit, be used for having adopted under the situation of different character library radixes and/or character library baseline in character library to be combined, with predetermined merging back character library radix is standard, and the parameter relevant with the composing of font level in the hmtx table of character library to be combined adjusted; And/or be standard with predetermined merging back character library radix and/or baseline, to adjusting in the vmtx table of character library to be combined with the font relevant parameter of vertically setting type.
Character library combination system provided by the invention can also comprise cvt table adjustment unit, be used under the character library radix that adopts in the character library to be combined situation inequality, with predetermined merging back character library radix is standard, and the correlation parameter in the cvt table of character library to be combined is adjusted.
With respect to prior art, the present invention has following beneficial effect:
Character library provided by the invention merge method and system can be directly according to the data in the character library to be combined or instruct each table of revising/adjusting character library to be combined, and character library to be combined is merged based on this, and need not as prior art, former manufacturer and special software by means of character library to be combined merge, therefore, the method and system of merging character library provided by the invention can avoid introducing third party's data or order format, and then avoid because of introducing the problem that third party's data or order format may cause, thereby carrying out to guarantee to merge when character library merges the quality of back character library quickly and easily.
Description of drawings
Fig. 1 is the schematic flow sheet of character library merging method provided by the invention;
Fig. 2 adjusts the synoptic diagram of mode for the character library radix that is adopted among the present invention;
Fig. 3 shows the font baseline that is adopted in a certain character library to be combined;
Fig. 4 shows the font baseline that is adopted in another character library to be combined;
Fig. 5 is the schematic flow sheet of a specific embodiment of character library merging method provided by the invention; And
Fig. 6 is the theory diagram of a specific embodiment of character library combination system provided by the invention.
Embodiment
Below in conjunction with embodiment and accompanying drawing character library merging method provided by the invention and related system are described in detail.In the following embodiments, the character library describing mode adopts TrueType character library commonly used in the Windows system, wherein related data or order format are based on the text that the TTX that develops software derives, and the data structure of this character library mainly comprises file header and some tables of data, for example maxp table, fpgm table, prep table, glyf table etc.
See also Fig. 1, the workflow of character library merging method provided by the invention is as follows:
Step 10 is provided with the numerical value of each relevant parameter in the maxp table that merges the back character library based on the numerical value of each parameter in the maxp of the character library to be combined table.
Particularly, read the numerical value of the parameter m axFunctionDefs in the maxp table of each character library to be combined, and with the numerical value of these numerical value sums as this parameter m axFunctionDefs in the maxp table that merges the back character library.Simultaneously, read the numerical value of all the other each parameters except that parameter m axFunctionDefs in the maxp table of character library to be combined, and for each parameter, numerical value in its maxp table in each character library to be combined is compared, get the numerical value of wherein maximum numerical value as this parameter in the maxp table that merges the back character library.
Step 20 under the situation of the character library cardinal sum character library baseline unanimity that character library to be combined adopted, merges the file header in the character library to be combined and other each table one by one and forms new character library after the merging.When merging, can carry out corresponding change to the related content in file header and each table according to actual conditions.
Yet in actual applications, different character libraries is when design, and the character library radix that is adopted may be together, and as shown in Figure 2, it is the character library to be combined of AA x BB that the left side rectangle is represented radix, and it is the character library to be combined of CC x DD that the right side rectangle is represented radix.In this case, just need be before abovementioned steps 20, the character library radix adjusted make its coupling, that is to say that mode that can the proportion of utilization conversion makes the radix of character library to be combined reach consistent.For example, if be the benchmark that character library was adopted after the merging with character library radix in right side among Fig. 2, then needing left side character library radix transform be right side character library radix, that is, transform to CC x DD by radix AA x BB, like this, the conversion ratio of horizontal direction is CC/AA, and the conversion ratio on the vertical direction is DD/BB.Generally speaking, CC/AA=DD/BB.After having determined above-mentioned conversion ratio, with the transformation relation of x '=x*CC/AA, y '=y*DD/BB each font that need merge in the character library of left side is carried out transformation of scale, x ' wherein, the coordinate behind the y ' representation transformation, the coordinate before the x, y representation transformation.Can realize the adjustment of character library radix like this.
Similarly, when the design font, different character library manufacturers also can adopt different character library baselines usually, in this case, just need adjust baseline before abovementioned steps 20.For example, Fig. 3 shows two kinds of different character library baselines respectively with Fig. 4, and wherein, baseline height shown in Figure 3 is hs; Baseline height shown in Figure 4 is hd.If with baseline shown in Figure 4 is the baseline that merges the back character library, then need baseline shown in Figure 3 is adjusted, that is, in the vertical direction is adjusted it can obtain baseline shown in Figure 4.That is to say that above-mentioned baseline adjustment is exactly that the font coordinate among Fig. 3 has been carried out such adjustment: promptly, make y '=y+hd-hs, wherein, y and y ' represent the coordinate before and after each point transformation in the font respectively.
In the practical application,, then also need in font composing parameter and the cvt table related parameter adjustment being arranged if because of the radix of character library to be combined and/or baseline is inequality that it has been carried out above-mentioned relevant adjustment.
Particularly, adopted in character library to be combined under the situation of different character library radixes and/or character library baseline, for the character library that is applicable to horizontal type-setting mode, with predetermined merging back character library radix is standard, and the parameter relevant with the composing of font level in the hmtx table of character library to be combined adjusted; For the character library that is applicable to vertical type-setting mode, be standard with predetermined merging back character library radix and/or baseline, to adjusting in the vmtx table of character library to be combined with the vertical relevant parameter of setting type of font; And, be standard with predetermined merging back character library radix, to the overall steering order in the cvt table of character library to be combined is employed related parameter adjustment arranged.
In addition, each character library to be combined all has numerous functions usually, and this is avoided in different character libraries to be combined function with same functions numbering being carried out different suchlike problems such as definition with regard to being difficult to.In this case, if the function numbering is not adjusted when merging character library and, then can make to merge to exist in the character library of back to number and the collision problem (be designated hereinafter simply as function and number collision problem) that phenomenon causes such as repeat because of function to its directly mergings/uses.For this reason, just need before abovementioned steps 20, the relevant function numbering in the character library to be combined be adjusted.For example, the relevant function numbering in fpgm table, prep table, the glyf table is adjusted.
Wherein, the adjustment of related function numbering can realize like this in the fpgm table: promptly, read the numerical value of the parameter m axFunctionDefs in the maxp table of each character library to be combined, keep the function numbering in the fpgm table of first character library constant, each function numbering in the fpgm table of other character libraries to be combined is added the numerical value sum of the parameter m axFunctionDefs in this character library sequence number each character library before respectively, thereby eliminate above-mentioned function numbering collision problem.
For the called function numbering in the prep table of each character library to be combined, can adjust according to the function numbering regulation rule that fpgm table in the same character library is adopted, thereby eliminate above-mentioned function numbering collision problem.
For the called function numbering in the glyf table of each character library to be combined, can adjust according to the function numbering regulation rule that fpgm table in the same character library or prep table are adopted, thereby eliminate above-mentioned function numbering collision problem.
Describe character library merging method provided by the invention in detail below in conjunction with a specific embodiment shown in Figure 5.For ease of explanation, in the present embodiment with the example of merging into of two character libraries, promptly, first character library and second character library are merged and generate the 3rd character library, in other words, second character library merged in first character library generate the 3rd character library, wherein first character library and second character library are called character library to be combined, and the 3rd character library is called and merges the back character library.
Wherein, in the step 110, under the character library radix that character library to be combined adopted situation inequality, be that standard is adjusted the radix of character library to be combined with predetermined merging back character library radix.Concrete method of adjustment and process are similar to the front in conjunction with the explanation that Fig. 2 did, and do not repeat them here.
Step 120 under the character library baseline that character library to be combined adopted situation inequality, is that standard is adjusted the baseline of character library to be combined with predetermined merging back character library baseline.Concrete method of adjustment and process are similar to the front in conjunction with the explanation that Fig. 3 and Fig. 4 did, and do not repeat them here.
Step 130 is numbered under the situation that has conflict at the function of character library to be combined, and the related function numbering during fpgm table, prep table and/or glyf are shown is adjusted.Method of adjustment and process to these three tables is elaborated below.
One, the adjustment of function numbering in the fpgm table.
At first, number, earlier the function definition mode in the fpgm table is elaborated for ease of the function how explanation is adjusted in the fpgm table.Usually, the formal definition with function in the fpgm of the TrueType character library table has overall steering order, so that call in other places in character library.The following form of the general employing of this fpgm table:
<fpgm>
<assembly>
NPUSHB[]/*59values?pushed*/
82?81?80?79?78?77?76?75?74?73?72?71?70?69?68?67?66?65?64?63?62?61?60?59?58
57?56?55?54?53?47?46?45?44?40?38?37?36?35?34?31?24?20?17?16?15?13?11?10?9
8?7?6?5?4?3?2?1?0
FDEF[]
RCVT[]
SWAP[]
GC[0]
ADD[]
DUP[]
PUSHB[]/*1value?pushed*/
38
ADD[]
PUSHB[]/*1?value?pushed*/
4
MINDEX[]
SWAP[]
SCFS[]
SCFS[]
ENDF[]
FDEF[]
RCVT[]
SWAP[]
In fact, the function definition in the fpgm table generally can adopt following dual mode.Wherein, first kind of mode is: function numbering of defined function numbering, and every definition one by one just defines this function body immediately, for example:
NPUSHB[]a
FDEF[]
...
EDEF[]
The second way is: at first defines some function numberings, and then defines the respective function body one by one, for example:
NPUSHB[]a?b?c...n
FDEF[]
...
EDEF[]
FDEF[]
...
EDEF[]
...
...
FDEF[]
...
EDEF[]
In fact, above-mentioned two kinds of definition modes may be used alone, can also be used in combination.Wherein, NPUSHB[] after alphabetical a b c...n representative function numbering, for being not less than zero integer.
Next, describe the method for adjustment and the process of function numbering in the fpgm table in detail.
In actual applications, no matter adopt above-mentioned which kind of definition mode, there is function numbering collision problem as long as judge character library to be combined, just can adopt following manner to be solved: promptly, in the maxp of first character library and second character library table, read the numerical value of the parameter m axFunctionDefs of expression maximal function numbering respectively, keep the function numbering in the fpgm table of first character library constant, each function numbering in the fpgm table of second character library is added the numerical value of the maxFunctionDefs in first character library respectively; Simultaneously, with the numerical value sum of the parameter m axFunctionDefs in the maxp of two character libraries table numerical value as the parameter m axFunctionDefs in the maxp table that merges the back character library.Can solve the function numbering collision problem in the fpgm table of first character library and second character library like this.
Particularly, from the maxp table of first character library, read the numerical value of the parameter m axFunctionDefs of this character library maximal function numbering of expression earlier, be designated as maxFunctionDefs_1; Correspondingly, from the maxp table of second character library, read the numerical value of the parameter m axFunctionDefs of this character library maximal function numbering of expression, be designated as maxFunctionDefs_2; Then, keep the function numbering in the fpgm table of first character library constant, each function in the fpgm table of second character library is numbered the numerical value that adds the maxFunctionDefs in first character library respectively, that is, each function numbering in the fpgm table of second character library is added maxFunctionDefs_2 respectively.Like this, promptly finished the adjustment of the function numbering in the fpgm table of character library to be combined.
Then, with the function NPUSHB[in the fpgm table] be that example describes the function numbering of how adjusting in the fpgm table in detail.Wherein, this function NPUSHB[] adopt aforementioned first kind of function definition mode, function is numbered a.
As previously mentioned, keep function numbering in the fpgm table of first character library constant and only change respective function numbering in the fpgm table of second character library, that is to say, respective function numbering in the fpgm table of second character library is added maxFunctionDefs_1, like this, above-mentioned function numbering a is adjusted to a+maxFunctionDefs_1, correspondingly, the function NPUSHB[in the fpgm of second character library table] definition promptly be adjusted to:
NPUSHB[](a+maxFunctionDefs_1)
FDEF[]
...
EDEF[]
Similarly, the function numbering that other function definitions in the fpgm table are related is also done above-mentioned adjustment, the function numbering that can finish in the fpgm table of character library to be combined is adjusted.
It is to be noted, to the function numbering in the fpgm of second character library table adjust finish after, content whole in this fpgm table can be appended to the back or the foremost of the fpgm table of first character library, simultaneously the maxFunctionDefs in the maxp table of first character library be revised as (maxFunctionDefs_1+maxFunctionDefs_2).That is to say, can after the function numbering adjustment in the fpgm table is finished, carry out the merging of fpgm table at once.Certainly, in actual applications, also can carry out the adjustment of fpgm table earlier, and fpgm shown that merging process is postponed and in subsequent step the merging with other tables carry out.
Its two, the adjustment of function numbering in the prep table.
Usually, the following form of the general employing of the table of the prep in the TrueType character library:
<prep>
<assembly>
NPUSHB[]/*244values?pushed*/
119?66?8?31?118?66?8?31?117?67?8?31?116?67?8?31?115?67?8?31?114?67?8?31?113
66?8?31?112?66?8?31?111?66?8?31?110?66?8?31?106?66?8?31?105?66?8?31?104?67
8?31?103?67?8?31?102?67?8?31?101?67?8?31?100?66?8?31?99?66?8?31?98?66?8
31?97?66?8?31?90?66?8?31?89?66?8?31?88?67?8?31?87?67?8?31?86?67?8?31
85?67?8?31?84?66?8?31?83?66?8?31?82?66?8?31?81?66?8?31?77?66?8?31?76
66?8?31?75?67?8?31?74?67?8?31?73?67?8?31?72?67?8?31?71?66?8?31?70?66
8?31?69?66?8?31?68?66?8?31?67?65?8?31?66?65?8?31?35?14?69?34?12?69?33
10?69?32?8?69?31?6?69?30?4?69?29?2?69?28?0?69?26?8?24?8?22?8?20?8
18?8?16?8?14?8?12?8?10?8?8?8?6?8?4?8?2?8?0?8?1?0?1?1?0
9?1?2?0?8?0?40?40?0?0?0?18?17?8?2?64?55?15?63
PUSHW[]/*1?value?pushed*/
256
PUSHB[]/*2?values?pushed*/
221
MPPEM[]
PUSHW[]/*1value?pushed*/
2047
GT[]
MPPEM[]
PUSHB[]/*1?value?pushed*/
8
LT[]
There is conflict if judge the function numbering of character library to be combined, and the function numbering in the fpgm table adjusted, so just need correspondingly adjust the invoke code (that is, called function is numbered) in the prep table of corresponding character library (that is second character library).Usually, the following form of general employing is come call function in the prep table:
NPUSHB[]a?b?c?d...n
...
CALL[]
Or
NPUSHB[]a?b?c?d...n
...
LOOPCALL[]
CALL wherein or LOOPCALL instruction are the function call instruction.Usually, called function is numbered program and carries out this moment, the operand at storehouse top.For this reason, just need to identify the respective function numbering the numerous data in storehouse earlier, and then it is adjusted with reference to the adjustment mode of function numbering in the aforementioned fpgm table.In actual identification and the adjustment process, can introduce following table 1 usually and realize.And, in identification and adjustment process, also needing to be provided with one in order to write down the operand current location variable pos of current operand position, its initial value is 0.
Table 1:
The location of instruction Instruction code
1 NPUSHB[]
2 119
... ...
100 SPVTL[0]
101 PUSHB[]
102 10
... ...
180 CALL[]
In the table 1, the location of instruction is the sequence number that each instruction or operand occur in the prep table, since 1 sequential counting.So-called operand refers to the non-operation part in the prep table, is generally and is not less than 0 integer.
Next, with reference to table 1 and the implementation of dummy instruction.At first, when the location of instruction was 1, the corresponding instruction code was NPUSHB[], this instruction code is for instruction but not operand, so the value of operand current location variable pos remains unchanged, and still is 0.
Run to the location of instruction 2 then, the corresponding instruction code is " 119 ", and this instruction code is an operand, so the value of operand current location variable pos need increase by 1, promptly becomes 1.
Next carry out successively, when running to the location of instruction and be 100, its pairing instruction code is " SPVTL[0] ", this instruction code is such instruction: require to extract two operands and do not have rreturn value to be pressed in the storehouse from storehouse, at this moment, suppose operand current location variable pos=50, like this, after executing this instruction, because of taking 2 operands away from the storehouse top, so the value of operand current location variable pos also correspondingly deducts 2 and become 48.
When running to the location of instruction 180, its pairing instruction code is " CALL[] ", and this instruction code is the instruction of call function.Suppose the operand current location variable pos=20 of this moment, then should find the position in storehouse is 20 operand, with this operand (promptly according to same character library, second character library) the function numbering regulation rule in the fpgm table is made amendment, for example, this operand is added maxFunctionDefs_1.
Continue the remaining command in the dry run prep table, as long as meet instruction CALL[] or LOOPCALL[], just revise corresponding operand according to above-mentioned adjustment mode.Like this, can realize adjustment to the related function numbering in the prep of second character library table.
It is to be noted, to the function numbering in the prep of second character library table adjust finish after, content whole in this prep table can be appended to the back or the foremost of the prep table of first character library, this be in fact the numbering of the function in the prep table is adjusted after, carry out the merging of prep table at once.Certainly, in actual applications, the merging of prep table also can be carried out with the merging of other tables after a while.
Its three, the adjustment of function numbering in the glyf table.
There is conflict if judge the function numbering of character library to be combined, and the fpgm table of second character library and/or the related function numbering in the prep table are adjusted, so just need correspondingly adjust corresponding character library (promptly, second character library) the related function numbering in the glyf table, and the font data in this table is partly remained unchanged.Function numbering method of adjustment in the glyf table of second character library and process are similar to method and the process in above-mentioned fpgm table and/or the prep table, do not repeat them here.
Step 140 based on each parameter value in the maxp table of character library to be combined, is provided with each parameter value in the maxp table that merges the back character library.Usually, record the combined data of font required memory distribution condition in the maxp table, its concrete structure is generally as follows:
<maxp>
<!--Most?of?this?table?will?be?recalculated?by?the?compiler-->
<tableVersion?value=″0x10000″/>
<numGlyphs?value=″38048″/>
<maxPoints?value=″253″/>
<maxContours?value=″49″/>
<maxCompositePoints?value=″430″/>
<maxCompositeContours?value=″52″/>
<maxZones?value=″2″/>
<maxTwilightPoints?value=″16″/>
<maxStorage?value=″47″/>
<maxFunctionDefs?value=″83″/>
<maxlnstructionDefs?value=″0″/>
<maxStackElements?value=″6144″/>
<maxSizeOflnstructions?value=″1407″/>
<maxComponentElements?value=″33″/>
<maxComponentDepth?value=″1″/>
</maxp>
Wherein, need the parameter of adjustment referring to following table 2.In the practical application, when there is collision problem in the numbering of the function in first character library and second character library, the parameter m axFunctionDefs that has been combined in abovementioned steps 130 in the character library of back has carried out corresponding adjustment, so just no longer comprises parameter m axFunctionDefs in the parameter that needs to adjust in the listed step 140 of table 2.
Table 2:
maxPoints
maxContours
maxCompositePoints
maxCompositeContours
maxZones
maxTwilightPoints
maxStorage
maxInstructionDefs
maxStackElements
maxSizeOfInstructions
maxComponentElements
maxComponentDepth
The method of adjustment and the process of each parameter are in the maxp table: the numerical value that reads each parameter shown in the table 2 in the maxp of first character library and second character library table, and for each parameter, its numerical value in the maxp of first character library and second character library table is compared, choose the numerical value of numerical value bigger in the two as this parameter in the maxp table that merges the back character library.
Step 150, the adjustment that realizes based on character library radix/baseline.
If judge the character library radix difference of character library to be combined, can merge back character library radix and be standard to according to character library radix record related parameter adjustment being arranged in the character library to be combined.Parameter according to character library radix record can comprise hmtx table (Horizontal metrics, the horizontal layout table) parameter, the vmtx relevant with the composing of font level in show (vertical metrics, vertical layout table) parameter, the cvt relevant with the vertical composing of font in shows the related parameter that has in (Control Value Table, controlling value table).
The adjustment of hmtx table at first, is described.Usually, the following structure of the general employing of hmtx table:
<hmtx>
<mtx?name=″.notdef″width=″1000″Isb=″0″/>
<mtx?name=″A″width=″499″Isb=″8″/>
<mtx?name=″Alpha″width=″999″Isb=″157″/>
<mtx?name=″B″width=″499″Isb=″15″/>
<mtx?name=″Beta″width=″999″Isb=″209″/>
<mtx?name=″C″width=″499″Isb=″31″/>
<mtx?name=″Chi″width=″999″Isb=″155″/>
<mtx?name=″D″width=″499″Isb=″23″/>
<mtx?name=″E″width=″499″Isb=″27″/>
<mtx?name=″Epsilon″width=″999″Isb=″213″/>
<mtx?name=″Eta″width=″999″Isb=″149″/>
<mtx?name=″Euro″width=″694″Isb=″46″/>
<mtx?name=″F″width=″499″Isb=″23″/>
<mtx?name=″G″width=″499″Isb=″27″/>
<mtx?name=″Gamma″width=″999″Isb=″227″/>
<mtx?name=″H″width=″499″Isb=″19″/>
<mtx?name=″H18533″width=″999″Isb=″134″/>
<mtx?name=″H22073″width=″999″Isb=″99″/>
<mtx?name=″I″width=″499″Isb=″94″/>
<mtx?name=″lota″width=″999″Isb=″341″/>
When adopting the described character library basis standard of step 110, can carry out the transformation of scale identical to the item relevant in the hmtx table of second character library with font with abovementioned steps 110, that is, conversion coefficient adopts the scale-up factor CC/AA when radix is adjusted in the step 110.
It is pointed out that the relevant parameter adjustment in the hmtx of second character library table finished after, the related parameter that has in this hmtx table can be imported to corresponding position in the hmtx table of first character library, can realize the merging of the hmtx table of character library to be combined.Certainly, in actual applications, the merging of hmtx table also can be carried out with the merging of other tables after a while.
Its two, the adjustment of vmtx table.Usually, the structure class of vmtx table is to show in hmtx, and wherein relevant with the character library radix parameter regulation means and process are also similar, the scale-up factor that is adopted when just it is adjusted is fixed according to the resize ratio of ordinate shown in Figure 2, and/or fixed according to the resize ratio of aforementioned character library baseline.
Its three, the adjustment of cvt table.As previously mentioned, the parameter in the cvt table is similar with the parameter in the hmtx table, is the parameter of using according to the overall steering order of character library radix record, thereby its adjustment mode and merging mode also be similar to the adjustment mode of aforementioned hmtx table, does not repeat them here.
Show the following structure of the general employing of cvt table below:
<cvt>
<cv?index=″0″value=″0″/>
<cv?index=″1″value=″0″/>
<cv?index=″2″value=″641″/>
<cv?index=″3″value=″10″/>
<cv?index=″4″value=″641″/>
<cv?index=″5″value=″6″/>
<cv?index=″6″value=″445″/>
<cv?index=″7″value=″6″/>
<cv?index=″8″value=″0″/>
<cv?index=″9″value=″-10″/>
<cv?index=″10″value=″0″/>
<cv?index=″11″value=″-6″/>
<cv?index=″12″value=″0″/>
<cv?index=″13″value=″-6″/>
<cv?index=″14″value=″-166″/>
<cv?index=″15″value=″0″/>
Step 160 merges the content in the file header in the character library to be combined and each table and forms new character library after the merging.The table of required merging not only comprises and being included in the character library to be combined but each table that abovementioned steps does not relate in this step, and comprises the table that has carried out the modification/adjustment of related content in aforementioned each set-up procedure but also merged.In other words, each table in the character library to be combined can merge after it is adjusted at once, also can together merge with other multiclass tables subsequently, for example merges the multiclass table is corresponding one by one in step 160.
It is to be noted, the execution sequence requirement that each step before the step 160 is not strict, that is to say, in actual applications, as step 110 to 150 described each set-up procedures is not necessarily to carry out according to aforesaid sequencing, as long as can finish above-mentioned relevant set-up procedure before the combining step of step 160.
Also it is to be noted, although the example of merging into two character libraries in the previous embodiment has been described in detail character library merging method provided by the invention, yet in actual applications, the present invention is not limited thereto, but also go for the merging of two above character libraries, as long as merge according to preceding method according to actual needs.For example, if character library to be combined is three, and sequence number is respectively first character library, second character library and the 3rd character library, function numbering in the fpgm table of first character library is remained unchanged, and each function in the fpgm table of second character library is numbered the numerical value that adds the parameter m axFunctionDefs in first character library respectively, and each function numbering in the fpgm of the 3rd character library table added the numerical value sum of numerical value and the parameter m axFunctionDefs in second character library of the parameter m axFunctionDefs in first character library respectively, can avoid the function in the fpgm table of three character libraries to be combined to number collision problem like this.As for the adjustment mode of other each tables, similar with previous embodiment, do not repeat them here.
In addition, the present invention also provides a kind of character library combination system, is used at least two character libraries are merged and the new character library in formation merging back.This system can comprise that the maxp table is provided with unit and merging and processing unit.
Wherein, maxp table is provided with the unit, in order to the numerical value of each relevant parameter in the maxp table that merges the back character library to be set based on the numerical value of each parameter in the maxp table of character library to be combined.
Particularly, this maxp table is provided with the unit and can comprises maxp table intrinsic parameter read module, accumulation process module and comparison process module.Wherein, maxp table intrinsic parameter read module, parameter during its maxp that reads each character library to be combined shows, and the numerical value of the parameter m axFunctionDefs that read transferred to the accumulation process module, will transfer to the comparison process module except that the numerical value of all the other each parameters the parameter m axFunctionDefs.The accumulation process module, its numerical value with the maxFunctionDefs in the maxp table of each character library to be combined adds up, and the numerical value of sum as this parameter m axFunctionDefs in the maxp table that merges the back character library that will add up.The comparison process module, it carries out such operation: promptly, for each parameter, the numerical value in the maxp table of this parameter in each character library to be combined is compared, get the numerical value of wherein maximum numerical value as this parameter in the maxp table that merges the back character library.
Merge and processing unit, be used under the situation of the character library cardinal sum character library baseline unanimity that adopts in character library to be combined, the file header in the character library to be combined and other each table are merged one by one and form new character library after the merging.When merging, the related content in file header and each table is carried out corresponding change according to actual conditions.
As previously mentioned, in actual applications, character library radix and/or character library baseline that character library to be combined adopted are often inequality, and for this reason, character library combination system provided by the invention also comprises character library radix adjustment unit and character library baseline adjustment unit.Wherein, this character library radix adjustment unit is a standard with predetermined merging back character library radix usually, and the radix of character library to be combined is adjusted; This character library baseline adjustment unit is a standard with predetermined merging back character library baseline usually, and the baseline of character library to be combined is adjusted.
And character library combination system provided by the invention can also comprise font composing parameter adjustment unit and cvt table adjustment unit, and these two unit all are based on character library radix/baseline and correlation table is adjusted.
Wherein, font composing parameter adjustment unit is used for having adopted under the situation of different character library radixes and/or character library baseline in character library to be combined, with predetermined merging back character library radix is standard, and the parameter relevant with the composing of font level in the hmtx table of character library to be combined adjusted; And/or be standard with predetermined merging back character library radix and/or baseline, to adjusting in the vmtx table of character library to be combined with the font relevant parameter of vertically setting type.
Cvt shows adjustment unit, and it is a standard with predetermined merging back character library radix under the character library radix that character library to be combined adopted situation inequality, and the correlation parameter in the cvt table of character library to be combined is adjusted.
In addition, character library combination system provided by the invention can also comprise function numbering adjustment unit, is used for existing under the situation of conflict in the function numbering of character library to be combined, and the related function numbering in fpgm table, prep table and/or the glyf table is adjusted.Wherein, the concrete control method of these three tables and process are similar to the front in conjunction with the explanation of doing with Fig. 1 and method shown in Figure 5, do not repeat them here.
Be understandable that, core of the present invention is based on existing final word-base data or instruction and directly finishes character library and merge, the above embodiment of this paper only is the illustrative embodiments that adopts for principle of the present invention is described, yet the present invention is not limited thereto.For those skilled in the art, without departing from the spirit and substance in the present invention, can make various modification and improvement, these modification and improvement also are considered as protection scope of the present invention.

Claims (16)

1. a character library merging method is used at least two character libraries being merged and forming the new character library in merging back, it is characterized in that this method comprises the steps:
10) numerical value of each relevant parameter in the maxp table that merges the back character library is set based on the numerical value of each parameter in the maxp of the character library to be combined table;
20) file header in the character library to be combined and each table is merged one by one and form new character library after the merging.
2. character library merging method according to claim 1 is characterized in that, in described step 10), carries out following operation:
Read the numerical value of the parameter m axFunctionDefs in the maxp table of each character library to be combined, and with the numerical value of these numerical value sums as this parameter m axFunctionDefs in the maxp table that merges the back character library;
Read the numerical value of all the other each parameters except that parameter m axFunctionDefs in the maxp table of character library to be combined, and for each parameter, numerical value in its maxp table in each character library to be combined is compared, get the numerical value of wherein maximum numerical value as this parameter in the maxp table that merges the back character library.
3. character library merging method according to claim 1, it is characterized in that, in described step 20) also comprise character library radix set-up procedure before: promptly, under the character library radix that character library to be combined adopted situation inequality, be that standard is adjusted the radix of character library to be combined with predetermined merging back character library radix.
4. character library merging method according to claim 1, it is characterized in that, in described step 20) also comprise character library baseline set-up procedure before: promptly, under the character library baseline that character library to be combined adopted situation inequality, be that standard is adjusted the baseline of character library to be combined with predetermined merging back character library baseline.
5. character library merging method according to claim 1, it is characterized in that, in described step 20) also comprise function numbering set-up procedure before: promptly, function numbering in character library to be combined exists under the situation of conflict, and the related function numbering in fpgm table, prep table and/or the glyf table is adjusted.
6. character library merging method according to claim 5, it is characterized in that, realize the adjustment of related function numbering in the fpgm table like this: promptly, read the numerical value of the parameter m axFunctionDefs in the maxp table of each character library to be combined, keep the function numbering in the fpgm table of first character library constant, each function in the fpgm table of other character libraries to be combined is numbered the numerical value sum that adds the parameter m axFunctionDefs in this character library sequence number each character library before respectively, to eliminate function numbering collision problem.
7. character library merging method according to claim 5, it is characterized in that, realize the adjustment of related function numbering in the prep table like this: promptly, for the called function numbering in the prep table of each character library to be combined, adjust according to the function numbering regulation rule that fpgm table in the same character library is adopted, to eliminate function numbering collision problem.
8. character library merging method according to claim 5, it is characterized in that, realize the adjustment of related function numbering in the glyf table like this: promptly, for the called function numbering in the glyf table of each character library to be combined, adjust according to the function numbering regulation rule that fpgm table in the same character library or prep table are adopted, to eliminate function numbering collision problem.
9. character library merging method according to claim 1, it is characterized in that, in described step 20) also comprise the set-up procedure of font composing parameter before: promptly, adopted in character library to be combined under the situation of different character library radixes and/or character library baseline, with predetermined merging back character library radix is standard, and the parameter relevant with the composing of font level in the hmtx table of character library to be combined adjusted; And/or be standard with predetermined merging back character library radix and/or baseline, to adjusting in the vmtx table of character library to be combined with the font relevant parameter of vertically setting type.
10. character library merging method according to claim 1, it is characterized in that, in described step 20) also comprise such step before: promptly, under the character library radix that character library to be combined adopted situation inequality, with predetermined merging back character library radix is standard, and the correlation parameter in the cvt table of character library to be combined is adjusted.
11. a character library combination system is used at least two character libraries being merged and forming the new character library in merging back, it is characterized in that, comprises following unit:
Maxp table is provided with the unit, in order to the numerical value of each relevant parameter in the maxp table that merges the back character library to be set based on the numerical value of each parameter in the maxp table of character library to be combined;
Merge and processing unit, be used for the file header of character library to be combined and each table merged one by one and form new character library after the merging.
12. character library combination system according to claim 11 is characterized in that, described maxp table is provided with the unit and specifically comprises maxp table intrinsic parameter read module, accumulation process module and comparison process module, wherein
Maxp table intrinsic parameter read module, be used for reading the parameter of the maxp table of each character library to be combined, and the numerical value of the parameter m axFunctionDefs that read transferred to the accumulation process module, will transfer to the comparison process module except that the numerical value of all the other each parameters the parameter m axFunctionDefs;
The accumulation process module is used for the numerical value of the parameter m axFunctionDefs of the maxp of each character library to be combined table is added up, and the numerical value of sum as this parameter m axFunctionDefs in the maxp table that merges the back character library that will add up; And
The comparison process module is in order to carry out such operation: promptly, for each parameter, the numerical value of this parameter in the maxp of each character library to be combined table is compared, get the numerical value of wherein maximum numerical value as this parameter in the maxp table that merges the back character library.
13. character library combination system according to claim 11 is characterized in that, also comprises character library radix adjustment unit and/or character library baseline adjustment unit, wherein
Character library radix adjustment unit is used under the character library radix that adopts in the character library to be combined situation inequality, is that standard is adjusted the radix of character library to be combined with predetermined merging back character library radix;
Character library baseline adjustment unit is used under the character library baseline that adopts in the character library to be combined situation inequality, is that standard is adjusted the baseline of character library to be combined with predetermined merging back character library baseline.
14. character library combination system according to claim 11, it is characterized in that, also comprise function numbering adjustment unit, be used for existing under the situation of conflict, the related function numbering in fpgm table, prep table and/or the glyf table is adjusted in the function numbering of character library to be combined.
15. character library combination system according to claim 11, it is characterized in that, also comprise font composing parameter adjustment unit, be used for having adopted under the situation of different character library radixes and/or character library baseline in character library to be combined, with predetermined merging back character library radix is standard, and the parameter relevant with the composing of font level in the hmtx table of character library to be combined adjusted; And/or be standard with predetermined merging back character library radix and/or baseline, to adjusting in the vmtx table of character library to be combined with the font relevant parameter of vertically setting type.
16. character library combination system according to claim 11, it is characterized in that, also comprise cvt table adjustment unit, be used under the character library radix that adopts in the character library to be combined situation inequality, with predetermined merging back character library radix is standard, and the correlation parameter in the cvt table of character library to be combined is adjusted.
CN 200910090995 2009-08-19 2009-08-19 Word stock combining method and system Expired - Fee Related CN101996192B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910090995 CN101996192B (en) 2009-08-19 2009-08-19 Word stock combining method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910090995 CN101996192B (en) 2009-08-19 2009-08-19 Word stock combining method and system

Publications (2)

Publication Number Publication Date
CN101996192A true CN101996192A (en) 2011-03-30
CN101996192B CN101996192B (en) 2013-03-06

Family

ID=43786359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910090995 Expired - Fee Related CN101996192B (en) 2009-08-19 2009-08-19 Word stock combining method and system

Country Status (1)

Country Link
CN (1) CN101996192B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105512096A (en) * 2015-11-30 2016-04-20 北京大学 Optimization method and device based on file embedded font
CN106874587A (en) * 2017-02-08 2017-06-20 上海华虹宏力半导体制造有限公司 The mobilism tag system and implementation method merged for IP parameterized units
CN108280515A (en) * 2018-02-12 2018-07-13 华夏芯(北京)通用处理器技术有限公司 A kind of method and apparatus that instruction delay executes and instructs stipulations

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2779484Y (en) * 2005-04-21 2006-05-10 上海集通数码科技有限责任公司 A universal compressed Chinese character library chip

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105512096A (en) * 2015-11-30 2016-04-20 北京大学 Optimization method and device based on file embedded font
CN105512096B (en) * 2015-11-30 2018-07-06 北京大学 A kind of optimization method and device based on font embedded in document
CN106874587A (en) * 2017-02-08 2017-06-20 上海华虹宏力半导体制造有限公司 The mobilism tag system and implementation method merged for IP parameterized units
CN106874587B (en) * 2017-02-08 2019-12-10 上海华虹宏力半导体制造有限公司 Dynamic label system for IP parameterization unit combination and implementation method
CN108280515A (en) * 2018-02-12 2018-07-13 华夏芯(北京)通用处理器技术有限公司 A kind of method and apparatus that instruction delay executes and instructs stipulations

Also Published As

Publication number Publication date
CN101996192B (en) 2013-03-06

Similar Documents

Publication Publication Date Title
US5969717A (en) Display component selecting system and method
CN101082907B (en) Mixed makeup method and system
CN101256490A (en) Expandable skin system and implementing method
JPS6095679A (en) Control structure for document processing system
CN110597842A (en) Service data query method and system
CN102779118A (en) Paper typesetting method and system
CN103064685A (en) Method and device for configuring webpage in modularization mode
CN102722616B (en) Method for drawing exploration point plan based on Excel
CN110543303A (en) Visual business platform
CN111104557A (en) Heterogeneous document processing system and method based on standard document markup language specification
CN101996192B (en) Word stock combining method and system
CN108256716B (en) Method and apparatus for configuring/executing processes and/or atomic processes based on tables
US9715356B2 (en) Method, apparatus and system for determining a merged intermediate representation of a page
CN101354723B (en) Method and apparatus for implementing combined field
CN112416331A (en) Page adaptation method and device, electronic equipment and computer readable storage medium
CN102407683B (en) Stepless zooming printing control method and device of printer
KR100807061B1 (en) Automatic design method with MS Excel
JP2008299531A (en) Technique for determining processing order of processes
CN101996309B (en) Method and relevant device for identifying and transforming stroke contour
CN101706722A (en) Method and system for generating report
CN117094296A (en) VB language-based form splitting method, intelligent terminal and storage medium
US20140136966A1 (en) Method and System for Generating Instructions According to Change of Font Outline
US8291313B1 (en) Generation of a container hierarchy from a document design
CN103389893A (en) Read-write method and device for configuration register
US11409523B2 (en) Graphics processing unit

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130306

Termination date: 20190819