Summary of the invention
The present invention is based on the above problems, proposes a kind of new technical solution, can generate according to the needs of users
The character library of low capacity removes the redundancy text largely taken less than, to optimize webpage loading velocity.
In view of this, the invention proposes a kind of character library generation methods, comprising: according to the setting command received or preset
Font info file, setting character library generate request data;Request data is generated according to the character library, determines original character library, and
Target character library is extracted in the original character library.
In the technical scheme, user can carry out online font setting according to demands of individuals, and setting option includes fontname
With webpage domain name, and the font info file of the user-specific is generated according to the fontname of setting and webpage domain name, these are default
Font info file be generally JS (JavaScirpt, literal translate formula scripting language) file.In addition, working as the fontname of user setting
When updating with webpage domain name, font info file also updates therewith.When user needs to obtain the character library simplified, Ke Yizhi
It connects the character libraries such as name and webpage domain name that set font and generates request data, preset font information text can also be read in systems
Part directly acquires the contents such as the fontname being arranged and webpage domain name, and generates request data according to the character library of setting, to correspondence
Original character library the operation such as be cut out or extract, to obtain target data, obtained target data adapts to user's needs
Simplify after character library.By the technical solution, the character library of low capacity can be generated according to the needs of users, removed largely with not
The redundancy text arrived promotes the usage experience of user to optimize webpage loading velocity.
In the above-mentioned technical solutions, it is preferable that the setting command or preset font info file that the basis receives,
Character library is set and generates request data, is specifically included: according to the setting command received, for the ID for issuing the setting command
Webpage domain name, fontname and text data are set, and duplicate removal is carried out to the text data, or believe according to the preset font
File is ceased, the webpage domain name, the fontname and the text data of the webpage are obtained when accessing webpage, and to institute
It states text data and carries out duplicate removal;And according to the text data after the webpage domain name, the fontname and duplicate removal, according to
Predetermined encryption rule generates encrypted characters string, and the type of the browser according to the webpage, determines the required target word
The type in library.
In the technical scheme, when user needs to obtain the character library simplified, can directly set font name, webpage domain name
And text data, preset font info file can also be read in systems, directly acquire the fontname being arranged, webpage domain
Name and text data.After obtaining fontname, webpage domain name and text data, deduplication operation further is carried out to text data,
To delete repeated data therein.
It in the technical scheme, can be with according to the text data after User ID, fontname, webpage domain name and duplicate removal
Encrypted characters string is generated, for example, when the entitled quiet flower bud of Founder of the font needed for user foundertest is simplified, according to the font
English name FZJLJW and webpage in the font duplicate removal after content of text " university, BeiJing, China ", encrypted characters can be generated
String 6ab591e473ce55fd05b0732b5aab6821.
In addition, in the technical scheme, required target character library can also be determined according to the type of the browser of webpage
Type, wherein the type of target character library includes TTF (True Type Font), EOT, WOFF (Web Open Font
Format, the open font format of webpage), SVG (Scalable Vector Graphics, scalable vector graphics) etc., for example,
When the webpage of unlatching is the webpage of IE browser, it can determine that the type of target character library is EOT.
In the above-mentioned technical solutions, it is preferable that the character library generate request data include the ID, it is domain name, described
The type of fontname, the encrypted characters string and the required target character library.
In the above-mentioned technical solutions, before preferably extracting the target character library in the original character library, further includes:
According to the preset font info file, determine that the character library generates whether request data meets predetermined verification rule;When true
When the fixed character library generation request data meets the predetermined verification rule, permission extracts the target in the original character library
Character library.
In the technical scheme, it before extracting target character library, needs to verify the permission for extracting target character library, than
Such as, judge that the ID of user whether there is in system, if the ID is not present, stop data processing, be not user generation
The character library simplified.For another example, judge whether system is stored with current domain name, if not stored current domain name in system,
Stop data processing, does not generate the character library simplified for the user.By the technical program, system is allowed only to be specific user
Or simplifying for character library can only be carried out according to specific data, and it can be to avoid illegal request, convenient for putting goods on the market, it can also be to avoid malice
Request, protects the safety of data.
In the above-mentioned technical solutions, it is preferable that it is described to extract target character library in the original character library, it specifically includes:
GLYPH (tag mark) font of the text data is determined in the original character library;Extract the institute of the text data
It states GLYPH font or deletes the GLYPH font other than the text data, to generate the target character library.
In the technical scheme, the GLYPH font in original character library can be cut out or is extracted, to generate capacity more
The small target character library more simplified, so that the redundancy text that removal largely takes less than promotes user to optimize webpage loading velocity
Usage experience.
In the above-mentioned technical solutions, it is preferable that further include: it is pressed according to the target character library of the type to generation
Contracting, to obtain the target character library of the required type.
In the technical scheme, target character library can be compressed into TTF (True Type Font), EOT, WOFF, SVG etc.
Type, by taking EOT type as an example, after the character library of the EOT type needed for generating the compression of target character library, the text of compressed character library
Part storage organization and name are identical as former target character library, and only file format is different.It, can be with by being compressed to target character library
The target character library for obtaining multiple format, to widen the scope of application of the character library after simplifying.
In the above-mentioned technical solutions, it is preferable that further include: store the font info file, the encrypted characters string and
The target character library, for calling when the encrypted characters string generated again is identical as the encrypted characters string of storage
The target character library corresponding with the encrypted characters string of storage, and by the content of the target character library with the shape of CSS code
The webpage is written in formula.
In the technical scheme, font info file, encrypted characters string and target character library etc. are stored, when again into
When row character library is simplified, if the encrypted characters string generated is identical as the encrypted characters string of storage, the correspondence of storage is called directly
The target character library of type, the generation work without carrying out target character library again optimize the speed of webpage load, greatly
It is big that the user experience is improved.
Another aspect of the present invention proposes a kind of character library generation system, comprising: setting unit, according to the setting received
Order or preset font info file, setting character library generate request data;Processing unit generates number of request according to the character library
According to determining original character library, and extract target character library in the original character library.
In the technical scheme, user can carry out online font setting according to demands of individuals, and setting option includes fontname
With webpage domain name, and the font info file of the user-specific is generated according to the fontname of setting and webpage domain name, these are default
Font info file be generally JS (JavaScirpt, literal translate formula scripting language) file.In addition, working as the fontname of user setting
When updating with webpage domain name, font info file also updates therewith.When user needs to obtain the character library simplified, Ke Yizhi
It connects the character libraries such as name and webpage domain name that set font and generates request data, preset font information text can also be read in systems
Part directly acquires the contents such as the fontname being arranged and webpage domain name, and generates request data according to the character library of setting, to correspondence
Original character library the operation such as be cut out or extract, to obtain target data, obtained target data adapts to user's needs
Simplify after character library.By the technical solution, the character library of low capacity can be generated according to the needs of users, removed largely with not
The redundancy text arrived promotes the usage experience of user to optimize webpage loading velocity.
In the above-mentioned technical solutions, it is preferable that the setting unit is used for: according to the setting command received, being
ID setting webpage domain name, fontname and the text data of the setting command are issued, and duplicate removal is carried out to the text data, or
According to the preset font info file, the webpage domain name of the webpage, the fontname are obtained when accessing webpage
With the text data, and to the text data carry out duplicate removal;And the setting unit further include: character string determines single
Member is generated according to predetermined encryption rule and is encrypted according to the text data after the webpage domain name, the fontname and duplicate removal
Character string;Type determining units determine the type of the required target character library according to the type of the browser of the webpage.
In the technical scheme, when user needs to obtain the character library simplified, can directly set font name, webpage domain name
And text data, preset font info file can also be read in systems, directly acquire the fontname being arranged, webpage domain
Name and text data.After obtaining fontname, webpage domain name and text data, deduplication operation further is carried out to text data,
To delete repeated data therein.
It in the technical scheme, can be with according to the text data after User ID, fontname, webpage domain name and duplicate removal
Encrypted characters string is generated, for example, when the entitled quiet flower bud of Founder of the font needed for user foundertest is simplified, according to the font
English name FZJLJW and webpage in the font duplicate removal after content of text " university, BeiJing, China ", encrypted characters can be generated
String 6ab591e473ce55fd05b0732b5aab6821.
In addition, in the technical scheme, required target character library can also be determined according to the type of the browser of webpage
Type, wherein the type of target character library includes TTF (True Type Font), EOT, WOFF, SVG etc., for example, when unlatching
When webpage is the webpage of IE browser, it can determine that the type of target character library is EOT.
In the above-mentioned technical solutions, it is preferable that the character library generate request data include the ID, it is domain name, described
The type of fontname, the encrypted characters string and the required target character library;And the character library generates system further include: really
Order member, it is described extract target character library in original character library before, according to the preset font info file, determine institute
It states character library and generates request data and whether meet predetermined verification rule, and when determining that the character library generates described in request data meets
When predetermined verification rule, the target character library is extracted in permission in the original character library.
In the technical scheme, it before extracting target character library, needs to verify the permission for extracting target character library, than
Such as, judge that the ID of user whether there is in system, if the ID is not present, stop data processing, be not user generation
The character library simplified.For another example, judge whether system is stored with current domain name, if not stored current domain name in system,
Stop data processing, does not generate the character library simplified for the user.By the technical program, system is allowed only to be specific user
Or simplifying for character library can only be carried out according to specific data, and it can be to avoid illegal request, convenient for putting goods on the market, it can also be to avoid malice
Request, protects the safety of data.
In the above-mentioned technical solutions, it is preferable that the processing unit is used for: the text is determined in the original character library
The GLYPH font of data, and extract the GLYPH font of the text data or delete the institute other than the text data
GLYPH font is stated, to generate the target character library.
In the technical scheme, the GLYPH font in original character library can be cut out or is extracted, to generate capacity more
The small target character library more simplified, so that the redundancy text that removal largely takes less than promotes user to optimize webpage loading velocity
Usage experience.
In the above-mentioned technical solutions, it is preferable that further include: compression unit, according to the type to the target of generation
Character library is compressed, to obtain the target character library of the required type.
In the technical scheme, target character library can be compressed into TTF (True Type Font), EOT, WOFF, SVG etc.
Type, by taking EOT type as an example, after the character library of the EOT type needed for generating the compression of target character library, the text of compressed character library
Part storage organization and name are identical as former target character library, and only file format is different.It, can be with by being compressed to target character library
The target character library for obtaining multiple format, to widen the scope of application of the character library after simplifying.
In the above-mentioned technical solutions, it is preferable that further include: storage unit stores the font info file, the encryption
Character string and the target character library, so that the encrypted characters string that ought be generated again is identical as the encrypted characters string of storage
When, the target character library corresponding with the encrypted characters string of storage is called, and by the content of the target character library with CSS generation
The webpage is written in the form of code.
In the technical scheme, font info file, encrypted characters string and target character library etc. are stored, when again into
When row character library is simplified, if the encrypted characters string generated is identical as the encrypted characters string of storage, the correspondence of storage is called directly
The target character library of type, the generation work without carrying out target character library again optimize the speed of webpage load, greatly
It is big that the user experience is improved.
Another aspect of the invention proposes a kind of server, includes that character library as described in the above technical scheme generates system
System.Therefore, the character library which there is above-mentioned technical proposal to provide generates whole beneficial effects of system, no longer superfluous herein
It states.
By above technical scheme, request data can be generated according to the character library of user setting, to corresponding original character library
The operation such as it is cut out or extracts, the character library of the low capacity after being simplified eliminates the redundancy text largely taken less than, thus
Webpage loading velocity is optimized, the usage experience of user is improved.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real
Applying mode, the present invention is further described in detail.It should be noted that in the absence of conflict, the implementation of the application
Feature in example and embodiment can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, still, the present invention may be used also
To be implemented using other than the one described here other modes, therefore, protection scope of the present invention is not by described below
Specific embodiment limitation.
Fig. 1 shows the flow chart of character library generation method according to an embodiment of the invention.
As shown in Figure 1, character library generation method according to an embodiment of the invention, comprising:
Step 102, according to the setting command or preset font info file received, character library is set and generates number of request
According to.
Step 104, request data is generated according to character library, determines original character library, and extract target word in original character library
Library.
In the technical scheme, user can carry out online font setting according to demands of individuals, and setting option includes fontname
With webpage domain name, and the font info file of the user-specific is generated according to the fontname of setting and webpage domain name, these are default
Font info file be generally JS (JavaScirpt, literal translate formula scripting language) file.In addition, working as the fontname of user setting
When updating with webpage domain name, font info file also updates therewith.When user needs to obtain the character library simplified, Ke Yizhi
It connects the character libraries such as name and webpage domain name that set font and generates request data, preset font information text can also be read in systems
Part directly acquires the contents such as the fontname being arranged and webpage domain name, and generates request data according to the character library of setting, to correspondence
Original character library the operation such as be cut out or extract, to obtain target data, obtained target data adapts to user's needs
Simplify after character library.By the technical solution, the character library of low capacity can be generated according to the needs of users, removed largely with not
The redundancy text arrived promotes the usage experience of user to optimize webpage loading velocity.
In the above-mentioned technical solutions, it is preferable that step 102 specifically includes: according to the setting command received, being set to issue
ID setting webpage domain name, fontname and the text data of order are set, and duplicate removal is carried out to text data, or according to preset font
Message file, webpage domain name, fontname and the text data of webpage are obtained when accessing webpage, and are gone to text data
Weight;And according to the text data after webpage domain name, fontname and duplicate removal, encrypted characters string is generated according to predetermined encryption rule,
And the type of the browser according to webpage, determine the type of required target character library.
In the technical scheme, when user needs to obtain the character library simplified, can directly set font name, webpage domain name
And text data, preset font info file can also be read in systems, directly acquire the fontname being arranged, webpage domain
Name and text data.After obtaining fontname, webpage domain name and text data, deduplication operation further is carried out to text data,
To delete repeated data therein.
It in the technical scheme, can be with according to the text data after User ID, fontname, webpage domain name and duplicate removal
Encrypted characters string is generated, for example, when the entitled quiet flower bud of Founder of the font needed for user foundertest is simplified, according to the font
English name FZJLJW and webpage in the font duplicate removal after content of text " university, BeiJing, China ", encrypted characters can be generated
String 6ab591e473ce55fd05b0732b5aab6821.
In addition, in the technical scheme, required target character library can also be determined according to the type of the browser of webpage
Type, wherein the type of target character library includes TTF (True Type Font), EOT, WOFF, SVG etc., for example, when unlatching
When webpage is the webpage of IE browser, it can determine that the type of target character library is EOT.
In the above-mentioned technical solutions, it is preferable that it includes ID, domain name, fontname, encrypted characters string that character library, which generates request data,
With the type of required target character library.
In the above-mentioned technical solutions, it is preferable that before step 104, further includes: according to preset font info file,
Determine that character library generates whether request data meets predetermined verification rule;Make a reservation for verification rule when determining that character library generation request data meets
When then, allow to extract target character library in original character library.
In the technical scheme, it before extracting target character library, needs to verify the permission for extracting target character library, than
Such as, judge that the ID of user whether there is in system, if the ID is not present, stop data processing, be not user generation
The character library simplified.For another example, judge whether system is stored with current domain name, if not stored current domain name in system,
Stop data processing, does not generate the character library simplified for the user.By the technical program, system is allowed only to be specific user
Or simplifying for character library can only be carried out according to specific data, and it can be to avoid illegal request, convenient for putting goods on the market, it can also be to avoid malice
Request, protects the safety of data.
In the above-mentioned technical solutions, it is preferable that step 104 specifically includes: text data is determined in original character library
GLYPH font;It extracts the GLYPH font of text data or deletes the GLYPH font other than text data, to generate target word
Library.
In the technical scheme, the GLYPH font in original character library can be cut out or is extracted, to generate capacity more
The small target character library more simplified, so that the redundancy text that removal largely takes less than promotes user to optimize webpage loading velocity
Usage experience.
In the above-mentioned technical solutions, it is preferable that further include: it is compressed according to target character library of the type to generation, to obtain
Take the target character library of required type.
In the technical scheme, target character library can be compressed into TTF (True Type Font), EOT, WOFF, SVG etc.
Type, by taking EOT type as an example, after the character library of the EOT type needed for generating the compression of target character library, the text of compressed character library
Part storage organization and name are identical as former target character library, and only file format is different.It, can be with by being compressed to target character library
The target character library for obtaining multiple format, to widen the scope of application of the character library after simplifying.
In the above-mentioned technical solutions, it is preferable that further include: storage font info file, encrypted characters string and target character library,
It is corresponding with the encrypted characters string of storage for calling when the encrypted characters string generated again is identical as the encrypted characters string of storage
Target character library, and webpage is written into the content of target character library in the form of CSS code.
In the technical scheme, font info file, encrypted characters string and target character library etc. are stored, when again into
When row character library is simplified, if the encrypted characters string generated is identical as the encrypted characters string of storage, the correspondence of storage is called directly
The target character library of type, the generation work without carrying out target character library again optimize the speed of webpage load, greatly
It is big that the user experience is improved.
Fig. 2 shows the block diagrams that character library according to an embodiment of the invention generates system.
As shown in Fig. 2, character library according to an embodiment of the invention generates system 200, comprising: setting unit 202, root
According to the setting command or preset font info file received, character library is set and generates request data;Processing unit 204, according to
Character library generates request data, determines original character library, and target character library is extracted in original character library.
In the technical scheme, user can carry out online font setting according to demands of individuals, and setting option includes fontname
With webpage domain name, and the font info file of the user-specific is generated according to the fontname of setting and webpage domain name, these are default
Font info file be generally JS (JavaScirpt, literal translate formula scripting language) file.In addition, working as the fontname of user setting
When updating with webpage domain name, font info file also updates therewith.When user needs to obtain the character library simplified, Ke Yizhi
It connects the character libraries such as name and webpage domain name that set font and generates request data, preset font information text can also be read in systems
Part directly acquires the contents such as the fontname being arranged and webpage domain name, and generates request data according to the character library of setting, to correspondence
Original character library the operation such as be cut out or extract, to obtain target data, obtained target data adapts to user's needs
Simplify after character library.By the technical solution, the character library of low capacity can be generated according to the needs of users, removed largely with not
The redundancy text arrived promotes the usage experience of user to optimize webpage loading velocity.
In the above-mentioned technical solutions, it is preferable that setting unit 202 is used for: according to the setting command received, being set to issue
ID setting webpage domain name, fontname and the text data of order are set, and duplicate removal is carried out to text data, or according to preset font
Message file, webpage domain name, fontname and the text data of webpage are obtained when accessing webpage, and are gone to text data
Weight;And setting unit 202 further include: character string determination unit 2022, according to the text after webpage domain name, fontname and duplicate removal
Data generate encrypted characters string according to predetermined encryption rule;Type determining units 2024, according to the type of the browser of webpage,
Determine the type of required target character library.
In the technical scheme, when user needs to obtain the character library simplified, can directly set font name, webpage domain name
And text data, preset font info file can also be read in systems, directly acquire the fontname being arranged, webpage domain
Name and text data.After obtaining fontname, webpage domain name and text data, deduplication operation further is carried out to text data,
To delete repeated data therein.
It in the technical scheme, can be with according to the text data after User ID, fontname, webpage domain name and duplicate removal
Encrypted characters string is generated, for example, when the entitled quiet flower bud of Founder of the font needed for user foundertest is simplified, according to the font
English name FZJLJW and webpage in the font duplicate removal after content of text " university, BeiJing, China ", encrypted characters can be generated
String 6ab591e473ce55fd05b0732b5aab6821.
In addition, in the technical scheme, required target character library can also be determined according to the type of the browser of webpage
Type, wherein the type of target character library includes TTF (True Type Font), EOT, WOFF, SVG etc., for example, when unlatching
When webpage is the webpage of IE browser, it can determine that the type of target character library is EOT.
In the above-mentioned technical solutions, it is preferable that it includes ID, domain name, fontname, encrypted characters string that character library, which generates request data,
With the type of required target character library;And character library generates system 200 further include: determination unit 206 is mentioned in original character library
Before taking out target character library, according to preset font info file, determine that character library generates whether request data meets predetermined verification
Rule, and when determining that character library generation request data meets predetermined verification rule, allow to extract target word in original character library
Library.
In the technical scheme, it before extracting target character library, needs to verify the permission for extracting target character library, than
Such as, judge that the ID of user whether there is in system, if the ID is not present, stop data processing, be not user generation
The character library simplified.For another example, judge whether system is stored with current domain name, if not stored current domain name in system,
Stop data processing, does not generate the character library simplified for the user.By the technical program, system is allowed only to be specific user
Or simplifying for character library can only be carried out according to specific data, and it can be to avoid illegal request, convenient for putting goods on the market, it can also be to avoid malice
Request, protects the safety of data.
In the above-mentioned technical solutions, it is preferable that processing unit 204 is used for: text data is determined in original character library
GLYPH font, and extract the GLYPH font of text data or delete the GLYPH font other than text data, to generate target
Character library.
In the technical scheme, the GLYPH font in original character library can be cut out or is extracted, to generate capacity more
The small target character library more simplified, so that the redundancy text that removal largely takes less than promotes user to optimize webpage loading velocity
Usage experience.
In the above-mentioned technical solutions, it is preferable that further include: compression unit 208, according to type to the target character library of generation into
Row compression, to obtain the target character library of required type.
In the technical scheme, target character library can be compressed into TTF (True Type Font), EOT, WOFF, SVG etc.
Type, by taking EOT type as an example, after the character library of the EOT type needed for generating the compression of target character library, the text of compressed character library
Part storage organization and name are identical as former target character library, and only file format is different.It, can be with by being compressed to target character library
The target character library for obtaining multiple format, to widen the scope of application of the character library after simplifying.
In the above-mentioned technical solutions, it is preferable that further include: storage unit 210 stores font info file, encrypted characters
String and target character library, for when the encrypted characters string generated again is identical as the encrypted characters string of storage, calling and storage
The corresponding target character library of encrypted characters string, and webpage is written into the content of target character library in the form of CSS code.
In the technical scheme, font info file, encrypted characters string and target character library etc. are stored, when again into
When row character library is simplified, if the encrypted characters string generated is identical as the encrypted characters string of storage, the correspondence of storage is called directly
The target character library of type, the generation work without carrying out target character library again optimize the speed of webpage load, greatly
It is big that the user experience is improved.
Fig. 3 shows the block diagram that character library according to another embodiment of the invention generates system.
As shown in figure 3, character library according to another embodiment of the invention generates system 300, comprising:
User setting module 302 can carry out online font according to the demands of individuals of user in user setting module 302
Setting, setting option therein include that setting result can be stored in character library and generated by fontname and webpage domain name after setting completed
In system 300, and according to the JS file of the data of setting generation user-specific, and JS file is saved to character library and generates system
In 300.
Request data obtains module 304, and a complete request data includes User ID, webpage domain name, font English name
With the content of text after duplicate removal, there are two types of the modes of acquisition request data: the customized mode of user and the automatic acquisition modes of system.
Request issues module 306, straight as long as getting complete request data when the customized mode of selection user
When connecing to server and issue the request, and send whole request datas, and selecting system to obtain automatically to ask mode, if got
A plurality of partial data then recycles sending request, and sends whole request datas.
Request processing module 308 comprising: small library submodule is simplified in data check submodule, judging submodule, extraction
Block cuts submodule, extracts submodule and compression submodule.In request processing module 308, first by data check submodule
Make requests the verification of data, if verification failure, abort request handle and returns failed message, if by verifying into
Enter judging submodule;Judging submodule, judges whether the request data has the right to be further processed and which should enter
Module is further processed;When the judgment result is yes, it extracts and simplifies small character library module by cutting submodule or extracting submodule
TTF character library is simplified to generate, compression submodule will simplify TTF character library and be converted to various online font formats, when judging result is
When no, failed message is returned to, and record failed message.
Returned data module 310, finally, character library, which generates system 300, all will write data into the page with CSS code form,
So, even if developer does not have knowledge relevant to the@font-face of CSS3, it is possible to use online font.
User data memory module 312, the user data of storage include the JS file of user-specific, user use it is all
That simplifies small library and various online font formats simplifies small library.
In the above-mentioned technical solutions, it is preferable that when the fontname of the setting option in user setting module 302 is presented to the user
For the Chinese of Chinese word library, and it is derived from the word-base data record that character library generates system 300;The domain name of setting option is to apply
The domain name of line font, and include URL (Uniform Resource Locator, uniform resource locator) protocol section, for example,
http://www.foundertype.com。
In the above-mentioned technical solutions, it is preferable that all setting data recorded in user setting module 302, fontname
It is all one-to-one relationship with domain name, that is to say, that a data is made of User ID, fontname and domain name, this three have
It is associated with uniqueness, so stores the subsequent expansion for generating system 300 convenient for character library, wherein the set-up mode of user can flexibly become
It is dynamic.
In the above-mentioned technical solutions, it is preferable that produce user-specific according to setting data in user setting module 302
JS file contains the setting of all processing logics and user of JS mode method of calling to corresponding online font in JS file
The content of data, JS file changes with the variation of user setting, and each user has exclusive JS file, answers all
System 300 is generated with character library to provide using the link of the same JS file in the webpage of online font service, therefore, using word
The additions and deletions of body are arranged, and need to only carry out in character library generation system 300, and character library generates system 300 and can automatically synchronize setting data
To the JS file of user-specific.
In the above-mentioned technical solutions, it is preferable that mode customized for user is generally actively issued by user and is requested, and
In addition to User ID, other data in request data are user according to the autonomous selection of request rule or customized submission.
In the above-mentioned technical solutions, it is preferable that acquisition modes automatic for system, request data all by system according to
Family is automatically obtained in the page setup that character library generates setting and user in system 300, and character library is generated system 300 and existed based on user
Character library generates the setting data in system 300, obtains webpage domain name, and online workable for filtering out user according to webpage domain name
Then font is matched to content of text corresponding with the online font in webpage, to text content duplicate removal, and by scheduled
Encryption rule generates encrypted characters string, and can also determine the online font format needed according to the browser type of webpage,
Such as TTF, EOT, WOFF, SVG.In addition, being produced a plurality of if character library generates system 300 and is matched to a plurality of online fonts
Request data.
In the above-mentioned technical solutions, it is preferable that acquisition modes automatic for system, character library generates system 300 can be according to asking
The processing module in processing module 308 is sought, difference is sent respectively and asks summed data, it is intended to reduce data traffic and improve processing speed
Degree.
In the above-mentioned technical solutions, it is preferable that data check submodule is mainly used for judging whether the data of each request accord with
Scheduled verification rule is closed, illegal request and malicious requests is avoided, guarantees data security.If examining failure, abort request
Failed message is handled and returned, enters judging submodule if verifying successfully.
In the above-mentioned technical solutions, it is preferable that whether judging submodule is for permission judgement and extract and simplify small library and sentence
It is disconnected.Permission judgement is generally basede on setting data and character library of the user in character library generation system 300 and generates having for the record of system 300
Imitate data, it is intended to guarantee user and system data safety.After being judged by permission, then it is made whether to extract and simplifies small library
Judgement can inquire the historical record for whether having this request data according to the encrypted characters string of request data first, if it is not,
A newly-increased record, and small character library module is simplified into extracting;If so, format needed for then judging simplifies whether small library is deposited
If it does, directly small library is simplified using this, if it does not exist, then simplifying small character library module into extracting.
In the above-mentioned technical solutions, it is preferable that extraction is simplified small character library module and can be selected original big according to required font
TTF character library, and required content of text is combined, big TTF character library is cut to small TTF character library.There are two types of the modes specifically cut,
First is that the extra font GLYPH data in big TTF character library are deleted, only to retain the font GLYPH data of needs, second is that
From big TTF character library, the font GLYPH data that user needs successively are extracted, are then generated with the font GLYPH data extracted small
TTF character library.After small TTF character library is extracted successfully, into compression submodule.
In the above-mentioned technical solutions, it is preferable that various online words needed for compression submodule can be converted to small TTF character library
The character library of physique formula, such as TTF, EOT, WOFF, SVG format.These formats are all compressed format, can be further reduced file
Amount, the data volume of the client of reduction server transport to webpage, to improve page access speed.
In the above-mentioned technical solutions, it is preferable that have the returned data there are two types of form in returned data module 310, it is a kind of
The data that webpage is directly written in CSS code by system 300 are generated for character library;Another kind is the chain for returning to the CSS file of user
Connect with font usage mode, when the webpage that user disposes as required is accessed, character library generates system 300 will be according to receiving
CSS requests to automatically generate corresponding CSS code, and CSS code is only effective in the accessed page.The return of both forms
Data do not require user to have the relevant knowledge of font-face in CSS3, facilitate User Exploitation work.
In the above-mentioned technical solutions, it is preferable that user data memory module 312 is stored with the JS file of user-specific, uses
All small libraries for simplifying small library, various online font formats that family uses.
In the above-mentioned technical solutions, it is preferable that the file of user-specific JS saves as in user data memory module 312
Physics save, bibliographic structure be system master catalog under Js/Users/ (User ID/1024)/(User ID %1024)/, file
Name be by comprising the contents such as user name obtained by special Encryption Algorithm, to strengthen the safety of user data,
Convenient for the service extension of subsequent file system.
In the above-mentioned technical solutions, it is preferable that in user data memory module 312 user using it is all simplify small library and
The small library of various online font formats saves as physics preservation, and bibliographic structure is the Font/data/ under system master catalog
Font ID/ (domain name ID/1024)/(domain name ID%1024)/, the entitled domain name for including of file, user name, fontname, in text
What appearance was obtained by special Encryption Algorithm, to reinforce the safety of user data.In addition, for identical content, different-format
The name for simplifying small library it is identical, consequently facilitating character library generate system 300 in carry out character library lookup, improve character library generate system
The working efficiency of system 300, convenient for the service extension of subsequent file system.
In the above-mentioned technical solutions, it is preferable that also there is cleaning modul, cleaning modul in user data memory module 312
It all simplify small library and its various online font format small libraries mainly for what user used and designs.This module is often preordained
Shi Jinhang cleaning work only saves the small library of simplifying being accessed in nearest 7 days in the current data table for simplifying small library
Information;Information not visited in nearest 7 days is all transferred to history lists, convenient for statistics later;And it is not visited in nearest 7 days
The data for simplifying small library of physical store will be deleted;If deleted data are accessed again, system will mention again
Required small library of simplifying is taken, does not influence the normal use of the setting data of user.By the technical solution, can only save must
The data information wanted, avoids space waste.
System 300 is generated to the character library shown in Fig. 3 combined with specific embodiments below to be described further.
The user foundertest that ID is 4 generates system in character library by user setting module 302 according to demands of individuals
The online font of setting is that upright quiet flower bud is simplified in 300, and the upright quiet simplified corresponding English name of flower bud is FZJLJW, and domain name is
Http:// xiezi.foundertype.com, after being arranged successfully, user data memory module 312 judges user
The setting data record of foundertest whether there is, if it does, existing prompt will be issued, be not repeated to save, if
It is not present, then saves the domain-name information of user setting, wherein domain name ID is 3.
Meanwhile the JS file of user-specific is generated according to setting data, bibliographic structure is Js/ under system master catalog
Users/ (User ID/1024)/(User ID %1024)/, filename be by comprising the contents such as user name by special plus
What close algorithm obtained, specifically, the storage organization of JS file and name are as follows: Js/Users/0/4/4f4adcbf8c6f66dc
fc8a3282ac2bf10a8f860346a02e832502628f7d87bf6ecb.js。
Next enter request data and obtain module 304, acquisition request data are divided into two ways: the customized mode of user
With the automatic acquisition modes of system.
The customized mode of user is that user voluntarily selects the online font set and corresponding domain name, and actively fills in text
This content, such as " university, BeiJing, China " are then forwarded to character library and generate system 300, and character library generates system 300 and receives necessity
By content of text duplicate removal after data, and add being generated after the encryption of the content of text after User ID, domain name, font English name and duplicate removal
Close character string 6ab591e473ce55fd05b0732b5aab6821, arrives this, and request data acquisition finishes.
Acquisition modes automatic for system, request data are all generated in system 300 according to user in character library by system
It is arranged and the page setup of user automatically obtains, when webpage is accessed, character library generates system 300 and obtains current domain name, root
The setting data in system 300 are generated in character library according to active user, judge whether active user has been arranged current domain name, if
It is not set, then stop to obtain, if be arranged, obtains all font informations that active user is arranged under one's name in the current field, and
The character font data of current page is obtained according to font information, to obtain corresponding content of text, to text content duplicate removal, most
Afterwards, it as the customized mode of user, will be generated after the content of text encryption after User ID, domain name, font English name and duplicate removal
Encrypted characters string.
Acquisition modes automatic for system, when domain name is http://xiezi.foundertype.com using online word
When the webpage of body is accessed, it is first determined active user foundertest judges whether this user is real user.When sentencing
Disconnected result is when being, to obtain current domain name, and judge that character library generates the record whether system 300 has current domain name.In addition, also wanting
Judge there be setting independent of domain name http://xiezi.foundertype.com in the setting data of user foundertest
It sets, when there is setting, determines that setting font for user under this domain name is simplified for upright quiet flower bud, corresponding English name is
FZJLJW, then, obtaining the simplified content of text of the quiet flower bud of Founder in the page is " university, BeiJing, China ", is gone to text content
Weight, and the content of text after User ID, domain name, font English name and duplicate removal is encrypted, to generate encrypted characters string 6ab591e4
73ce55fd05b0732b5aab6821.And the online font lattice needed can also be determined according to the browser type of webpage
Formula, such as TTF, EOT, WOFF, SVG.By taking EOT type as an example, the character library of the EOT type needed for generating the compression of target character library
Afterwards, the file storage structure of compressed character library and name are identical as former target character library, and only file format is different.
Acquisition modes automatic for system, the related data of a plurality of online fonts in available same webpage, then for
These request datas generate system 300 to character library one by one and issue request.
Mode customized for user directly issues request simultaneously to server as long as getting complete request data
Send whole request datas;Circulation is issued and is asked if getting a plurality of partial data by acquisition modes automatic for system
It asks and sends whole request datas.
Acquisition modes automatic for system only transmit necessary data to reduce data transmission, to avoid flow waste, add
Fast page access speed.
In the above-mentioned technical solutions, a complete request data, i.e., the user for being 4 for ID are only got
Foundertest, online font are that upright quiet flower bud is simplified, and corresponding English name is FZJLJW, the entitled http of application domain: //
Xiezi.foundertype.com, content of text are " university, BeiJing, China ", and encrypted characters string is 6ab591e473ce55fd0
5b0732b5aab6821, the type for simplifying small library of required online font are EOT.
Fig. 4 shows the specific flow chart that the processing character library in the character library generation system of Fig. 3 generates request data.
As shown in figure 4, the detailed process that processing character library generates request data includes:
Step 402, data check.By data check submodule, it is to user foundertest, online font font
Upright quiet flower bud is simplified, using domain name http://xiezi.foundertype.com, encrypted characters string 6ab591e473ce55fd
05b0732b5aab6821, required online font the type EOT for simplifying small library verified, if all data all meet
Verification rule, then be proved to be successful, and otherwise, authentication failed enters step 412, stops data processing.
Step 404, permission judges.Permission judging submodule, which judges that user generates in system 300 in character library, whether there is, such as
Fruit user is not present, and enters step 412, stops data processing, if user exists, then judges that character library generates in system 300 and is
The no record for having current domain name stops data processing if not provided, entering step 412, if so, it is current then to continue judgement
Whether user has been arranged current domain name and current font.If not set, 412 are entered step, stops data processing, if
It has been be arranged that, then enter step 406.
For example, ID is 4 user foundertest presence, domain name http://xiezi.foundertype.com is in character library
There is record in generation system 300, and it is that upright quiet flower bud is simplified that user, which is already provided at line font in user setting module 302, side
The just quiet simplified corresponding English name of flower bud be FZJLJW, with application domain name http://xiezi.foundertype.com it is corresponding at
Function, therefore judge that the request data has the right to carry out character library to simplify, enter step 406.
Step 406, record and file judgement.Character library is searched according to encrypted characters string to generate in system 300 with the presence or absence of note
Record, if it does not exist, then being directly entered step 408;If it is present continuing to judge required to simplify whether small character library file is deposited
If simplifying the presence of small character library file, returned data module 310 will be directed into, calling is already present to simplify small character library text
Otherwise part enters step 408.
In the simplified example of the upright quiet flower bud of above-mentioned user setting, because being to request for the first time, encrypted characters string 6a
B591e473ce55fd05b0732b5aab6821 character library generate system 300 in there is no record, illustrate it is corresponding simplify it is small
Font file is also centainly not present, and character library, which generates system 300, to add the record of this request character string, and is directly entered extraction essence
Simple small library submodule.
Step 408, it extracts and simplifies small library.The user setting Record ID found by permission judging submodule is saved,
Character library generates clear original word library storing directory in system 300, can quickly navigate to upright quiet flower bud letter according to upright quiet flower bud is simplified
" university, BeiJing, China " is then converted to specific UNICODE (Unicode) coding " 4E2D/ by the original big TTF character library of body
56FD/5317/4EAC/5927/5B66 " obtains the font GLYPH data information of these words in original big TTF character library, and
These GLYPH font datas needed are extracted, or delete other unnecessary font datas, in conjunction with the font configuration in TTF
Table is reorganized into one and new simplifies small TTF character library.Since filename is led to by domain name, user name, fontname, content of text
It crosses special Encryption Algorithm to obtain, so simplifying the storage organization of small TTF font file and naming as follows: Font/data/8/0/
3/6ab591e473ce55fd05b0732b5aab68211408435106028.ttf。
Step 410, small library is simplified in compression.EOT class by taking EOT type as an example, needed for generating the compression of target character library
After the character library of type, the file storage structure of compressed character library and name are identical as former target character library, and only file format is different.
Such as: Font/data/8/0/3/6ab591e473ce55fd05b0732b5aab682114084351 06028.eot.In addition,
When compressing failure, 412 are entered step, stops data processing.
It is required simplify small character library file be ready for it is ready after, as long as webpage is accessed, then returned data module
310 will simplify small character library file accordingly according to encrypted characters string and required online font character library format acquisition, and generate
Available CSS code, by the accessed webpage of code write-in, to realize the effect of online font, wherein CSS code is as follows:
<style type='text/css'>
@font-face{
font-family:'FZJLJW';
src:url('***);
Src:url (' * * *? #iefix') format (' embedded-opentype'),
url('***')format('TrueType')
}
</style>
Chained address and the parameter of small character bank interface are simplified in the return that wherein * * * represents returned data module 310, are simplified small
Character library interface directly feeds back the font file for simplifying small library according to parameter.
When webpage is accessed, character library, which generates system 300, can accurately judge to access the browser type of this webpage, return
Returning the CSS code that data module 310 returns will be returned according to browser type, when browser type is IE, the CSS of write-in
Code should are as follows:
<style type=" text/css ">
@font-face{
font-family:FZJLJWJ;
src:url('http://xiezi.foundertype.com/Webfont/Ashx/forjs/
Getfont.ashx? act=getfont&cvfid=6ab591e473ce55fd05b0732b5aab6821&forma t=
eot');
src:url('http://xiezi.foundertype.com/Webfont/Ashx/forjs/
Getfont.ashx? act=getfont&cvfid=6ab591e473ce55fd05b0732b5aab6821&forma t=
Eot? #iefix') format (' embedded-opentype')
.FZJLJWJ{FONT-FAMILY:'FZJLJWJ'}
</style>
Wherein, the IE browser of the compatible each version of CSS code of the page is written.
According to browser type, the online font of TTF format is requested, then the CSS generation of the page is written in returned data module 310
Code are as follows:
<style type=" text/css ">
@font-face{
font-family:FZJLJWJ;
src:url('http://xiezi.foundertype.com/Webfont/Ashx/forjs/
Getfont.ashx? act=getfont&cvfid=6ab591e473ce55fd05b0732b5aab6821&forma t=
ttf')
format('truetype');
}
.FZJLJWJ{FONT-FAMILY:'FZJLJWJ'}
</style>
Code, which is presented, in returned data module 310 in this manner can establish door chain, and be returned according to the needs of browser
Return be suitble to simplify small library type, can be further reduced the wasting of resources, promote webpage and be loaded into speed, also, do not require
User has the relevant knowledge of@font-face in CSS3, facilitates User Exploitation work.
Fig. 5 shows the block diagram of server according to an embodiment of the invention.
As shown in figure 5, the server 500 of one embodiment of the present of invention, including character library generate system 502 and (are equivalent to Fig. 2
Character library in the embodiment shown generates system 200), character library generates system 502 and is used for the setting command or pre- that basis receives
If font info file, setting character library generate request data, and according to character library generate request data, determine original character library, and
Target character library is extracted in original character library.
In the technical scheme, user can carry out online font setting according to demands of individuals, and setting option includes fontname
With webpage domain name, and the font info file of the user-specific is generated according to the fontname of setting and webpage domain name, these are default
Font info file be generally JS (JavaScirpt, literal translate formula scripting language) file.In addition, working as the fontname of user setting
When updating with webpage domain name, font info file also updates therewith.When user needs to obtain the character library simplified, Ke Yizhi
It connects the character libraries such as name and webpage domain name that set font and generates request data, can also be read in character library generation system 502 preset
Font info file directly acquires the contents such as the fontname being arranged and webpage domain name, and is generated and requested according to the character library of setting
Data the operation such as are cut out or extract to corresponding original character library, to obtain target data, obtained target data is fitted
Using family need simplify after character library.By the technical solution, the character library of low capacity can be generated according to the needs of users, is gone
Except the redundancy text largely taken less than, to optimize webpage loading velocity, the usage experience of user is promoted.
In the above-mentioned technical solutions, it is preferable that character library generates system 502 and is used for: according to the setting command received, for hair
ID setting webpage domain name, fontname and the text data of setting command out, and duplicate removal is carried out to text data, or according to preset
Font info file obtains webpage domain name, fontname and the text data of webpage when accessing webpage, and carries out to text data
Duplicate removal;And according to the text data after webpage domain name, fontname and duplicate removal, encrypted characters are generated according to predetermined encryption rule
String, and the type of the browser according to webpage, determine the type of required target character library.
In the technical scheme, when user needs to obtain the character library simplified, can directly set font name, webpage domain name
And text data, it can also be generated in system 502 in character library and read preset font info file, directly acquire the word being arranged
Body name, webpage domain name and text data.After obtaining fontname, webpage domain name and text data, further to text data into
Row deduplication operation, to delete repeated data therein.
It in the technical scheme, can be with according to the text data after User ID, fontname, webpage domain name and duplicate removal
Encrypted characters string is generated, for example, when the entitled quiet flower bud of Founder of the font needed for user foundertest is simplified, according to the font
English name FZJLJW and webpage in the font duplicate removal after content of text " university, BeiJing, China ", encrypted characters can be generated
String 6ab591e473ce55fd05b0732b5aab6821.
In addition, in the technical scheme, required target character library can also be determined according to the type of the browser of webpage
Type, wherein the type of target character library includes TTF (True Type Font), EOT, WOFF, SVG etc., for example, when unlatching
When webpage is the webpage of IE browser, it can determine that the type of target character library is EOT.
In the above-mentioned technical solutions, it is preferable that it includes ID, domain name, fontname, encrypted characters string that character library, which generates request data,
With the type of required target character library.
In the above-mentioned technical solutions, it is preferable that character library generates system 502 and is also used to according to preset font info file,
Determine that character library generates whether request data meets predetermined verification rule;Make a reservation for verification rule when determining that character library generation request data meets
When then, allow to extract target character library in original character library.
In the technical scheme, it before extracting target character library, needs to verify the permission for extracting target character library, than
Such as, judging that the ID of user is generated in system 502 in character library whether there is, if the ID is not present, stop data processing, not for
The user generates the character library simplified.For another example, judge that character library generates whether system 502 is stored with current domain name, if character library
Not stored current domain name, then stop data processing in generation system 502, does not generate the character library simplified for the user.Pass through this
Technical solution allows character library to generate system 502 as specific user or can only carry out simplifying for character library according to specific data,
The safety of data can also be protected to avoid malicious requests to avoid illegal request, convenient for putting goods on the market.
In the above-mentioned technical solutions, it is preferable that character library generates system 502 and is also used to determine text data in original character library
GLYPH font;It extracts the GLYPH font of text data or deletes the GLYPH font other than text data, to generate target
Character library.
In the technical scheme, the GLYPH font in original character library can be cut out or is extracted, to generate capacity more
The small target character library more simplified, so that the redundancy text that removal largely takes less than promotes user to optimize webpage loading velocity
Usage experience.
In the above-mentioned technical solutions, it is preferable that character library generates system 502 and is also used to the target character library according to type to generation
It is compressed, to obtain the target character library of required type.
In the technical scheme, target character library can be compressed into TTF (True Type Font), EOT, WOFF, SVG etc.
Type, by taking EOT type as an example, after the character library of the EOT type needed for generating the compression of target character library, the text of compressed character library
Part storage organization and name are identical as former target character library, and only file format is different.It, can be with by being compressed to target character library
The target character library for obtaining multiple format, to widen the scope of application of the character library after simplifying.
In the above-mentioned technical solutions, it is preferable that character library generates system 502 and is also used to store font info file, encrypted word
Symbol string and target character library, for when the encrypted characters string generated again is identical as the encrypted characters string of storage, calling and storage
The corresponding target character library of encrypted characters string, and webpage is written into the content of target character library in the form of CSS code.
In the technical scheme, font info file, encrypted characters string and target character library etc. are stored, when again into
When row character library is simplified, if the encrypted characters string generated is identical as the encrypted characters string of storage, the correspondence of storage is called directly
The target character library of type, the generation work without carrying out target character library again optimize the speed of webpage load, greatly
It is big that the user experience is improved.
The technical scheme of the present invention has been explained in detail above with reference to the attached drawings, according to the technical solution of the present invention, can basis
The character library of user setting generates request data, corresponding original character library is cut out or is extracted etc. operates, after being simplified
The character library of low capacity eliminates the redundancy text largely taken less than, to optimize webpage loading velocity, improves making for user
With experience.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.