CN105893335B - The method and apparatus of display text - Google Patents
The method and apparatus of display text Download PDFInfo
- Publication number
- CN105893335B CN105893335B CN201610191364.1A CN201610191364A CN105893335B CN 105893335 B CN105893335 B CN 105893335B CN 201610191364 A CN201610191364 A CN 201610191364A CN 105893335 B CN105893335 B CN 105893335B
- Authority
- CN
- China
- Prior art keywords
- target font
- text
- characters
- font file
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
Abstract
The invention discloses a kind of method and apparatus of display text, belong to field of computer technology.The described method includes: obtaining currently running application program text to be shown, and calculate the encoded radio of the text;The encoded radio range of each target font file in the corresponding multiple target font files of target font format is obtained, the sum of number of characters that the multiple target font file includes is not less than the number of characters that the application program includes;It is that the target font format is shown by the text conversion according to the encoded radio range of the encoded radio of the text and each target font file.Described device includes: the first acquisition module, and computing module, second obtains module and display module.All characters of the application program can be revealed in the present invention, improve display accuracy.
Description
Technical field
The present invention relates to field of computer technology, in particular to a kind of method and apparatus of display text.
Background technique
With the development of computer technology, the application program installed in terminal is more and more;Also, that installs in terminal is every
A application program corresponds to a fontlib, includes that the application program needs all characters to be shown in the fontlib;Terminal is being transported
When the row application program, if include the text of at least one character in the application program current display interface, terminal needs
Display text.
At present the text of major applications program all use TTF (True Type Font, truetype fonts) font format into
Row display, then the process of terminal display text can be with are as follows: stores a TTF font file in terminal, wraps in the TTF font file
Include 65535 characters that font format is TTF font format;When terminal needs display text, terminal is according to text to be shown
Originally with the TTF font file, the text is converted into TTF font format and is shown.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems:
Due to that can only store 65535 characters in TTF font file, however many corresponding fontlibs of application program include
Number of characters be greater than 65535, for example, the corresponding fontlib of application program includes 80328 characters, therefore, above-mentioned display text
A part of character that this method will lead to application program can not be shown.
Summary of the invention
In order to solve problems in the prior art, the present invention provides a kind of method and apparatus of display text.Technical solution
It is as follows:
A kind of method of display text, which comprises
Currently running application program text to be shown is obtained, and calculates the encoded radio of the text;
Obtain the encoded radio model of each target font file in the corresponding multiple target font files of target font format
It encloses, the sum of number of characters that the multiple target font file includes is not less than the number of characters that the application program includes;
According to the encoded radio range of the encoded radio of the text and each target font file, by the text conversion
It is shown for the target font format.
Preferably, the encoded radio for calculating the text, comprising:
The text is segmented, each participle that the text includes is obtained;
Calculate the encoded radio of each participle.
Preferably, described according to the encoded radio of the text and the encoded radio range of each target font file, it will
The text conversion is that the target font format is shown, comprising:
According to the encoded radio range of the encoded radio of the text and each target font file, from each target
The target font file where the text is determined in font file;
It is the target word physique by the text conversion according to the text and the target font file determined
The text of formula;
Show the text of the target font format.
Preferably, described according to the encoded radio of the text and the encoded radio range of each target font file, from
The target font file where the text is determined in each target font file, comprising:
The encoded radio for each participle for including according to the text and the encoded radio range of each target font, respectively
Determine the target font file where each participle;
Target font file where each participle is formed to the target font file where the text.
Preferably, each target font file obtained in the corresponding multiple target font files of target font format
Encoded radio range, comprising:
The corresponding fontlib of target font format is obtained, the number of characters that the fontlib includes applies journey not less than described
The number of characters that sequence includes;
According to default fractionation rule, the fontlib is split as multiple target font files, the multiple target font
The sum of number of characters that file includes is equal to the number of characters that the fontlib includes;
Calculate separately the encoded radio range of each target font file in the multiple target font file.
A kind of device of display text, described device include:
First obtains module, for obtaining currently running application program text to be shown;
Computing module, for calculating the encoded radio of the text;
Second obtains module, for obtaining each target word in the corresponding multiple target font files of target font format
The encoded radio range of body file, the sum of number of characters that the multiple target font file includes are not less than the application package
The number of characters included;
Display module, for according to the encoded radio of the text and the encoded radio range of each target font file,
It is that the target font format is shown by the text conversion.
Preferably, the computing module, comprising:
Participle unit obtains each participle that the text includes for segmenting the text;
First computing unit, for calculating the encoded radio of each participle.
Preferably, the display module, comprising:
Determination unit, for according to the encoded radio of the text and the encoded radio range of each target font file,
Target font file where determining the text in each target font file;
Converting unit, for being by the text conversion according to the text and the target font file determined
The text of the target font format;
Display unit, for showing the text of the target font format.
Preferably, the determination unit, comprising:
Determine subelement, the encoded radio of each participle for including according to the text and each target font
Encoded radio range determines the target font file where each participle respectively;
Subelement is formed, for the target font file where each participle to be formed to the target where the text
Font file.
Preferably, described second module is obtained, comprising:
Acquiring unit, for obtaining the corresponding fontlib of target font format, the number of characters that the fontlib includes is not
The number of characters for including less than the application program;
Division unit, it is described for according to default fractionation rule, the fontlib to be split as multiple target font files
The sum of number of characters that multiple target font files include is equal to the number of characters that the fontlib includes;
Second computing unit, for calculating separately the volume of each target font file in the multiple target font file
Code value range.
In embodiments of the present invention, the encoded radio of text to be shown is calculated, and to obtain target font format corresponding
The encoded radio range of each target font file in multiple target font files, according to the encoded radio of the text and each target
The text is converted to target font format and shown by the encoded radio range of font file;Since the present invention is provided with multiple
Target font file, and the sum of the number of characters that multiple target font files include is not less than the number of characters that the application program includes
Mesh, therefore, all characters of the application program can be revealed, and improve display accuracy.
Detailed description of the invention
Fig. 1 is a kind of method flow diagram of display text provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram of display text provided in an embodiment of the present invention;
Fig. 3-1 is a kind of apparatus structure schematic diagram of display text provided in an embodiment of the present invention;
Fig. 3-2 is a kind of structural schematic diagram of computing module provided in an embodiment of the present invention;
Fig. 3-3 is the structural schematic diagram of another display module provided in an embodiment of the present invention;
Fig. 3-4 is the structural schematic diagram of another determination unit provided in an embodiment of the present invention;
Fig. 3-5 is the provided in an embodiment of the present invention another second structural schematic diagram for obtaining module.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Currently, the text of major applications program all uses TTF font format to be shown, however TTF font file is most
65535 characters can only be mostly recorded, but the number of characters that many corresponding fontlibs of application program include is greater than 65535;Example
Such as, the corresponding fontlib of application program includes 80328 characters or even 120737 characters;So as to cause the one of application program
Partial character can not be shown.
In embodiments of the present invention, 80328 characters or 120737 characters are split according to certain rule to multiple
In different TTF font files, the encoded radio of text to be shown is calculated, according to the encoded radio of the text and multiple TTF fonts
The encoded radio range of each TTF font file in file, determines the TTF font file where the text, then according to this article
Originally with the TTF font file determined, the text is converted into TTF font format and is shown.Due to being arranged in the present invention
Multiple TTF font files, the number of characters for including in multiple TTF font files are greater than the application program corresponding fontlib packet
The number of characters included, thus the problem of overcoming a part of character of application program in the prior art and can not showing.
The embodiment of the invention provides a kind of method of display text, the executing subject of this method can be terminal;Referring to
Fig. 1, this method comprises:
Step S101: currently running application program text to be shown is obtained, and calculates the encoded radio of the text.
Step 102: obtaining each target font file in the corresponding multiple target font files of target font format
Encoded radio range, the sum of number of characters that multiple target font files include are not less than the number of characters that the application program includes.
Step 103: according to the encoded radio range of the encoded radio of the text and each target font file, the text being converted
It is shown for target font format.
In embodiments of the present invention, the encoded radio of text to be shown is calculated, and to obtain target font format corresponding
The encoded radio range of each target font file in multiple target font files, according to the encoded radio of the text and each target
The text is converted to target font format and shown by the encoded radio range of font file;Since the present invention is provided with multiple
Target font file, and the sum of the number of characters that multiple target font files include is not less than the number of characters that the application program includes
Mesh, therefore, all characters of the application program can be revealed, and improve display accuracy.
The embodiment of the invention provides a kind of method of display text, the executing subject of this method can be terminal;Referring to
Fig. 2, this method comprises:
Step S201: currently running application program text to be shown is obtained, and calculates the encoded radio of the text.
The application program is any application program installed in terminal;Also, the application program corresponds to a fontlib, should
It include that the application program needs all characters to be shown in fontlib;The number of characters that the fontlib includes is greater than 65535, example
Such as, which includes 80328 characters or 120737 characters.
When application program operation, terminal may need display text, and terminal is out of server or terminal at this time
Text to be shown is pulled in depositing, and by pre-arranged code mode, calculates the encoded radio of the text;This document can be the Chinese Chinese
Word, English character and/or number etc..
Wherein, by pre-arranged code mode, the step of calculating the encoded radio of the text, can be with are as follows:
The number of characters that the text includes is obtained directly to calculate if the number of characters is equal to 1 by pre-arranged code mode
The encoded radio of the text;If the number of characters that the text includes is not equal to 1, the text is segmented, the text is obtained
Including each participle the encoded radio of each participle is calculated by pre-arranged code mode.
It should be noted that pre-arranged code mode can be any one character code mode, for example, Unicode is (unified
Code) coding mode, ASCII (American Standard Code for Information Interchange, Unite States Standard
Information exchange code) coding mode, MBCS (Multi-ByteChactacterSystem, multibyte character system) coding staff
Formula, GB2312 (national standard 2312) coding mode, GBK (Chinese Internal Code Specification, Hanzi internal code
Extension specification) one of coding mode and Big5 coding mode or a variety of coding modes.
For example, preset coding mode calculates the text then by pre-arranged code mode for Unicode coding mode
The step of encoded radio, can be with are as follows:
Calculate the Unicode code value of the text.
Wherein, the process for calculating the Unicode code value of the text is the prior art, and in this not go into detail.
It should be noted that terminal can be the terminal of any operation system;For example, iOS (the movement of Apple Inc.'s exploitation
Operating system), Android (Android), Windows10 (the cross-platform and equipment application of new generation that MS is researched and developed
Operating system), Linux (it is free using and Free propagation class Unix operating system), the terminal of Unix operating system.
Step S202: each target font file in the corresponding multiple target font files of target font format is obtained
Encoded radio range, the sum of number of characters that multiple target font files include are not less than the number of characters that the application program includes.
Before this step, terminal needs to store corresponding multiple target font files of target font format and multiple
The encoded radio range of each target font file in target font file, in this step, terminal judges whether deposit in content
Each target font file is stored up, if storage, directly execution step S203;If do not stored, each target font file is added
It is downloaded in memory, and obtains the encoded radio range of stored each target font file.
Wherein, terminal can directly obtain the corresponding multiple mesh of the application program from the corresponding server of the application program
Mark the encoded radio range of font file and each target font file in multiple target font files, the first following realization
Mode;The character that the application program can also be included by terminal is split as multiple target font files and calculates multiple target words
The encoded radio range of each target font file in body file, following second of implementation.
It, can be with for the first implementation are as follows:
Terminal is by the application program installed in terminal, and by HTTP, (HyperText Transfer Protocol surpasses
Text transfer protocol) or other network protocols, the target of the application program is downloaded from the corresponding server of the application program
The corresponding multiple target font files of font format, and obtain the volume of each target font file in multiple target font files
Code value range stores the encoded radio range of multiple target font files and each target font file.
Wherein, target font can be TTF font;Multiple target font files can be stored in the default of terminal by terminal
In memory space.Default memory space can be terminal built-in or external memory space.
Further, terminal downloads the target font format pair of the application program from the corresponding server of the application program
When the multiple target font files answered, the version number of the application program can also be obtained, the version number is for identifying this using journey
The version of sequence;Also, terminal can determine whether the application program has updated according to the version number;If the application program is more
Newly, terminal can be obtained from server the application program of latest edition multiple target font files and multiple target words
The encoded radio range of each target font file in body file stores multiple target fonts of the application program of latest edition
The encoded radio range of file and each target font file.
For example, server by multiple target font files (for example, multiple TTF font files) and version number's file (for example,
Version file) one compressed package of boil down to, terminal by the application program installed in terminal by HHTP agreement or other
The compressed package is downloaded and is unziped in the specified directory in terminal built-in or external default memory space by network protocol.
For example, the specified directory can voluntarily be specified by application program, if the application program is that Android quickly looks up the dictionary
When application program, which can be with are as follows:/mnt/sdcard/kkdict/font/.
For second of implementation, it is corresponding multiple target font format can be obtained by following steps (1) to (3)
Target font file, and calculate the encoded radio range of each target font file in multiple target font files, comprising:
(1): obtaining the corresponding fontlib of target font format, the number of characters which includes applies journey not less than this
The number of characters that sequence includes.
It is corresponding from the application program by HTTP or other network protocols by the application program installed in terminal
The corresponding fontlib of target font format of the application program is downloaded in server;It is stored in the fontlib needed for the application program
All characters.
The number of characters that the fontlib includes is greater than the number of characters that a target font file can accommodate;For example, one
A target font file can accommodate 65535 characters, and the fontlib may include greater than 65535 characters;For example, the word
Body library includes 80328 characters or 120737 characters.
(2): according to default fractionation rule, which being split as multiple target font files, multiple target font texts
The sum of number of characters that part includes is equal to the font number that the fontlib includes.
It is default to split frequency of use, stroke number and/or the encoded radio size etc. that rule be character.For example, to tear open
Divider is then to be illustrated for encoded radio size, then this step can be with are as follows:
Terminal calculates the encoded radio size for each character that the fontlib includes, according to the encoded radio size of each character with
And the encoded radio range of each target font file in the corresponding multiple target font files of target font format, by the font
Each character that library includes is split into multiple target word body files.
For another example it is illustrated so that default fractionation rule is the frequency of use of character as an example;Then this step can be with are as follows:
Terminal counts the frequency of use for each character that the fontlib includes, according to the frequency of use and mesh of each character
The frequency of use range for marking each target font file in the corresponding multiple target font files of font format, by the fontlib
Including each character split into multiple target word body files.
Specifically, with target font format for TTF font format, which includes 80328 characters, by the application
The character that program includes is illustrated for splitting into 4 TTF font files.Then this step can be with are as follows:
Terminal is ranked up 80328 characters that the fontlib includes according to the sequence of frequency of use from high to low, obtains
Preceding 20902 characters in 80328 characters after sequence are put into first object font by 80328 characters after to sequence
In file (kkdict.ttf), 6582 subsequent characters are put into the second target font file (kkdict_extenda.ttf)
In, 29899 subsequent characters are put into third target font file (kkdict_extendb1.ttf), it will be last
22945 characters are put into the 4th target font file (kkdict_extendb2cde.ttf), first object font file, the
The sum of number of characters of two target font files, third target font file and the 4th target font file is equal to the fontlib packet
The number of characters included.
In embodiments of the present invention, since the frequency of use for the character for including according to the fontlib is split, and first
It include the highest preset number character of frequency of use in target font file, then in order to further increase display efficiency, in step
In rapid S201, currently running application program text to be shown is obtained, determines whether the length of the text is equal to 1, if should
The length of text is not equal to 1 namely the text only includes a character, it is determined that the text included is all ordinary symbol, directly
The selection first object font file from target font format corresponding multiple target font files is connect, according to the text and first
The text is converted to target font format and shown by target font file.
Wherein, include highest 20902 characters of frequency of use in first object font file, do not include more multicharacter
Purpose is exhausted most regions interface using the partial character, and efficiency can be greatly promoted by only taking in this partial character, also side
Just the TTF file that special algorithm discrimination finally uses.
It include 6582 characters (fewer number of character) in second target font file, so as to improve display effect
Rate, the TTF file for facilitating special algorithm discrimination finally to use.
It include 29899 characters in third target font file, by the second target font file and third target font text
Part is split, and can place in terminal and occur going here and there sub- phenomenon.
4th target font file includes 4 sections of characters, and the 4th target character is no longer split into 4 target font Ziwens
The purpose of part is in the case where not influencing efficiency, simplifies the complexity of specific discrimination algorithm.
(3): storing multiple target font files, and calculate each target font file in multiple target font files
Encoded radio range;
For each target font file in multiple target font files, the word for including in the target font file is calculated
The encoded radio of symbol selects minimum code value and maximum encoded radio from the encoded radio for the character for including in the target font file,
The encoded radio range of the target font file is determined according to the minimum code value and the maximum encoded radio.
For example, the maximum encoded radio of the target font file is 100, minimum code value is 55, then the target font file
Encoded radio range be [55,100].
Step S203: according to the encoded radio range of the encoded radio of the text and each target font file, from each target
The target font file where the text is determined in font file.
Specifically, the encoded radio range of the encoded radio for each participle for including according to the text and each target font, point
The target font file where each participle is not determined, the mesh where the target font file composition text where each participle
Mark font file.
It further, in this step, can be directly by first object font text if the text includes multiple characters
Part is determined as the target font file where the text, and first object font file includes frequency of use highest preset number
Character.
Step S204: according to the text and the target font file determined, the text is converted into target word physique
The text of formula.
Specifically, the target font file where each participle and each participle that include according to the text, will each divide
Word is converted to the participle of target font format, the text of the participle composition target font format of each target font format.
Before this step, terminal needs obtain transcode from server, store the transcode;In this step
In, by transcode, each participle is converted to the participle of target font format.
For example, the participle that each participle is converted to target font format can be passed through following code by transcode
It realizes:
//TypefaceUtil: the packaged tool-class of scheme
//context: current context describes file (can obtain easily in Android)
//textView: the reference for the control that set font
TypefaceUtil.setTypeface(context,textView)。
Step S205: the text of the target font format is shown.
In embodiments of the present invention, the encoded radio of text to be shown is calculated, and to obtain target font format corresponding
The encoded radio range of each target font file in multiple target font files, according to the encoded radio of the text and each target
The text is converted to target font format and shown by the encoded radio range of font file;Since the present invention is provided with multiple
Target font file, and the sum of the number of characters that multiple target font files include is not less than the number of characters that the application program includes
Mesh, therefore, all characters of the application program can be revealed, and improve display accuracy.
The embodiment of the invention provides a kind of device of display text, which is used to execute the side of above-mentioned display text
Method, and device application is in the terminal;Referring to Fig. 3-1, which includes:
First obtains module 301, for obtaining currently running application program text to be shown;
Computing module 302, for calculating the encoded radio of the text;
Second obtains module 303, for obtaining each mesh in the corresponding multiple target font files of target font format
The encoded radio range of font file is marked, the sum of number of characters that multiple target font files include includes not less than the application program
Number of characters;
Display module 304, for according to the encoded radio of the text and the encoded radio range of each target font file, by this
Text conversion is that target font format is shown.
Preferably, referring to Fig. 3-2, computing module 302, comprising:
Participle unit 3021 obtains each participle that the text includes for segmenting the text;
First computing unit 3022, for calculating the encoded radio of each participle.
Preferably, referring to Fig. 3-3, display module 304, comprising:
Determination unit 3041, for according to the encoded radio of the text and the encoded radio range of each target font file, from
The target font file where the text is determined in each target font file;
Converting unit 3042, for according to the text and the target font file determined, the text to be converted to target
The text of font format;
Display unit 3043, the text for displaying target font format.
Preferably, referring to Fig. 3-4, determination unit 3041, comprising:
Determine subelement 30411, the encoded radio of each participle for including according to the text and each target font
Encoded radio range determines the target font file where each participle respectively;
Form subelement 30412, for by where each participle target font file form the text where target
Font file.
Preferably, module 303 is obtained referring to Fig. 3-5, second, comprising:
Acquiring unit 3031, for obtaining the corresponding fontlib of target font format, the number of characters which includes
The number of characters for including not less than the application program;
Division unit 3032 is more for according to default fractionation rule, which to be split as multiple target font files
The sum of number of characters that a target font file includes is equal to the number of characters that fontlib includes;
Second computing unit 3033, for calculating separately the volume of each target font file in multiple target font files
Code value range.
In embodiments of the present invention, the encoded radio of text to be shown is calculated, and to obtain target font format corresponding
The encoded radio range of each target font file in multiple target font files, according to the encoded radio of the text and each target
The text is converted to target font format and shown by the encoded radio range of font file;Since the present invention is provided with multiple
Target font file, and the sum of the number of characters that multiple target font files include is not less than the number of characters that the application program includes
Mesh, therefore, all characters of the application program can be revealed, and improve display accuracy.
It should be understood that the device of display text provided by the above embodiment is in display text, only with above-mentioned each function
Can module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different functions
Module is completed, i.e., the internal structure of device is divided into different functional modules, described above all or part of to complete
Function.In addition, display text provided by the above embodiment and display text embodiment belong to same design, process is implemented
It is detailed in embodiment of the method, which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (12)
1. a kind of method of display text, which is characterized in that the described method includes:
Currently running application program text to be shown is obtained, and calculates the encoded radio of the text, the application program pair
The number of characters that the fontlib answered includes is greater than the number of characters that each target font file includes, and each target font file is
Truetype fonts TTF font file;
Obtain the corresponding fontlib of target font format, the number of characters that the corresponding fontlib of the target font format includes is not
Less than the number of characters that the application program includes, the target font format is TTF font format;
It is arranged according to the character that the sequence of frequency of use from high to low includes to the corresponding fontlib of the target font format
Sequence, the character after being sorted;
Character after the sequence is respectively put into as first object font file, the second target font file, third target word
In body file and the 4th target font file, the sum of number of characters that four target font files include is equal to the target font
The number of characters that the corresponding fontlib of format includes;It wherein, include that frequency of use is highest in the first object font file
Preset number character, the second target font file and the third target font file are to occur string word in order to prevent to show
The font file of elephant, the 4th target font file includes 4 sections of characters, and the 4th target font file is not split as
4 target font subfiles;
Calculate separately the encoded radio range of each target font file in the multiple target font file;
It is institute by the text conversion according to the encoded radio range of the encoded radio of the text and each target font file
Target font format is stated to be shown.
2. the method according to claim 1, wherein the encoded radio for calculating the text, comprising:
The text is segmented, each participle that the text includes is obtained;
Calculate the encoded radio of each participle.
3. the method according to claim 1, wherein the encoded radio and each mesh according to the text
The text conversion is that the target font format is shown by the encoded radio range for marking font file, comprising:
According to the encoded radio range of the encoded radio of the text and each target font file, from each target font
The target font file where the text is determined in file;
It is the target font format by the text conversion according to the text and the target font file determined
Text;
Show the text of the target font format.
4. according to the method described in claim 3, it is characterized in that, the encoded radio and each mesh according to the text
The encoded radio range for marking font file, the target font text where determining the text in each target font file
Part, comprising:
The encoded radio for each participle for including according to the text and the encoded radio range of each target font, determine respectively
Target font file where each participle;
Target font file where each participle is formed to the target font file where the text.
5. the method according to claim 1, wherein the corresponding fontlib of the application program include 80328 or
120737 characters.
6. the method according to claim 1, wherein in the first object font file include sequence after before
20902 characters include 6582 characters after preceding 20902 characters in the second target font file, described
It include 29899 characters after 6582 characters in third target font file, in the 4th target font file
Including 22945 characters after 29899 characters.
7. a kind of device of display text, which is characterized in that described device includes:
First obtains module, for obtaining currently running application program text to be shown, the corresponding word of the application program
The number of characters that body library includes is greater than the number of characters that each target font file includes, and each target font file is authentic word
Body TTF font file;
Computing module, for calculating the encoded radio of the text;
Second obtains module, for obtaining the corresponding fontlib of target font format, the corresponding font of the target font format
The number of characters that library includes is not less than the number of characters that the application program includes, and the target font format is TTF font lattice
Formula;It is arranged according to the character that the sequence of frequency of use from high to low includes to the corresponding fontlib of the target font format
Sequence, the character after being sorted;Character after the sequence is respectively put into as first object font file, the second target font
In file, third target font file and the 4th target font file, the sum of number of characters that four target font files include
The number of characters that fontlib corresponding equal to the target font format includes;Wherein, it is wrapped in the first object font file
Include the highest preset number character of frequency of use, the second target font file and the third target font file be for
Prevent the font file of string word phenomenon, the 4th target font file includes 4 sections of characters, and the 4th target word
Body file is not split as 4 target font subfiles;Calculate separately each target word in the multiple target font file
The encoded radio range of body file;
Display module, for according to the encoded radio of the text and the encoded radio range of each target font file, by institute
Stating text conversion is that the target font format is shown.
8. device according to claim 7, which is characterized in that the computing module, comprising:
Participle unit obtains each participle that the text includes for segmenting the text;
First computing unit, for calculating the encoded radio of each participle.
9. device according to claim 7, which is characterized in that the display module, comprising:
Determination unit, for according to the encoded radio of the text and the encoded radio range of each target font file, from institute
State the target font file determined where the text in each target font file;
Converting unit, for being described by the text conversion according to the text and the target font file determined
The text of target font format;
Display unit, for showing the text of the target font format.
10. device according to claim 9, which is characterized in that the determination unit, comprising:
Determine subelement, the coding of the encoded radio of each participle for including according to the text and each target font
It is worth range, determines the target font file where each participle respectively;
Subelement is formed, for the target font file where each participle to be formed to the target font where the text
File.
11. device according to claim 7, which is characterized in that the corresponding fontlib of the application program include 80328 or
120737 characters.
12. device according to claim 7, which is characterized in that include after sorting in the first object font file
Preceding 20902 characters include 6582 characters after preceding 20902 characters, institute in the second target font file
It states in third target font file including 29899 characters after 6582 characters, the 4th target font file
In include 29899 characters after 22945 characters.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610191364.1A CN105893335B (en) | 2016-03-30 | 2016-03-30 | The method and apparatus of display text |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610191364.1A CN105893335B (en) | 2016-03-30 | 2016-03-30 | The method and apparatus of display text |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105893335A CN105893335A (en) | 2016-08-24 |
CN105893335B true CN105893335B (en) | 2019-07-12 |
Family
ID=57014648
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610191364.1A Active CN105893335B (en) | 2016-03-30 | 2016-03-30 | The method and apparatus of display text |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105893335B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107239436B (en) * | 2017-05-31 | 2018-12-28 | 腾讯科技(深圳)有限公司 | A kind of data transfer device and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101751451A (en) * | 2008-12-11 | 2010-06-23 | 高德软件有限公司 | Chinese data compression method and Chinese data decompression method and related devices |
CN102289427A (en) * | 2011-08-31 | 2011-12-21 | 深圳市茁壮网络股份有限公司 | Method, client side and server for realizing multifont display |
CN102521261A (en) * | 2011-11-18 | 2012-06-27 | 四川长虹电器股份有限公司 | Method for manufacturing dot matrix word stock according to vector word stock |
CN103425631A (en) * | 2013-07-19 | 2013-12-04 | 百度在线网络技术(北京)有限公司 | Method and device for acquiring font files of target characters in document files |
CN103491414A (en) * | 2013-09-06 | 2014-01-01 | 深圳市创维软件有限公司 | Method and device for processing character and set top box |
CN105224509A (en) * | 2014-05-30 | 2016-01-06 | 北大方正集团有限公司 | A kind of method and device generating font format |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1763741A (en) * | 2004-10-20 | 2006-04-26 | 联发科技股份有限公司 | Multi-language system and method for quickly picking font file corresponding to character |
CN100495297C (en) * | 2005-09-29 | 2009-06-03 | 深圳润汇科技有限公司 | Method for realizing Tibetan language input, display and short-message reception and transmission on hand-held electronic terminal |
CN101488125B (en) * | 2008-12-04 | 2015-03-25 | 洛藏 | Tibetan language encoding method and terminal |
-
2016
- 2016-03-30 CN CN201610191364.1A patent/CN105893335B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101751451A (en) * | 2008-12-11 | 2010-06-23 | 高德软件有限公司 | Chinese data compression method and Chinese data decompression method and related devices |
CN102289427A (en) * | 2011-08-31 | 2011-12-21 | 深圳市茁壮网络股份有限公司 | Method, client side and server for realizing multifont display |
CN102521261A (en) * | 2011-11-18 | 2012-06-27 | 四川长虹电器股份有限公司 | Method for manufacturing dot matrix word stock according to vector word stock |
CN103425631A (en) * | 2013-07-19 | 2013-12-04 | 百度在线网络技术(北京)有限公司 | Method and device for acquiring font files of target characters in document files |
CN103491414A (en) * | 2013-09-06 | 2014-01-01 | 深圳市创维软件有限公司 | Method and device for processing character and set top box |
CN105224509A (en) * | 2014-05-30 | 2016-01-06 | 北大方正集团有限公司 | A kind of method and device generating font format |
Also Published As
Publication number | Publication date |
---|---|
CN105893335A (en) | 2016-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9940744B2 (en) | Remote font management | |
CN105204823B (en) | Generate the method and device of application program installation kit | |
CN102750337B (en) | Producing method and device for font | |
CN104424165B (en) | A kind of text document mess code detection method and system | |
US20200089737A1 (en) | Acquisition of a Font Portion Using a Compression Mechanism | |
US20160203152A1 (en) | Enhanced compression, encoding, and naming for resource strings | |
US10467001B2 (en) | Enhanced compression, encoding, and naming for resource strings | |
US9467166B2 (en) | Enhanced compression, encoding, and naming for resource strings | |
CN110147330B (en) | Word matrix data caching method, device, equipment and storage medium | |
CN100464333C (en) | File name generating method and device in file distribution system | |
CN108647032B (en) | Application loading method and device, computer device and computer readable storage medium | |
CN106033453A (en) | Character embedding method, character embedding system, browser and client | |
KR970071228A (en) | Progressively Renderable Font, its Conversion Method and Rendering Method | |
CN109471921A (en) | A kind of text duplicate checking method, device and equipment | |
CN105528345A (en) | Terminal, server and character complementing method | |
CN105893335B (en) | The method and apparatus of display text | |
US20160203151A1 (en) | Enhanced compression, encoding, and naming for resource strings | |
CN104424163B (en) | Literal processing method and system | |
JP5549177B2 (en) | Compression program, method and apparatus, and decompression program, method and apparatus | |
CN102063415B (en) | Method and system for embedding single-byte fonts in PDF (Portable Document Format) file | |
CN107070679A (en) | A kind of method uniformly released news in different platform | |
CN110020343B (en) | Method and device for determining webpage coding format | |
CN102063416B (en) | Method and system for embedding double-byte fonts into PDF file | |
WO2017151404A1 (en) | Conditional determination of lookups in glyph processing | |
CN102169478B (en) | For presenting the apparatus and method of multi-language text |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
EE01 | Entry into force of recordation of patent licensing contract | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20160824 Assignee: GUANGZHOU HUYA INFORMATION TECHNOLOGY Co.,Ltd. Assignor: Guangzhou Huaduo Network Technology Co., Ltd. Contract record no.: 2018990000088 Denomination of invention: Method and device for displaying texts on terminal device in network License type: Common License Record date: 20180413 |
|
GR01 | Patent grant | ||
GR01 | Patent grant |