CN106502968A - The method and device of data processing - Google Patents

The method and device of data processing Download PDF

Info

Publication number
CN106502968A
CN106502968A CN201610891505.0A CN201610891505A CN106502968A CN 106502968 A CN106502968 A CN 106502968A CN 201610891505 A CN201610891505 A CN 201610891505A CN 106502968 A CN106502968 A CN 106502968A
Authority
CN
China
Prior art keywords
text
font
file
original
font 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.)
Pending
Application number
CN201610891505.0A
Other languages
Chinese (zh)
Inventor
陈学中
张楷豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Beijing Qianxin Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Beijing Qianxin Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Beijing Qianxin Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610891505.0A priority Critical patent/CN106502968A/en
Publication of CN106502968A publication Critical patent/CN106502968A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of method and device of data processing, is related to field of computer technology, it is to solve the problems, such as the low invention of the existing webpage loading efficiency comprising new font type.The method of the present invention includes:Text is obtained, the text is the text in webpage;The corresponding font data of all characters in the text is searched in the corresponding original font file of the text, and the original font file is comprising the font data with all characters of character same type in the text;The font data of all characters in the text is write new font file according to the specification of the original font file, target font file is obtained, so as to browser downloads target font file correctly show the text in webpage.During the present invention is applied to load webpage.

Description

The method and device of data processing
Technical field
A kind of the present invention relates to field of computer technology, more particularly to method and device of data processing.
Background technology
At present, text message is still the topmost content of webpage, with CSS (Cascading Style Sheets, CSS) technology continuous maturation, web fonts are increasingly becoming the topic of concern.In order that webpage reaches different enriching Colorful technique effect, the diversified font type of corresponding appearance, especially for Chinese, font type is even more multiple many Sample, nor breaking has new font type to occur, therefore browser is when webpage is loaded, it is possible to can run into the webpage of loading In include new font type, and browser does not support new font type i.e. without the corresponding font file of new font type Situation, at this moment needs browser also to download font file corresponding with new font while webpage is loaded, so as to by webpage Comprising new font correctly show.
In the corresponding font file of download new font type, as font file is usually corresponding comprising all texts New font, therefore font file is very big, can such as reach that 4M is even more big, and font file causes more greatly browser loading Speed is slower, and especially in the case where network state is bad, the efficiency of downloaded fonts file is lower, and then causes browser to load The efficiency of webpage is lower.
Content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome the problems referred to above or at least in part solve on State the method and device of the data processing of problem.
For solving above-mentioned technical problem, on the one hand, the invention provides a kind of method of data processing, including:
Text is obtained, the text is the text in webpage;
The corresponding font data of all characters in the text, institute is searched in the corresponding original font file of the text It is comprising the font data with all characters of character same type in the text to state original font file;
The font data of all characters in the text is write new font according to the specification of the original font file File, obtains target font file, so that browser downloads target font file.
On the other hand, the invention provides a kind of device of data processing, including:
Acquiring unit, for obtaining text, the text is the text in webpage;
Font searching unit, for searching all characters in the text in the corresponding original font file of the text Corresponding font data, the original font file are comprising the font number with all characters of character same type in the text According to;
Writing unit, for by the font data of all characters in the text according to the original font file specification The new font file of write, obtains target font file, so that browser downloads target font file will be correct for the text Show in webpage.
The method and device of the data processing provided by above-mentioned technical proposal, the present invention, can obtain text first, text This is the text in webpage;Secondly, the corresponding font of all characters in text is searched in the corresponding original font file of text Data, wherein, original font file is comprising the font data with all characters of character same type in the text;Finally, The font data of all characters in the text is write new font file according to the specification of original font file, target is obtained Font file, so as to browser downloads target font file correctly show the text in webpage.With prior art phase Than the present invention can be by the font data in corresponding for text original font file only comprising all characters in the text again The new font file of composition is target font file, due to only including all characters in above-mentioned text in target font file Font data, therefore substantially reduces the size of file itself compared to original font file, therefore, it is possible to improve under browser The speed of font file is carried, and then improves the loading efficiency of webpage.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of description, and in order to allow the above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred implementation, various other advantages and benefit are common for this area Technical staff will be clear from understanding.Accompanying drawing is only used for the purpose for illustrating preferred implementation, and is not considered as to the present invention Restriction.And in whole accompanying drawing, it is denoted by the same reference numerals identical part.In the accompanying drawings:
Fig. 1 shows a kind of method flow diagram of data processing provided in an embodiment of the present invention;
Fig. 2 shows the method flow diagram of another kind of data processing provided in an embodiment of the present invention;
Fig. 3 shows a kind of composition frame chart of the device of data processing provided in an embodiment of the present invention;
Fig. 4 shows the composition frame chart of the device of another kind of data processing provided in an embodiment of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here Limited.On the contrary, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
Low for solving the problems, such as the existing webpage loading efficiency comprising new font type, embodiments provide one kind The method of data processing, as shown in figure 1, the method includes:
Firstly, it is necessary to illustrated be the executive agent of the present embodiment be a plug-in unit, typically browser a plug-in unit.
101st, text is obtained.
Text in the present embodiment is primarily referred to as the text in webpage, and to quote browser of webpage etc. be not wrap in itself Containing the font type belonging to the text, the such as text of the composition such as new font type or sytlized font.New font type is usual Font of the finger full of animation sense, profile are the font of animal head, interesting font of picture making etc., and sytlized font may be first Bone text etc..Wherein above-mentioned text is probably full text or a part of text in webpage in webpage.
It is further to note that it is not directly to obtain text from webpage to obtain text, but the text in webpage Before also being shown not over browser for quoting webpage etc., the above-mentioned text that will show in webpage is obtained.
It is the necessary preparation for obtaining the corresponding font data of character in text in subsequent step to obtain text.
102nd, the corresponding font data of all characters in text is searched in the corresponding original font file of text.
When browser runs into the text included in the webpage of reference in step 101, operating system can expose corresponding answering With routine interface (Application Program Interface, API), make browser select tool to enter above-mentioned text Row is correct to be processed.The present embodiment is to arrange default suffix name in advance, during the file for making browser read default suffix name, by which Plug-in unit is returned to, rather than directly the file to presetting suffix name is downloaded.The mistake that original font file is returned to plug-in unit Journey can have various ways, and common form is form of data flow etc..Wherein preset suffix name file be and text pair The suffix name of the original font file that answers.After plug-in unit receives original font file, can be according to the need of original font file Original font file to be read, and therefrom extract the corresponding font data of all characters in above-mentioned text.Due to raw font text Included in part is the font data with all characters of character same type in text, and need to use in the present embodiment simply The font data of all characters in the text being related in step 101, therefore only needs to extract to meet from original font file need The font data that asks.
103rd, the font data of all characters in text is write new font file according to the specification of original font file, Obtain target font file.
The font data of all characters obtained by step 102 is compiled into new word according to the specification of original font file Body file, is denoted as target font file.
The specifications, such as font file such as every kind of font file has corresponding file to constitute, file reading (TrueTypeFont, TTF) file, it are a kind of fons that is released by Microsoft and Apple jointly, its The filespec of middle TTF files includes:Version number comprising font format and several tables in font directoiy, each table have one Tableentry structure items;And all data are encoded using big-endian, highest bit byte is up front;In each table Save same logical message, mapping table of such as primitive data table, character to pel etc.;Etc. more specifications.Different words The generally corresponding different filespec of body file.In order to not meet the specification of original font file, therefore will select will be from original The font data that extracts in font file is compiled according further to the specification of original font file and obtains target font file.
Due in the target font file that obtains according to original font file specification only comprising all characters in above-mentioned text Font data, equivalent to the font data in original font file is filtered, obtained only comprising need font The font file of data, is therefore greatly reduced the size for downloading file, so as to accelerate in browser downloads font file The speed that downloads, and in the loading speed for ensureing to improve webpage on the premise of above-mentioned text that webpage includes correctly shows Degree.
The method of data processing provided in an embodiment of the present invention, can obtain text first, and text is the text in webpage; Secondly, the corresponding font data of all characters in text, wherein, raw font are searched in the corresponding original font file of text File is comprising the font data with all characters of character same type in the text;Finally, by all words in the text The font data of symbol writes new font file according to the specification of original font file, obtains target font file, so as to browse Device is downloaded target font file and correctly shows the text in webpage.Compared with prior art, embodiment of the present invention energy Enough font datas by corresponding for text original font file only comprising all characters in the text reformulate new word Body file is target font file, due to the font data in target font file only comprising all characters in above-mentioned text, Therefore the size of file itself is substantially reduced compared to original font file, therefore, it is possible to improve browser downloads font file Speed, and then improve webpage loading efficiency.
Further, as the refinement and extension to method shown in Fig. 1, another embodiment of the present invention gives a kind of number Method according to processing.As shown in Fig. 2 the method includes:
201st, text is obtained.
Text in the present embodiment is primarily referred to as the text in webpage, and to quote browser of webpage etc. be not wrap in itself Containing the font type belonging to the text, the such as text of the composition such as new font type or sytlized font.New font type is usual Font of the finger full of animation sense, profile are the font of animal head, interesting font of picture making etc., and sytlized font may be first Bone text etc..Wherein above-mentioned text is probably full text or a part of text in webpage in webpage.
Wherein obtaining text specifically includes two kinds of approach:
The first approach, from the corresponding HTML of webpage (Hyper Text Markup Language, HTML) text is extracted in file.Concrete implementation mode is as follows:
First, the selector of the HTML element that browser is arranged is searched.
Browser can arrange, while original font file is transmitted, the text for needing to search in original font file in advance HTML element corresponding to this, text is included in corresponding HTML element, and HTML element is needed by corresponding selector Selected, it is therefore desirable to search the corresponding selector of corresponding HTML element.
Then, the text in corresponding HTML element is extracted according to selector.
The text in corresponding HTML element is navigated to according to the corresponding selector of the HTML element that finds, and extracts this article This.
Second approach, for some users can be input into the website of text, such as various forums, microblogging etc., input Can also there is the situation of the font type that corresponding browser is not supported in text, at this moment need the text directly inputted from outside The text that middle extraction step 201 is related to.
It is the necessary preparation for obtaining the corresponding font data of character in text in subsequent step to obtain text.
202nd, each character in text is encoded according to pre-arranged code rule, obtains corresponding character code.
In the present embodiment, pre-arranged code refers to a kind of character code, presets for the font file of different-format is corresponding Coding rule is probably different, such as the corresponding pre-arranged code rule of the font file of TTF forms is encoded for Unicode Rule.Each character in text is encoded according to pre-arranged code rule, corresponding character code is obtained, is obtained character code It is the font data in order to search corresponding character in original font file.
203rd, the font index of corresponding each character is searched in the first concordance list according to character code.
Include multiple tables in original font file, and only need in the present embodiment using several tables therein, it is therefore desirable to Registration table in by original font file is the index that the index of all tables finds required table, then according to the index of required table Corresponding required table is found in original font file.Table needed for this step is the mapping of character code and font index Table, is denoted as the first concordance list.Just can be corresponding according to being found by the character code obtained in step 202 by the first concordance list Font is indexed, and it is the necessary preparation for subsequently finding font data to obtain font index., wherein it is desired to illustrate, if original Font file is TTF files, then corresponding first concordance list is Cmap tables.
204th, the font data of corresponding each character is searched in font data table according to font index.
Before according to the corresponding font data of font index search, it is necessary first to get font data table, font number According to have recorded all of font data in table, and the lookup of font data needs to make a look up by font index, therefore first Need to obtain font data table.Being achieved in that for the first concordance list is obtained in the acquisition of font data table and step 203 identical , be all by original font file in registration table search obtain., wherein it is desired to illustrate, if original font file For TTF files, then corresponding first concordance list is glyf tables.
After obtaining font data table, indexed according to the font obtained by step 203 and searched and word in font data table Shape indexes corresponding font data.
It should be noted that font data refers to that the outline definition of each font (also referred to as " pel ") and grid adjustment refer to Order.The font data for obtaining is the corresponding font data of character in text.
205th, the font data of all characters in text is write new font file according to the specification of original font file, Obtain target font file.
The implementation of this step is identical with the implementation in Fig. 1 steps 103, and here is omitted.
Further, as the realization to the various embodiments described above, another embodiment of the embodiment of the present invention additionally provides one The device of data processing is planted, for realizing the method described in above-mentioned Fig. 1 and Fig. 2.As shown in figure 3, the device includes:Acquiring unit 31st, font searching unit 32 and writing unit 33.
Acquiring unit 31, for obtaining text, text is the text in webpage.
Text in the present embodiment is primarily referred to as the text in webpage, and to quote browser of webpage etc. be not wrap in itself Containing the font type belonging to the text, the such as text of the composition such as new font type or sytlized font.New font type is usual Font of the finger full of animation sense, profile are the font of animal head, interesting font of picture making etc., and sytlized font may be first Bone text etc..Wherein above-mentioned text is probably full text or a part of text in webpage in webpage.
It is further to note that it is not directly to obtain text from webpage to obtain text, but the text in webpage Before also being shown not over browser for quoting webpage etc., the above-mentioned text that will show in webpage is obtained.
Font searching unit 32, corresponding for searching all characters in text in the corresponding original font file of text Font data, original font file are comprising the font data with all characters of character same type in text.
When browser runs into the text included in the webpage of reference in acquiring unit 31, operating system can expose corresponding Application programming interfaces API, makes browser select tool correctly to process above-mentioned text.The present embodiment is to arrange in advance Default suffix name, during the file for making browser read default suffix name, is returned to plug-in unit, rather than directly to presetting suffix The file of name is downloaded.Can have various ways by the process that original font file is returned to plug-in unit, common form is Form of data flow etc..The file for wherein presetting suffix name is the suffix name of original font file corresponding with text.Work as plug-in unit After receiving original font file, reading original font file can be needed according to original font file, and therefrom be extracted State the corresponding font data of all characters in text.Due to included in original font file it is and character same type in text The font data of all characters, and in the present embodiment, need all characters in the text being related in the simply acquiring unit 31 for using Font data, therefore only need to extract from original font file and meet the font data of demand.
Writing unit 33, for new according to the specification write of original font file by the font data of all characters in text Font file, obtain target font file, so as to browser downloads target font file correctly show text in webpage In.
The font data of all characters obtained by font searching unit 32 is compiled according to the specification of original font file The font file of Cheng Xin, is denoted as target font file.
The specifications, such as font file such as every kind of font file has corresponding file to constitute, file reading (TrueTypeFont, TTF) file, it are a kind of fons that is released by Microsoft and Apple jointly, its The filespec of middle TTF files includes:Version number comprising font format and several tables in font directoiy, each table have one Tableentry structure items;And all data are encoded using big-endian, highest bit byte is up front;In each table Save same logical message, mapping table of such as primitive data table, character to pel etc.;Etc. more specifications.Different words The generally corresponding different filespec of body file.In order to not meet the specification of original font file, therefore will select will be from original The font data that extracts in font file is compiled according further to the specification of original font file and obtains target font file.
Due in the target font file that obtains according to original font file specification only comprising all characters in above-mentioned text Font data, equivalent to the font data in original font file is filtered, obtained only comprising need font The font file of data, is therefore greatly reduced the size for downloading file, so as to accelerate in browser downloads font file The speed that downloads, and in the loading speed for ensureing to improve webpage on the premise of above-mentioned text that webpage includes correctly shows Degree.
Further, as shown in figure 4, font searching unit 32, including:
Coding module 321, for encoding according to pre-arranged code rule to each character in text, obtains corresponding Character code;
In the present embodiment, pre-arranged code refers to a kind of character code, presets for the font file of different-format is corresponding Coding rule is probably different, such as the corresponding pre-arranged code rule of the font file of TTF forms is encoded for Unicode Rule.Each character in text is encoded according to pre-arranged code rule, corresponding character code is obtained, is obtained character code It is the font data in order to search corresponding character in original font file.
First searching modul 322, for searching the font of each character corresponding in the first concordance list according to character code Index, the first concordance list are the mapping table of character code and font index;
Include multiple tables in original font file, and only need in the present embodiment using several tables therein, it is therefore desirable to Registration table in by original font file is the index that the index of all tables finds required table, then according to the index of required table Corresponding required table is found in original font file.Table needed for this step is the mapping of character code and font index Table, is denoted as the first concordance list.Just can be right according to being found by the character code obtained in coding module 321 by the first concordance list The font index that answers, it is the necessary preparation for subsequently finding font data to obtain font index., wherein it is desired to illustrate, if Original font file is TTF files, then corresponding first concordance list is Cmap tables.
Second searching modul 323, for searching the font of each character corresponding in font data table according to font index Data.
Before according to the corresponding font data of font index search, it is necessary first to get font data table, font number According to have recorded all of font data in table, and the lookup of font data needs to make a look up by font index, therefore first Need to obtain font data table.The realization side of the first concordance list is obtained in the acquisition of font data table and the first searching modul 322 Formula is identical, be all by original font file in registration table search obtain., wherein it is desired to illustrate, if original Font file is TTF files, then corresponding first concordance list is glyf tables.
After obtaining font data table, indexed in font data table according to the font obtained by the first searching modul 322 Search and the font corresponding font data of index.
It should be noted that font data refers to that the outline definition of each font (also referred to as " pel ") and grid adjustment refer to Order.The font data for obtaining is the corresponding font data of character in text.
Further, as shown in figure 4, device is further included:
Registration table searching unit 34, in the word for searching each character corresponding according to character code in the first concordance list Before shape index, the registration table in original font file is searched, registration table is the rope of all tables included in original font file Draw;
Concordance list searching unit 35, for according to registration the first concordance list of table search and font data table.
Further, as shown in figure 4, acquiring unit 31, including:
Extraction module 311, for extracting text from the corresponding HTML html file of webpage.
Acquisition module 312, for obtaining text directly from outside input.
For some users can be input into the website of text, such as various forums, microblogging etc. can be also deposited in the text of input The situation of the font type that does not support in corresponding browser, at this moment needs to extract acquisition list in the text directly inputted from outside The text that unit 31 is related to.
Further, extraction module 311 is used for:
The selector of HTML element is searched, HTML element is the corresponding HTML element of text;
First, the selector of the HTML element that browser is arranged is searched.
Browser can arrange, while original font file is transmitted, the text for needing to search in original font file in advance HTML element corresponding to this, text is included in corresponding HTML element, and HTML element is needed by corresponding selector Selected, it is therefore desirable to search the corresponding selector of corresponding HTML element.
Text in corresponding HTML element is extracted according to selector.
Then, the text in corresponding HTML element is navigated to according to the corresponding selector of the HTML element that finds, and is carried Take the text.
The device of data processing provided in an embodiment of the present invention, can obtain text first, and text is the text in webpage; Secondly, the corresponding font data of all characters in text, wherein, raw font are searched in the corresponding original font file of text File is comprising the font data with all characters of character same type in the text;Finally, by all words in the text The font data of symbol writes new font file according to the specification of original font file, obtains target font file, so as to browse Device is downloaded target font file and correctly shows the text in webpage.Compared with prior art, embodiment of the present invention energy Enough font datas by corresponding for text original font file only comprising all characters in the text reformulate new word Body file is target font file, due to the font data in target font file only comprising all characters in above-mentioned text, Therefore the size of file itself is substantially reduced compared to original font file, therefore, it is possible to improve browser downloads font file Speed, and then improve webpage loading efficiency.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the portion that describes in detail Point, may refer to the associated description of other embodiment.
It is understood that said method and the correlated characteristic in device mutually can be referred to.In addition, in above-described embodiment " first ", " second " etc. be for distinguishing each embodiment, and do not represent the quality of each embodiment.
Those skilled in the art can be understood that, for convenience and simplicity of description, the system of foregoing description, Device and the specific work process of unit, may be referred to the corresponding process in preceding method embodiment, will not be described here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together based on teaching in this.As described above, construct required by this kind of system Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use various Programming language realizes the content of invention described herein, and the above description done by language-specific is to disclose this Bright preferred forms.
In description mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention Example can be put into practice in the case where not having these details.In some instances, known method, structure are not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure helping understand one or more in each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes In example, figure or descriptions thereof.However, should not be construed to reflect following intention by the method for the disclosure:I.e. required guarantor The more features of feature that the application claims ratio of shield is expressly recited in each claim.More precisely, such as following Claims reflected as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as the separate embodiments of the present invention.
Those skilled in the art be appreciated that can to embodiment in equipment in module carry out adaptively Change and they are arranged in one or more equipment different from the embodiment.Can be the module in embodiment or list Unit or component are combined into a module or unit or component, and can be divided in addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit is excluded each other, can adopt any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (includes adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can identical by offers, be equal to or the alternative features of similar purpose carry out generation Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In some included features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection appoint One of meaning can in any combination mode using.
The present invention all parts embodiment can be realized with hardware, or with one or more processor operation Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) are realizing denomination of invention according to embodiments of the present invention (such as data processing Device) in some or all parts some or all functions.The present invention is also implemented as executing institute here (for example, computer program and computer program are produced for some or all equipment of the method for description or program of device Product).Such program for realizing the present invention can be stored on a computer-readable medium, or can have one or more The form of signal.Such signal can be downloaded from internet website and be obtained, or on carrier signal provide, or with appoint What other forms is provided.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference markss being located between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element listed in the claims or step.Word "a" or "an" before being located at element does not exclude the presence of multiple such Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer Existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and be run after fame Claim.

Claims (10)

1. a kind of method of data processing, it is characterised in that methods described includes:
Text is obtained, the text is the text in webpage;
The corresponding font data of all characters in the text, the original is searched in the corresponding original font file of the text Beginning font file is comprising the font data with all characters of character same type in the text;
The font data of all characters in the text is write new font file according to the specification of the original font file, Target font file is obtained, so as to browser downloads target font file correctly show the text in webpage.
2. method according to claim 1, it is characterised in that described look in the corresponding original font file of the text The corresponding font data of all characters in the text is looked for, including:
Each character in the text is encoded according to pre-arranged code rule, corresponding character code is obtained;
According to the font index that character code searches each character corresponding in the first concordance list, first concordance list is character The mapping table that coding is indexed with font;
According to the font data that font index searches each character corresponding in font data table.
3. method according to claim 2, it is characterised in that searched in the first concordance list according to character code described Before the font index of each character corresponding, methods described is further included:
The registration table in the original font file is searched, the registration table is all tables included in the original font file Index;
The first concordance list and font data table according to the registration table search.
4. method according to claim 1, it is characterised in that the acquisition text, including:
Text is extracted from the corresponding HTML html file of the webpage;Or,
Obtain the text directly from outside input.
5. method according to claim 1, it is characterised in that extract text in the corresponding html file from the webpage This, including:
The selector of HTML element is searched, the HTML element is the corresponding HTML element of the text;
Text in corresponding HTML element is extracted according to the selector.
6. a kind of device of data processing, it is characterised in that described device includes:
Acquiring unit, for obtaining text, the text is the text in webpage;
Font searching unit, corresponding for searching all characters in the text in the corresponding original font file of the text Font data, the original font file is comprising the font data with all characters of character same type in the text;
Writing unit, for writing the font data of all characters in the text according to the specification of the original font file New font file, obtains target font file, so as to browser downloads target font file correctly show the text In webpage.
7. device according to claim 6, it is characterised in that the font searching unit, including:
Coding module, for encoding according to pre-arranged code rule to each character in the text, obtains corresponding word Symbol coding;
First searching modul, for searching the font index of each character corresponding, institute in the first concordance list according to character code The mapping table that the first concordance list is indexed with font is stated for character code;
Second searching modul, for searching the font number of each character corresponding in font data table according to font index According to.
8. device according to claim 7, it is characterised in that described device is further included:
Registration table searching unit, in the font for searching each character corresponding according to character code in the first concordance list Before index, the registration table in the original font file is searched, include in the registration table original font file The index of all tables;
Concordance list searching unit, for the first concordance list and font data table according to the registration table search.
9. device according to claim 6, it is characterised in that the acquiring unit, including:
Extraction module, for extracting text from the corresponding HTML html file of the webpage;
Acquisition module, for obtaining text directly from outside input.
10. device according to claim 6, it is characterised in that the extraction module is used for:
The selector of HTML element is searched, the HTML element is the corresponding HTML element of the text;
Text in corresponding HTML element is extracted according to the selector.
CN201610891505.0A 2016-10-12 2016-10-12 The method and device of data processing Pending CN106502968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610891505.0A CN106502968A (en) 2016-10-12 2016-10-12 The method and device of data processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610891505.0A CN106502968A (en) 2016-10-12 2016-10-12 The method and device of data processing

Publications (1)

Publication Number Publication Date
CN106502968A true CN106502968A (en) 2017-03-15

Family

ID=58295273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610891505.0A Pending CN106502968A (en) 2016-10-12 2016-10-12 The method and device of data processing

Country Status (1)

Country Link
CN (1) CN106502968A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362790A (en) * 2019-06-13 2019-10-22 北京三快在线科技有限公司 Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file
CN110705210A (en) * 2019-09-18 2020-01-17 北京中网易企秀科技有限公司 Chinese font loading method and device
CN111859853A (en) * 2020-08-04 2020-10-30 浪潮卓数大数据产业发展有限公司 Webpage text encryption and decryption method based on random font

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996160A (en) * 2009-08-10 2011-03-30 北大方正集团有限公司 Method and system for processing script data
US20110258535A1 (en) * 2010-04-20 2011-10-20 Scribd, Inc. Integrated document viewer with automatic sharing of reading-related activities across external social networks
CN103425631A (en) * 2013-07-19 2013-12-04 百度在线网络技术(北京)有限公司 Method and device for acquiring font files of target characters in document files
KR20130138640A (en) * 2012-11-08 2013-12-19 (주)정글시스템 Dynamic embedded web font service method and web font service system
CN103761110A (en) * 2014-02-18 2014-04-30 优视科技有限公司 Browser font displaying and processing method and device
CN105677646A (en) * 2014-11-17 2016-06-15 北京大学 Word stock generation method and system, and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996160A (en) * 2009-08-10 2011-03-30 北大方正集团有限公司 Method and system for processing script data
US20110258535A1 (en) * 2010-04-20 2011-10-20 Scribd, Inc. Integrated document viewer with automatic sharing of reading-related activities across external social networks
KR20130138640A (en) * 2012-11-08 2013-12-19 (주)정글시스템 Dynamic embedded web font service method and web font service system
CN103425631A (en) * 2013-07-19 2013-12-04 百度在线网络技术(北京)有限公司 Method and device for acquiring font files of target characters in document files
CN103761110A (en) * 2014-02-18 2014-04-30 优视科技有限公司 Browser font displaying and processing method and device
CN105677646A (en) * 2014-11-17 2016-06-15 北京大学 Word stock generation method and system, and server

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362790A (en) * 2019-06-13 2019-10-22 北京三快在线科技有限公司 Processing method, device, electronic equipment and the readable storage medium storing program for executing of font file
CN110362790B (en) * 2019-06-13 2023-10-27 北京三快在线科技有限公司 Font file processing method and device, electronic equipment and readable storage medium
CN110705210A (en) * 2019-09-18 2020-01-17 北京中网易企秀科技有限公司 Chinese font loading method and device
CN111859853A (en) * 2020-08-04 2020-10-30 浪潮卓数大数据产业发展有限公司 Webpage text encryption and decryption method based on random font

Similar Documents

Publication Publication Date Title
CN102915308B (en) A kind of method of page rendering and device
CN107766328B (en) Text information extraction method of structured text, storage medium and server
KR102345005B1 (en) Patent document creating device, method, computer program, computer-readable recording medium, server and system
US20080243475A1 (en) Web content translation system, method, and software
CN105205080B (en) Redundant file method for cleaning, device and system
CN103761277A (en) ePub electronic book loading method and system
CN105094786A (en) Method and system for customizing page based on JavaScript
CN106502968A (en) The method and device of data processing
US20140013211A1 (en) Content providing apparatus compatible with various terminal devices
US8812551B2 (en) Client-side manipulation of tables
CN109976840A (en) The method and system of multilingual automatic adaptation are realized under a kind of separation platform based on front and back
KR101340588B1 (en) Method and apparatus for comprising webpage
WO2008132706A1 (en) A web browsing method and system
CN102915378B (en) In webpage, content show state changes method and apparatus
CN106575303B (en) Method and device for displaying webpage
CN106951405A (en) Data processing method and device based on typesetting engine
CN102063416B (en) Method and system for embedding double-byte fonts into PDF file
CN106775826B (en) Method and system for loading code file by annotation mode
CA2602749A1 (en) System and method of report representation
CN103257985A (en) Device and method for simultaneously searching, inserting and displaying multiple cross-domain databases
CN104899338A (en) Method for pushing APP in search promotion result, device and browser
CN109923538A (en) Text retrieval device, text searching method and computer program
TW561360B (en) Method and system for case conversion
CN110807298A (en) Method and system for processing marking information
CN105893335A (en) Method and device for displaying text

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170315

RJ01 Rejection of invention patent application after publication