CN102768655B - JAVA-based display method of Mongolian - Google Patents

JAVA-based display method of Mongolian Download PDF

Info

Publication number
CN102768655B
CN102768655B CN201210091390.9A CN201210091390A CN102768655B CN 102768655 B CN102768655 B CN 102768655B CN 201210091390 A CN201210091390 A CN 201210091390A CN 102768655 B CN102768655 B CN 102768655B
Authority
CN
China
Prior art keywords
font
character
mongolian
word
java
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.)
Expired - Fee Related
Application number
CN201210091390.9A
Other languages
Chinese (zh)
Other versions
CN102768655A (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.)
Inner Mongolia University
Original Assignee
Inner Mongolia University
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 Inner Mongolia University filed Critical Inner Mongolia University
Priority to CN201210091390.9A priority Critical patent/CN102768655B/en
Publication of CN102768655A publication Critical patent/CN102768655A/en
Application granted granted Critical
Publication of CN102768655B publication Critical patent/CN102768655B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Based on the Mongolian display packing of JAVA
Technical field
The present invention relates to a kind of Mongolian display packing, particularly relate 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 existed in Mongolian, make Mongolian by universally acknowledged be text the most complicated in information processing.China just starts the research work of Mongolian information processing aspect from the end of the seventies in last century, and the world that Mongolian character code is at that time ununified or national standard, generally all use developer's custom coding.Along with the formulation of international standard ISO/IEC10646 and standard GB/T 13000, Mongolian character has had unified standard code.In information processing, how to apply the Mongolian world or national standard coding, more and more come into one's own.In the existing world or national standard, Mongolian letter is determined according to pronunciation.But writing of a Mongolian word has very large difference with other alphabetic writing, a Mongolian word is when writing, and the Mongolian character defined in the international or national standard of Bu Shian manifests, but is manifested by the distortion of these letters that character manifests.Usually the Mongolian character defined in the world or national standard is called " nominal character ", the deformed characters of " nominal character " for manifesting is called " distortion manifests character ".Great majority " nominal character " have " distortion manifests character " of more than 2, can reach at most 9 " distortion manifests character ".The shape of each " nominal character " is different, but the shape of " distortion manifests character " corresponding to different " nominal character " has identical the manifesting of font.As letter distortion have letter distortion have if do not consider identical font, only calculate according to " distortion manifests character " that each " nominal character " is corresponding, the quantity of " distortion manifests character " that 156 " nominal character " is corresponding can reach nearly 1000 altogether.According to Mongolian word-building grammer, the shape forming the letter of a Mongolian word is different in diverse location (in prefix, word, word end) its shape of word; The character be adjacent is different, and its shape also may be different.When also some character is adjacent in word, a kind of Combined changeable can be produced, become combinde rqdical character.As after connect can be combined into (in word) or (word end).Therefore, when using Mongolian standard code, should must use when clearly " nominal character " occurs in word which " distortion manifests character ", while what is more important to have an engine correctly can explaining these complex transformations.
In prior art, use one and be called that the function library of Pango is to realize the display of complex text in linux system, this technology uses the method for resolving OpenType character library to realize above-mentioned functions.This technology only can be applicable to Linux platform, and the particularly important is: this technology does not support the display of Mongolian.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides a kind of Mongolian display packing based on JAVA, mainly by a kind of can resolve Mongolian Opentype character library nominal character and distortion manifest symbol maps rule processing engine realize.Utilize this engine supporting the mobile phone that JAVA program is run and other mobile device to use the Mongolian meeting the world or national standard coding, and then realize the direct exchange of mobile device and intercomputer Mongolian information.
Its technical scheme is as follows:
Based on a Mongolian display packing of JAVA, comprise the following steps:
Set up Mongolian font engine, described font engine is a relatively independent function, and Function Format is: Font.drawText (text, compatiblePath), parametric t ext is the GB character string of input, and function exports zigzag pattern to compatiblePath;
Interface is provided to visit the font engine of Mongolian OpenType character library:
Described Mongolian font engine is incorporated in application program, and the Path interface realized for drawing, after calling Font.drawText (text, compatiblePath) function, automatic generation meets the script figure of current application environment, is plotted to the position of needs.In addition, the method feasible arbitrarily under can using this environment of caller rotates the figure obtained, convergent-divergent and arbitrary font distortion, due to the characteristic of figure, these conversion can not bring any impact to font quality, and this fully can meet any typesetting demand of user.
Character attibute marks:
The mapping that character is numbered to font: comprise the tables of data that is called cmap (symbol maps) in font file, the matching relationship between the default character comprising each character and its correspondence;
Font is replaced: the first step searches that or those font that will replace, and second step performs replacement;
Glyphs: define a drawing interface by abstract for Plot Work be some functions to be achieved, fill font time use " even odd rules " fill, namely complete glyphs work.
The method a bit whether be filled in determination font of the present invention is: to investigate a little for starting point, draw a ray (direction is any), initialization counter is 0, when ray passes through profile (regardless of direction), counter adds 1, finally fills this point when counter is odd number.
Modern face uses profile to describe, and only need draw out profile, then be Contour filling color when drawing font.Because in different applied environments, the method for graphic plotting is not quite similar, so define the interface of a graphing here, this interface define only draws the basic drawing practice such as straight line, curve.Realize this interface generally only directly need call this environment under corresponding method.Use " even odd rules " to fill when filling font, namely complete glyphs work.Wherein determine that the method a bit whether be filled in font is as described below: to investigate a little for starting point, draw a ray (direction is any), initialization counter is 0, when ray passes through profile (regardless of direction), counter adds 1, finally fills this point when counter is odd number.
Beneficial effect of the present invention:
The present invention can be applicable to mobile phone, the mobile device of supporting that java applet runs, even in network environment, or national standard code storage international by Mongolian, display, output mongolian character can be realized, realize the direct exchange of the Mongolian information between mobile device and computing machine, between mobile device such as mobile phone.The research and development of Mongolian information processing can be conducive to, be conducive to promoting the interchange between various nationalities.Java technology all supported by current most of mobile phone, and therefore the present invention is widely used environment and potential quality.
Accompanying drawing explanation
Fig. 1 is font engine processing flow chart of the present invention;
Fig. 2 is Substitution Rules building-block of logic of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, method of the present invention is described in more detail.
Due to ubiquitous in Mongolian cliction " a sound multiform, a shape multitone " phenomenon, make to want complicated many to the process of Mongolian other word relative.The font of Mongolian character can change along with the difference of its position in word, and most change has certain regularity, and some Changing Pattern exists ambiguity, can be distinguished by special instruction character.The understanding of usual people to character library only comprises the data of character shape and the coding of correspondence thereof in character library, and program sends character code into character library, and character library returns corresponding font data.Font data and the nominal character coding of character is not only deposited in Mongolian Opentype character library, also comprise Mongolian nominal character simultaneously and be out of shape with it description manifesting intercharacter mapping relations, wherein only have nominal character just to have coding, distortion manifests character less than coding.Which distortion each nominal character use at the diverse location of word, connect certain character after a character or connect which distortion which character (string) uses afterwards, a character forces which shape of use etc. to need to provide complete information description in word.
Fig. 1 is treatment scheme schematic diagram of the present invention.The present invention is the font engine that interface can be provided to visit Mongolian OpenType character library of writing by JAVA language.It externally shows as the Mongolian letter coded strings that input meets national standard, exports corresponding Mongolian distortion and manifests character graphics.This font engine is a relatively independent function, and Function Format is: Font.drawText (text, compatiblePath), text are the GB character string of input, and function exports zigzag pattern to compatiblePath.This function can be applied in the environment of all support Java.First read in the character string that will draw, analyze the character string of input, determine wherein each characters' property, and it is marked; Again character code is mapped to font sequence number; Then according to the character attibute that font Substitution Rules and the first step mark, each font of composition character string is become correct form; Finally the glyphs needed is exported.So just complete whole processing procedure.
Technic relization scheme is as follows:
Character attibute marks: in Mongolian, the position that letter can appear in word along with it is different and have different fonts, and adding of instruction character makes it more complicated, when by character conversion being the font numbering of acquiescence, some information wherein may be lost, therefore at the attribute being converted to reference character before font is numbered, these attributes comprise:
SUBST_NODO=1; // non-Mongolian
SUBST_MEDI=1 < < 1; In // word
SUBST_INIT=1 < < 2; // prefix
SUBST_FINA=1 < < 3; // suffix
SUBST_ISOL=1 < < 4; // separate component
The size of property value listed above is significant.In the fit replacement process of font, the position that character occurs in word may change, and therefore needs the method for the final attribute of font after judging zoarium.Regulation: the maximum attribute value that (except special case except) participates in fit all fonts is the property value of fit font afterwards.
Characters' property is also the attribute of corresponding font.
Such as: word string gB is " 0x1836 0x1821 0x182c 0x1821 ", 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: font numbering is the input data that font is replaced, and is also the unique parameters extracting character contour data from font file, if think, process further must complete the conversion of this step.
In font file, comprise the tables of data that is called cmap (symbol maps), it comprises the matching relationship between the default character of each character and its correspondence.Logically it is a data dictionary.The logical organization of cmap is:
Only need according to upper table one_to_one corresponding to the mapping that font is numbered so character will be completed.
As above performing mapping result in example may be as shown in table 2:
GB 0x1836 0x1821 0x182c 0x1821
Attribute SUBST_INIT SUBST_MEDI SUBST_MEDI SUBST_FINA
Font is numbered 314 185 255 185
Table 2
Font is replaced: the complicated part showing traditional Mongolian different manifests form with regard to being that character has in different positions, and some character combination has again different forms together, and this uses font to replace and realizes.
It is exactly by other the font replacement with certain of certain or some fonts that so-called font is replaced.Whole replacement process can be divided into two steps, and the first step searches that or those font that will replace, and second step performs replacement.
Font is replaced and is carried out regular drive.The logical organization of font Substitution Rules is as follows.
Wherein executive condition is one of following:
SUBST_MEDI=1 < < 1; // font is in word
SUBST_INIT=1 < < 2; // font is at prefix
SUBST_FINA=1 < < 3; // font is at suffix
SUBST_ISOL=1 < < 4; // font is absolute version
SUBST_ALL=SUBST_MEDI|SUBST_INIT
| SUBST_FINA|SUBST_ISOL; // no matter which kind of form font is
Above 4 is exactly character attibute, and last is their combination.
So-called executive condition is set up and is referred to that the attribute of the font that will replace must be consistent with executive condition, if even if the satisfied goal description of replacing that do not conform to also is not replaced.
The logical organization of replacing goal description is as follows:
Replace goal description can be expressed as: if current sequence is xxx, before be xxx, after and then xxx, so just current sequence is replaced.
When being omitted with during font below before being indifferent to, can simplify again when the target grapheme sequence of replacing is a font, form 3 kinds of mutation thus.Replacement with good conditionsi, is called Type6; There is no condition but represent what many-one was replaced, being called Type4; There is no condition and replace one to one, being called Type1.
All Substitution Rules are organized into GSUB tables of data by OpenType font.In order to the neat of data and compression, OpenType uses the hierarchical structure shown in Fig. 2 to preserve Substitution Rules.
Wherein " characteristic " represents executive condition.
" look-up table " comprises Substitution Rules data, uses the description form of Type1, Type4 or Type6 according to content requirements.
" sub-look-up table " is the position of the actual preservation of Substitution Rules data, and it has different physical storage formats.
The characteristic used in traditional Mongolian is as shown in table 3, and the executive condition of their correspondences is also listed in table.
Table 3
When font is replaced, the order of rule application is also the same with upper table, and this order can not entanglement.
Font replacement process is as follows:
As following rule may be related in upper example, as shown in table 4:
Table 4
Then replacing result is: 315 190 777
Glyphs: use cutline font TrueType form, 1 to 2 rank Beziers are used to describe profile, this step is relevant to applied environment, in different application environment, the method for graphing is not quite similar, invention defines a drawing interface (Path) by abstract for Plot Work for some functions to be achieved, the present invention can be used in different applied environments.
Wherein determine that the method a bit whether be filled in font is as described below:
To investigate a little for starting point, draw a ray (direction is any), initialization counter is 0, and when ray passes through profile (regardless of direction), counter adds 1, finally fills this point when counter is odd number.
Utilize technical scheme of the present invention, the Mongolian application software on mobile device can be developed.As long as use the Mongolian meeting national standard coding on the mobile apparatus, just must use Mongolian Opentype character library, so just need to use the present invention to come to read in character library, show (output) Mongolian.As mobile phone developed Mongolian electronic dictionary software, now the Ying Menghan entry file preserved by national standard coding and Mongolian Opentype font file are deposited in the storer of mobile phone, and then all need when writing Mongol inputting method and read Mongolian and display shadowiness ancient Chinese prose from character library to use the present invention.Other application, as receive and send Mongolian SMS, use mobile phone to receive and send Mongolian Email, mobile phone browses Mongolian Characters in Web Pages, mobile phone uses Mongolian and computer network website carry out word mutual, utilize the present invention, can create with mobile phone, to edit the Mongolian file that can be used on other mobile device, computing machine and computer network etc. similar with the application process of electronic dictionary; In addition, the present invention is also one of feasible program of cross-platform display shadowiness ancient Chinese prose on webpage.

Claims (1)

1., based on a Mongolian display packing of JAVA, it is characterized in that, comprise the following steps:
Set up Mongolian process font engine, described font engine is a relatively independent function, and Function Format is: Font.drawText (text, compatiblePath), text is the GB character string of input, and function exports zigzag pattern to compatiblePath;
Interface is provided to visit the font engine of Mongolian OpenType character library: to be incorporated in application program by described Mongolian process font engine, and the Path interface realized for drawing, call Font.drawText (text, compatiblePath), after function, the script figure meeting current application environment is automatically generated;
Character attibute marks: the attribute of reference character before being converted to font numbering, and these attributes comprise:
The end that the centre that character is not Mongolian character, character appears at word, character appear at the beginning of word, character appears at word, character independently become word, and characters' property is also the attribute of corresponding font;
The mapping that character is numbered to font: comprise the tables of data that is called symbol maps in font file, the matching relationship between the default character comprising each character and its correspondence in tables of data;
Font is replaced: the first step searches that or those font that will replace, and second step performs replacement;
Glyphs: define a drawing interface by abstract for Plot Work be some functions to be achieved, fill font time use " even odd rules " fill, namely complete glyphs work;
In glyphs, determine that the method a bit whether be filled in font is: to investigate a little for starting point, draw a ray, initialization counter is 0, and when ray passes through profile, counter adds 1, finally fills this point when counter is odd number.
CN201210091390.9A 2012-03-31 2012-03-31 JAVA-based display method of Mongolian Expired - Fee Related CN102768655B (en)

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 CN102768655A (en) 2012-11-07
CN102768655B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (2)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
Proofreader of Mongolian Vocabulary Based on Language Model of Syllabic Statistics;Ochir 等;《2009 International Conference on Asian Language Processing,》;20091209;第217-219页 *
蒙古文OpenType字体解析;巩政 等;《第十一届全国民族语言文字信息学术研讨会论文集》;20080801;第224-228页 *
蒙古文显示在OpenOffice.org办公套件中的实现;孟凡强 等;《中文信息学报》;20070509;第21卷(第2期);第117-121页 *

Also Published As

Publication number Publication date
CN102768655A (en) 2012-11-07

Similar Documents

Publication Publication Date Title
CN102750337B (en) Producing method and device for font
CN104461484B (en) The implementation method and device of front-end template
CN102662926B (en) The storage and inquire method of character library
US7492366B2 (en) Method and system of character placement in opentype fonts
US20160078656A1 (en) Remote Font Management
CN105630902A (en) Method for rendering and incrementally updating webpages
CN102768655B (en) JAVA-based display method of Mongolian
KR20150128921A (en) Detection and reconstruction of east asian layout features in a fixed format document
CN109933751B (en) Image-text drawing method and device, computer-readable storage medium and computer equipment
CN107562480B (en) Method and system for realizing multilingual of POS machine
CN107092585A (en) Mongolian display method and system based on scalable vector graphics
CN103365894B (en) A kind of font format conversion method and device
Yang et al. Glyphcontrol: Glyph conditional control for visual text generation
CN108961361B (en) Method and system for generating special effect text image and computer equipment
CN105005472A (en) Method and device for displaying Uygur characters on WEB
CN106873971B (en) Multi-language display method and system for flash application
CN116384356A (en) Method, device, equipment and medium for creating form row of OFD file
CN113436298B (en) Method and device for automatically generating Chinese character stroke order animation and related components thereof
US11030388B2 (en) Live text glyph modifications
Li et al. A human-computer interactive dynamic description method for Jiaguwen Characters
CN101957837B (en) Method for accessing stroke vector font
CN111178002A (en) Character display method, system and device
Mudur et al. An architecture for the shaping of Indic texts
CN112270201A (en) Ancient book Chinese character original complex simple conversion method and device
CN101739389A (en) Method and system for realizing Tibetan expansion sets conveniently

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
DD01 Delivery of document by public notice

Addressee: Inner Mongolia University

Document name: Notification of Termination of Patent Right

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: 20150422

Termination date: 20190331