CN102768655A - JAVA-based display method of Mongolian - Google Patents
JAVA-based display method of Mongolian Download PDFInfo
- Publication number
- CN102768655A CN102768655A CN2012100913909A CN201210091390A CN102768655A CN 102768655 A CN102768655 A CN 102768655A CN 2012100913909 A CN2012100913909 A CN 2012100913909A CN 201210091390 A CN201210091390 A CN 201210091390A CN 102768655 A CN102768655 A CN 102768655A
- Authority
- CN
- China
- Prior art keywords
- font
- character
- mongolian
- java
- function
- 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
Links
Images
Landscapes
- Controls And Circuits For Display Device (AREA)
Abstract
The invention discloses a JAVA-based display method of Mongolian. A font engine capable of providing an interface to access a Mongolian OpenType font library is compiled with JAVA language. Input alphabetic coding strings accord to national standard is output as corresponding Mongolian display character graphics. The font engine is a relative independent function in a format of Font. drawText (text, compatiblePath), wherein text is input Unicode character strings and font graphics are output to compatiblePath through the function. The function is applicable to all environments support JAVA. By the JAVA-based display method which is widely applicable, researches and developments of Mongolian information processing are facilitated.
Description
Technical field
The present invention relates to a kind of Mongolian display packing, relate in particular to a kind of Mongolian display packing based on JAVA.
Background technology
Mongolian is a kind of alphabetic writing." a sound multiform, a shape multitone " phenomenon of the uniqueness that exists in the Mongolian makes Mongolian be text the most complicated in the information processing by universally acknowledged.China since the end of the seventies in last century just the research work of Mongolian information processing aspect, at that time Mongolian character coding does not have the unified world or national standard, generally all uses developer's custom coding.Along with the formulation of international standard ISO/IEC10646 and standard GB 13000, the Mongolian character has had unified standard code.How in information processing, to use the Mongolian world or national standard coding, more and more come into one's own.In the existing world or national standard, the Mongolian letter is confirmed according to pronunciation.But write and other alphabetic writing of Mongolian word have very big difference, and the Mongolian word is not to manifest by the Mongolian character that defines in the world or the national standard when writing, and character manifests but manifested by these alphabetical distortion.Usually call " nominal character " to the Mongolian character that in the world or national standard, defines, call " distortion manifests character " to the deformed characters of " nominal character " that be used to manifest.Great majority " nominal character " all have " distortion manifests character " more than 2, can reach 9 " distortion manifests character " at most.The shape of each " nominal character " is different, but the shape of different " nominal character " pairing " distortion manifest character " has identical the manifesting of font.The distortion that distortion has
alphabetical
like letter
has
if do not consider identical font; Only calculate according to each " nominal character " corresponding " distortion manifests character ", the quantity of 156 " nominal character " is corresponding altogether " distortion manifests character " can reach nearly 1000.According to Mongolian word-building grammer, the shape of letter that constitutes the Mongolian word is different in its shape of the diverse location of speech (in prefix, the speech, speech end); The character that is adjacent is different, and its shape also maybe be different.Also some character when adjacent, can produce a kind of combined type distortion in word, becomes combinde rqdical character.If
followed by
will be combined into
(word) or
(end of the word).Therefore, when using the Mongolian standard code, use when clearly " nominal character " occurs in word which " distortion manifests character ", the while what is more important to have one can these complex transformations of correct interpretation engine.
In the prior art, in linux system, use a function library that is called Pango to realize the demonstration of complex text, this technology uses the method for resolving the OpenType character library to realize above-mentioned functions.This technology only can be applicable to the Linux platform, and the particularly important is: this technology is not supported the demonstration of Mongolian.
Summary of the invention
In order to solve the problems of the technologies described above, the present invention provides a kind of Mongolian display packing based on JAVA, mainly is to realize with the processing engine that distortion manifests the character mapping ruler through a kind of Mongolian Opentype character library nominal character of can resolving.Utilize this engine can on the mobile phone of supporting the JAVA program run and other mobile device, use the Mongolian that meets the world or national standard coding, and then realize the direct exchange of mobile device and intercomputer Mongolian information.
Its technical scheme is following:
A kind of Mongolian display packing based on JAVA may further comprise the steps:
Set up Mongolian font engine; Said font engine is a relatively independent function, and the function form is: and Font.drawText (text, compatiblePath); Parametric t ext is the GB character string of input, and function output font figure is to compatiblePath;
Provide interface to visit the font engine of Mongolian OpenType character library:
Said Mongolian font engine is incorporated in the application program; And realize the Path interface be used to draw, (text is compatiblePath) behind the function to call Font.drawText; Automatically generate the script figure that meets the current application environment, it is plotted to the position that needs gets final product.In addition; Caller can use under this environment feasible arbitrarily method to the figure that obtains be rotated, convergent-divergent, and font distortion arbitrarily; Because the characteristic of figure, these conversion can not bring any influence to the font quality, and this can fully satisfy any composing demand of user.
The character attibute mark:
The mapping that character is numbered to font: in font file, comprise a tables of data that is called cmap (character mapping), comprise the matching relationship between each character and its corresponding default character;
Font replacement: the first step is to search that or those font that will replace, and second step was to carry out replacement;
Font is drawn: define a drawing interface with drawing work abstract be some functions to be achieved, the font drawing is promptly accomplished in use " even odd rules " filling when filling font.
The present invention confirms that the method that a bit whether is filled in the font is: to investigate point is starting point; Draw a ray (direction is any), the count initialized device is 0, when ray passes through profile (regardless of direction); Counter adds 1, finally fills this point during for odd number when counter.
Modern face uses profile to describe, and only need draw out profile when drawing font, is the profile Fill Color again.Because the method for graphic plotting is not quite similar in different application environments, so define the interface of a graphing here, this interface has only defined basic drawing practice such as drafting straight line, curve.Realize that the general corresponding method that only need directly call under this environment of this interface gets final product.Use " even odd rules " to fill when filling font, promptly accomplish the font drawing.The method that a bit whether is filled in the font of wherein confirming is described below: to investigate point is starting point; Draw a ray (direction is any), the count initialized device is 0, when ray passes through profile (regardless of direction); Counter adds 1, finally fills this point during for odd number when counter.
Beneficial effect of the present invention:
The present invention can be applicable to support mobile phone, the mobile device of java applet operation; Even in the network environment; Can realize by the Mongolian world or national standard code storage, demonstration, output mongolian character, realize the direct exchange of Mongolian information between mobile device such as mobile phone and the computing machine, between the mobile device.Can help the research and development of Mongolian information processing, help promoting the interchange between the various nationalities.Present most of mobile phone is all supported Java technology, so the present invention be widely used environment and potential quality.
Description of drawings
Fig. 1 is a font engine processing flow chart of the present invention;
Fig. 2 is a Substitution Rules building-block of logic of the present invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment method of the present invention is done explanation in further detail.
Because ubiquitous " a sound multiform, a shape multitone " phenomenon in the Mongolian cliction makes the many of complicacy is wanted in relative other literal of the processing of Mongolian.The font of Mongolian character can change along with the difference of its position in speech, and most the variation have certain rules property, some Changing Pattern to have ambiguity, can distinguish through special-purpose instruction character.Usually people are data and the corresponding codes thereof that only comprises character shape in the character library to the understanding of character library, and program is sent into character library to character code, and character library is returned corresponding font data.Not only deposit the font data and the nominal character coding of character in the Mongolian Opentype character library; Comprise also that simultaneously Mongolian nominal character and its distortion manifest the description of intercharacter mapping relations; Wherein have only nominal character that coding is just arranged, distortion manifests character less than coding.Each nominal character connects certain character or connects which character (string) back and uses which distortion, character in speech, to force which shape of use etc. all need provide complete information description after the diverse location of speech uses which distortion, character.
Fig. 1 is a treatment scheme synoptic diagram of the present invention.The present invention is a font engine that can provide interface to visit Mongolian OpenType character library with the JAVA language.It externally shows as the Mongolian letter coded strings of input National standard, and the corresponding Mongolian distortion of output manifests character graphics.This font engine is a relatively independent function, and the function form is: and Font.drawText (text, compatiblePath), text is the GB character string of input, function output font figure is to compatiblePath.This function can be applied in all environment of supporting Java.At first read in the character string that to draw, analyze the character string of input, confirm the wherein attribute of each character, and it is marked; Again character code is mapped to the font sequence number; According to the character attibute of font Substitution Rules and first step mark, each font of forming character string is become correct form then; At last output drawn in the font of needs.So just accomplish the entire process process.
Technic relization scheme is following:
Character attibute mark: in Mongolian; Letter can appear at the position difference in the speech and different fonts is arranged along with it; And the adding of instruction character makes it complicated more, and when character conversion was numbered for the font of acquiescence, some information wherein may be lost; Therefore converting the font numbering attribute of reference character before into, these attributes comprise:
SUBST_NODO=1; // non-Mongolian
SUBST_MEDI=1<<1; In // the speech
SUBST_INIT=1<<2; // prefix
SUBST_FINA=1<<3; // suffix
SUBST_ISOL=1<<4; // separate component
The size of the property value of listing above is significant.In the fit replacement process of font, the position that character occurs in speech may change, and therefore needs the fit method of the final attribute of font afterwards of judging.Regulation: the maximum attribute value that (except that special case) participated in fit all fonts is the property value of fit back font.
The attribute of character also is the attribute of corresponding font.
For example: word string
GB is " 0x1836 0x1821 0x182c 0x1821 ", and is then as shown in table 1 according to character position mark attribute:
GB | 0x1836 | 0x1821 | 0x182c | 0x1821 |
Attribute | SUBST_INIT | SUBST_MEDI | SUBST_MEDI | SUBST_FINA |
Table 1
The mapping that character is numbered to font: the font numbering is the input data of font replacement, also is from font file, to extract unique parameter of character contour data, must accomplish this step conversion if think further the processing.
In font file, comprise a tables of data that is called cmap (character mapping), it comprises the matching relationship between each character and its corresponding default character.Logically it is a data dictionary.The logical organization of cmap is:
So accomplishing character only needs get final product according to last table is corresponding one by one to the mapping of font numbering.
As above carrying out mapping result in the example maybe be as shown in table 2:
GB | 0x1836 | 0x1821 | 0x182c | 0x1821 |
Attribute | SUBST_INIT | SUBST_MEDI | SUBST_MEDI | SUBST_FINA |
The font numbering | 314 | 185 | 255 | 185 |
Table 2
The font replacement: the complicated part that shows traditional Mongolian has the different forms that manifests with regard to being character in different positions, some character combination has different forms again together, and this uses font to replace and realizes.
So-called font replacement be exactly with certain or some fonts with certain other font replace.Whole replacement process can be divided into for two steps, and the first step is to search that or those font that will replace, and second step was to carry out replacement.
Regular drive is carried out in the font replacement.The logical organization of font Substitution Rules is as follows.
Wherein executive condition is one of following:
SUBST_MEDI=1<<1; // font is in speech
SUBST_INIT=1<<2; // font is at prefix
SUBST_FINA=1<<3; // font is at suffix
SUBST_ISOL=1<<4; // font is an absolute version
SUBST_ALL=SUBST_MEDI|SUBST_INIT
| SUBST_FINA|SUBST_ISOL; // no matter which kind of form font is
4 of the front is exactly character attibute, and last is their combination.
So-called executive condition is set up and is meant that the attribute of the font that will replace must be consistent with executive condition, does not also replace even satisfy the replacement goal description as if not conforming to.
The logical organization of replacement goal description is as follows:
The replacement goal description can be expressed as: if current sequence is xxx, the front is xxx, and followed xxx so just replaces current sequence.
When being indifferent to the font of front and back, can it be omitted, when the target grapheme sequence of replacement is a font, can simplify again, form 3 kinds of mutation thus.Replacement with good conditionsi is called Type6; Do not have condition but expression many-one replacement, be called Type4; Do not have condition and replace one to one, be called Type1.
The OpenType font is organized into the GSUB tables of data with all Substitution Rules.For the neat and compression of data, OpenType uses hierarchical structure shown in Figure 2 to preserve Substitution Rules.
Wherein " characteristic " represented executive condition.
" look-up table " comprises the Substitution Rules data, uses the description form of Type1, Type4 or Type6 according to the content demand.
" sub-look-up table " is the position of the actual preservation of Substitution Rules data, and it has different physical storage formats.
The characteristic of in traditional Mongolian, using is as shown in table 3, and their corresponding executive conditions are also listed in the table.
Table 3
The order of rule application is also the same with last table during the font replacement, and this order can not entanglement.
The font replacement process is as follows:
As in last example, may relating to following rule, as shown in table 4:
Table 4
Then replacing the result is: 315 190 777
Font is drawn: use cutline font TrueType form; Use 1 to 2 rank Bezier to describe profile; This step is relevant with applied environment; The method of graphing is not quite similar in the different application environment, and it is abstract in some functions to be achieved with drawing work that the present invention has defined a drawing interface (Path), and the present invention can be used in different application environments.
The method that a bit whether is filled in the font of wherein confirming is described below:
To investigate point is starting point, draws a ray (direction is any), and the count initialized device is 0, and when ray passes through profile (regardless of direction), counter adds 1, finally fills this point during for odd number when counter.
Utilize technical scheme of the present invention, can develop the Mongolian application software on the mobile device.As long as on mobile device, use the Mongolian of National standard coding, just must use Mongolian Opentype character library, so just need to use the present invention to come to read in the character library, show (output) Mongolian.Like exploitation Mongolian electronic dictionary software on the mobile phone; Existing deposit Ying Menghan entry file and the Mongolian Opentype font file preserved by the national standard coding in the storer of mobile phone, and then write Mongol inputting method and reach when from character library, reading Mongolian and display shadowiness ancient Chinese prose and all need use the present invention.Other application; As receive and send the Mongolian SMS, use mobile phone to receive and send the Mongolian Email, mobile phone is browsed the Mongolian webpage; On mobile phone, use Mongolian and computer network website carry out literal alternately, utilize the present invention, it is similar with the application process of electronic dictionary to create, edit the Mongolian file that can use on other mobile device, computing machine and computer network etc. with mobile phone; In addition, the present invention is used for one of feasible program of cross-platform display shadowiness ancient Chinese prose on the webpage.
Claims (2)
1. the Mongolian display packing based on JAVA is characterized in that, may further comprise the steps:
Set up Mongolian and handle font engine; Said font engine is a relatively independent function, and the function form is: and Font.drawText (text, compatiblePath); Text is the GB character string of input, and function output font figure is to compatiblePath;
Provide interface to visit the font engine of Mongolian OpenType character library:
Said Mongolian is handled font engine be incorporated in the application program, and realize the Path interface that is used to draw, (text compatiblePath) behind the function, generates the script figure that meets the current application environment automatically to call Font.drawText;
The character attibute mark:
The mapping that character is numbered to font: in font file, comprise a tables of data that is called character mapping (cmap), comprise the matching relationship between each character and its corresponding default character;
Font replacement: the first step is to search that or those font that will replace, and second step was to carry out replacement;
Font is drawn: define a drawing interface with drawing work abstract be some functions to be achieved, the font drawing is promptly accomplished in use " even odd rules " filling when filling font.
2. the Mongolian display packing based on JAVA according to claim 1 is characterized in that, in font is drawn; The method that a bit whether is filled in the font of confirming is: to investigate point is starting point; Draw a ray, the count initialized device is 0, when ray passes through profile; Counter adds 1, finally fills this point during for odd number when counter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210091390.9A CN102768655B (en) | 2012-03-31 | 2012-03-31 | JAVA-based display method of Mongolian |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210091390.9A CN102768655B (en) | 2012-03-31 | 2012-03-31 | JAVA-based display method of Mongolian |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102768655A true CN102768655A (en) | 2012-11-07 |
CN102768655B CN102768655B (en) | 2015-04-22 |
Family
ID=47096059
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210091390.9A Expired - Fee Related CN102768655B (en) | 2012-03-31 | 2012-03-31 | JAVA-based display method of Mongolian |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102768655B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104424184A (en) * | 2013-08-19 | 2015-03-18 | 北大方正集团有限公司 | Method and device for generating font library |
CN106469139A (en) * | 2016-10-14 | 2017-03-01 | 厦门大学 | Unicode traditional mongolian normalization method based on font similarity |
CN110069766A (en) * | 2018-01-23 | 2019-07-30 | 北大方正集团有限公司 | The typesetting processing method and device of formula |
CN111027283A (en) * | 2019-11-13 | 2020-04-17 | 齐德华 | Mongolian digital information processing method, system and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101561800A (en) * | 2009-05-15 | 2009-10-21 | 内蒙古蒙科立软件有限责任公司 | Character pattern generation method of Mongolian |
CN101694603A (en) * | 2009-10-20 | 2010-04-14 | 中央民族大学 | Cross-platform Mongolian display and intelligent input method based on Unicode |
-
2012
- 2012-03-31 CN CN201210091390.9A patent/CN102768655B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101561800A (en) * | 2009-05-15 | 2009-10-21 | 内蒙古蒙科立软件有限责任公司 | Character pattern generation method of Mongolian |
CN101694603A (en) * | 2009-10-20 | 2010-04-14 | 中央民族大学 | Cross-platform Mongolian display and intelligent input method based on Unicode |
Non-Patent Citations (3)
Title |
---|
OCHIR 等: "Proofreader of Mongolian Vocabulary Based on Language Model of Syllabic Statistics", 《2009 INTERNATIONAL CONFERENCE ON ASIAN LANGUAGE PROCESSING,》, 9 December 2009 (2009-12-09), pages 217 - 219 * |
孟凡强 等: "蒙古文显示在OpenOffice.org办公套件中的实现", 《中文信息学报》, vol. 21, no. 2, 9 May 2007 (2007-05-09), pages 117 - 121 * |
巩政 等: "蒙古文OpenType字体解析", 《第十一届全国民族语言文字信息学术研讨会论文集》, 1 August 2008 (2008-08-01), pages 224 - 228 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104424184A (en) * | 2013-08-19 | 2015-03-18 | 北大方正集团有限公司 | Method and device for generating font library |
CN104424184B (en) * | 2013-08-19 | 2018-02-23 | 北大方正集团有限公司 | Generate the method and system of font character library |
CN106469139A (en) * | 2016-10-14 | 2017-03-01 | 厦门大学 | Unicode traditional mongolian normalization method based on font similarity |
CN110069766A (en) * | 2018-01-23 | 2019-07-30 | 北大方正集团有限公司 | The typesetting processing method and device of formula |
CN111027283A (en) * | 2019-11-13 | 2020-04-17 | 齐德华 | Mongolian digital information processing method, system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102768655B (en) | 2015-04-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102197501B1 (en) | Detection and reconstruction of east asian layout features in a fixed format document | |
CN102750337B (en) | Producing method and device for font | |
CN102662926B (en) | The storage and inquire method of character library | |
CN105630902A (en) | Method for rendering and incrementally updating webpages | |
Aliprand | The unicode standard | |
CN104881469A (en) | Data exporting method and device | |
WO2006021863A2 (en) | A system and method for product migration in multiple languages | |
CN106372065B (en) | Multi-language website development method and system | |
CN110383269A (en) | Animation font based on multi-shaft variable font | |
CN101963954A (en) | Method and device for displaying words | |
CN102768655B (en) | JAVA-based display method of Mongolian | |
CN101692254B (en) | Method and device for displaying multi-Unicode language character codes | |
CN107092585A (en) | Mongolian display method and system based on scalable vector graphics | |
US20070262991A1 (en) | Arabic input output method and font model | |
CN109375962A (en) | The implementation method of chinese character mixing output display based on embedded OS | |
CN106873971B (en) | Multi-language display method and system for flash application | |
CN104375814A (en) | Generation method and device of an interface document | |
CN103365894A (en) | Font format conversion method and device | |
TW201407385A (en) | Method of manipulating strings in embeded system | |
CN102479072B (en) | Multi-header report generating method, device and terminal | |
EP1959352A2 (en) | System and method of report representation | |
US11030388B2 (en) | Live text glyph modifications | |
Li et al. | A human-computer interactive dynamic description method for Jiaguwen Characters | |
CN102723067B (en) | A kind of character display method and device | |
CN101957837B (en) | Method for accessing stroke vector font |
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 | ||
DD01 | Delivery of document by public notice |
Addressee: Inner Mongolia University Document name: Notification of Termination of Patent Right |
|
DD01 | Delivery of document by public notice | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20150422 Termination date: 20190331 |
|
CF01 | Termination of patent right due to non-payment of annual fee |