WO2013097812A1 - 一种下载字库文件的方法和系统 - Google Patents

一种下载字库文件的方法和系统 Download PDF

Info

Publication number
WO2013097812A1
WO2013097812A1 PCT/CN2012/088054 CN2012088054W WO2013097812A1 WO 2013097812 A1 WO2013097812 A1 WO 2013097812A1 CN 2012088054 W CN2012088054 W CN 2012088054W WO 2013097812 A1 WO2013097812 A1 WO 2013097812A1
Authority
WO
WIPO (PCT)
Prior art keywords
font
file
sub
capacity
data
Prior art date
Application number
PCT/CN2012/088054
Other languages
English (en)
French (fr)
Inventor
高玉军
刘昉
Original Assignee
北大方正集团有限公司
北京北大方正电子有限公司
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 北大方正集团有限公司, 北京北大方正电子有限公司 filed Critical 北大方正集团有限公司
Priority to JP2014521938A priority Critical patent/JP5753946B2/ja
Priority to US14/130,664 priority patent/US20140164574A1/en
Priority to KR1020147004150A priority patent/KR101568947B1/ko
Publication of WO2013097812A1 publication Critical patent/WO2013097812A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and system for downloading a font file. Background technique
  • Gateway restricts the capacity of wirelessly transmitted files to prevent a user equipment from occupying network bandwidth resources for a long time, so that limited bandwidth resources can provide services for as many user equipment as possible, such as WAP (Wireless Application Protocol, wireless).
  • Application Protocol A gateway that intercepts files whose capacity exceeds the gateway limit.
  • the font library is a collection of electronic font fonts for foreign fonts, Chinese fonts, and related characters. It is widely used in computers, networks, and related electronic devices (such as mobile phones, tablets, etc.). Users can use user devices to download from a file server through a WAP gateway.
  • the font file is installed and used, but the font file is generally large. Because the WAP gateway limits the capacity of the wirelessly transmitted file, if the capacity of the font file exceeds the limit of the WAP gateway, the WAP gateway intercepts the font file. , causing the user device to obtain the required font file from the file server through the WAP gateway.
  • the present invention provides a method and system for downloading a font file, which is used to solve the problem in the prior art that when the capacity of a font file that the user needs to download exceeds the limit of the gateway corresponding to the user, the user cannot be from the file server.
  • the problem of downloading the required font file is used to solve the problem in the prior art that when the capacity of a font file that the user needs to download exceeds the limit of the gateway corresponding to the user, the user cannot be from the file server. The problem of downloading the required font file.
  • the present invention provides a method for downloading a font file, including: performing a segmentation process on the font file to obtain a plurality of sub-word library files having a capacity not greater than the transmission limit threshold; and transmitting all of the foregoing to the user equipment Sub-word library file.
  • the segmentation processing of the font file comprises:
  • font rim data is sliced, Font file
  • the data other than the font outline data in the font file is subjected to segmentation processing to obtain a plurality of partial descriptive contours.
  • the segmentation processing of the font file comprises:
  • the font contour data is subjected to a segmentation process to obtain a plurality of the sub-type contour data. Font file
  • the method for downloading a font file further includes:
  • the user device downloads all sub-font files
  • the user equipment processes all of the sub-word library files to obtain a font file that can be used.
  • the processing, by the user equipment, the processing of all the sub-word library files comprises: combining a sub-word library file including partial font contour data with all sub-word library files including data other than the font contour data, and obtaining The font file used; or a sub-font file containing partial font outline data, which is combined with all sub-font files containing data other than the font outline data to obtain a font file that can be used. .
  • the processing, by the user equipment, all the sub-word library files includes:
  • each of the downloaded sub-font files is used as a usable font file.
  • the present invention provides a system for downloading font files, including:
  • a server configured to perform a segmentation process on the font file when the capacity of the font file to be downloaded by the user equipment is greater than a transmission limit of the gateway corresponding to the user equipment, to obtain that the multiple capacity is not greater than the transmission limit threshold a sub-word library file; and transmitting all of the sub-word library files to the user equipment;
  • the user equipment is further configured to send a download request to the server through its corresponding gateway to obtain the required Font file;
  • the server is further configured to: after receiving the download request sent by the user equipment, determine a gateway corresponding to the user equipment according to the identifier information of the user equipment, thereby determining a transmission limit threshold corresponding to the gateway; and downloading the request according to the user equipment Determining the font file to be downloaded, and determining whether the font file needs to be segmented according to the relationship between the capacity of the font file and the transmission limit threshold.
  • the identification information of the user equipment includes at least one of an international mobile equipment identifier, an international mobile subscriber identity, a mobile station number, and a customer identification module.
  • the server includes: a transmission limit threshold, and performing a segmentation process on the font file to obtain a plurality of sub-word files having a capacity not greater than the transmission limit threshold;
  • a sending module configured to send all of the sub-word library files to the user equipment.
  • the segmentation processing module is specifically configured to:
  • the segmentation processing module is further configured to determine the number of the sub-word library files according to the segmentation unit; and establish a plurality of empty files, the number of the empty files being the same as the number of the sub-word library files; The value of the segmentation unit sequentially copies the data in the font file and respectively respectively in the plurality of empty files to obtain a plurality of sub-word library files whose capacity is not greater than the transmission limit threshold.
  • the segmentation processing module is further configured to sequentially segment the data in the font file according to the value of the segmentation unit to obtain a plurality of sub-word library files having a capacity not greater than the transmission limit alarm value.
  • the font file is not retained.
  • the segmentation processing module is further configured to determine a naming rule of the sub-word library file
  • the sending module is further configured to send a naming rule of the sub-word library file to the user equipment; the naming rule of the sub-character file determines the order of all the sub-word files, and appends the next sub-word file one by one according to the sorting to The end of the file of the previous sub-font file, to complete the merging process of all sub-font files, so as to get a font file that can be used.
  • the segmentation processing module is further configured to determine a naming rule of the sub-word library file; and an index file that is used to create the font file to be downloaded, where the index file includes a capacity of the font file, the segmentation unit, and The naming rules of the sub-word library file;
  • the sending module is further configured to send the index file to the user equipment
  • the user equipment is further configured to: after downloading all the sub-word library files and the index file, determine, according to the index file, a file name of each sub-word library file that needs to be downloaded, and establish a corresponding empty file to sequentially download and download from the sending module.
  • the offset of each sub-library file is recorded from zero in real time to record the download offset of the currently downloaded sub-library file, so as to facilitate the download of the sub-library file.
  • the merge process is performed to obtain a font file that can be used.
  • the user equipment is further configured to:
  • the total capacity of the sub-library files that have been downloaded is obtained first. Then, the sub-library file that needs to continue to be downloaded is sent to the server to send a request for re-download, thereby implementing a resume of the breakpoint.
  • the user equipment is further configured to:
  • the pointer offset is performed on the corresponding sub-word library file in the server, and the specific offset is the capacity value of the sub-word library file that the user equipment has downloaded.
  • the remaining capacity value of the sub-word library file to be downloaded is the difference between the actual capacity of the corresponding sub-word library file in the server and the capacity of the sub-word library file that has been downloaded locally.
  • the segmentation processing module is specifically configured to:
  • the font file is subjected to segmentation processing to obtain a sub-word library file containing data other than the sub-word library of the font outline data in the font file.
  • the segmentation processing module is further configured to: when the font file is segmented to form a sub-word library file including partial font contour data in the font file, corresponding to each font contour data International character encoding, ID serial number or national standard segmentation of the font outline data in the font file, and establishing a segmentation rule;
  • the sending module is further configured to send the segmentation rule to the user equipment
  • the user equipment is further configured to perform a merge process on all the sub-word files according to the segmentation rule after downloading all the sub-word files to obtain a font file that can be used.
  • the user equipment includes:
  • a processing module is configured to process all of the sub-word library files to obtain a font file that can be used.
  • the processing module is specifically configured to: If the sub-font file containing part of the font outline data does not contain data other than the font outline data, the sub-word library files are merged to obtain a font file that can be used; or
  • the sub-word library file is combined with all sub-word library files containing data other than the font outline data to obtain a font library file that can be used;
  • each of the downloaded sub-font files is used as a usable font file.
  • the server further includes:
  • a judging module configured to determine whether a capacity of the font file that the user equipment needs to download is greater than a transmission limit threshold of the gateway corresponding to the user equipment, and when the capacity of the font file is greater than the transmission limit threshold, triggering the split processing module to work; When the capacity of the font file is not greater than the transmission limit threshold, the trigger sending module directly sends the font file to the user equipment.
  • the server further includes a compression processing module,
  • the compression processing module is configured to: when the determining module determines that the capacity of the font file is greater than the transmission limit threshold, and compresses the font file before the determining module triggers the operation of the segmentation processing module, and compresses After the processing, the determining module is triggered again; the transmission limit threshold is greater than the gateway corresponding to the user equipment, and when the capacity of the compressed font file is greater than the transmission limit threshold, the splitting processing module is triggered to work; after the compression When the capacity of the font file is not greater than the transmission limit threshold, the trigger sending module directly sends the compressed font file to the user equipment;
  • the user equipment is further configured to: after downloading all the sub-character files, process the all sub-character files to obtain a compressed font file that can be used; the user equipment includes a decompression processing module, where The compressed font file is decompressed to obtain a font file that can be used.
  • the font file is divided and processed to obtain a plurality of sub-word library files whose capacity is not greater than the transmission limit threshold, so that the user equipment downloads each sub-word library file and processes it when downloading, thereby obtaining a font file that can be used, thereby avoiding the font library.
  • the capacity of the file exceeds the limit of the gateway corresponding to the user, the user cannot download the required font file from the file server.
  • 1 is a schematic structural diagram of a system for downloading a font file according to an embodiment of the present invention
  • 2 is a schematic structural diagram of a first server according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a second server according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for downloading a font file according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a first user equipment according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a second type of user equipment according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a method for downloading a font file according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a system for downloading a font file according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of a third method for downloading a font file according to an embodiment of the present invention. detailed description
  • the embodiment of the present invention performs segmentation processing on the font file to obtain a plurality of sub-word library files whose capacity is not greater than the transmission limit threshold, so that the user equipment At the time of download, each sub-font file is downloaded and processed to obtain a font file that can be used, thereby downloading the required font file from the file server.
  • an embodiment of the present invention provides a system for downloading a font file, including:
  • the server 10 is configured to perform a segmentation process on the font file when the capacity of the font file that the user equipment 20 needs to download is greater than a transmission limit threshold of the gateway corresponding to the user equipment, to obtain a plurality of sub-word files having a capacity not greater than a transmission limit threshold. And sending all sub-font files to the user device 20;
  • the user equipment 20 is configured to download all the sub-word library files; and process all the sub-word library files to obtain a font file that can be used.
  • the user equipment 20 of the embodiment of the present invention may be an embedded electronic device such as a mobile phone or a tablet computer; the user equipment 20 sends a download request to the server 10 through its corresponding WAP gateway as needed to obtain a required font file and is used for installation and use.
  • the WAP gateway is used to connect to the wireless network and the Internet, and can realize the conversion of the wireless application protocol WAP stack and the content format conversion (such as the wireless markup language WML to the hypertext markup language (HTML));
  • the font size of the Chinese character library file in the font file is generally large, and the data capacity of some Chinese large font files can even reach several hundred megabytes, and the gateway generally limits the capacity of files transmitted wirelessly through it. Prevent a user equipment from occupying network bandwidth resources for a long time.
  • the server 0 After receiving the download request sent by the user equipment 20, the server 0 is based on the identification information of the user equipment 20, such as International Mobile Device Identification (IMEI), International MoFile SuFscriFer Identity (IMSI, International Subscriber International ISDN/PSTN number), SIM card (Subscriber Identity)
  • IMEI International Mobile Device Identification
  • IMSI International MoFile SuFscriFer Identity
  • SIM card Subscriber Identity
  • the module, the customer identification module, and the like can determine the characteristic parameter of the gateway corresponding to the user equipment, determine the WAP gateway corresponding to the user equipment 20, and determine the transmission restriction threshold corresponding to the WAP gateway; and determine that the download is required according to the download request sent by the user equipment 20.
  • the font file; the server that stores the font file and the server that processes the font file that needs to be downloaded may be the same server, or two servers that are independent of each other and can interact;
  • the server 10 After determining the font file to be downloaded and the transmission limit threshold of the gateway corresponding to the user equipment 10, the server 10 determines whether the capacity of the font file is greater than the transmission limit threshold;
  • the font file is first segmented to obtain a plurality of sub-word files whose capacity is not greater than the transmission limit threshold, and then each sub-word file is sent to the user equipment 20; correspondingly, the user equipment 20 is from the gateway through the gateway.
  • the server 10 completes the downloading of all the sub-library files, all the sub-library files are processed according to different manners of the server 10 to obtain a font file that can be used, so that the font file can be used on the user device 20;
  • the font file is directly sent to the user device 20; correspondingly, after the user device 20 completes the download of the font file from the server 10 through the gateway, the font file can be used on the user device 20.
  • the server of the embodiment of the present invention After receiving the download request sent by the user equipment, the server of the embodiment of the present invention first determines the gateway corresponding to the user equipment according to the identifier information of the user equipment, and further determines a transmission limit threshold corresponding to the gateway, and determines a required download according to the download request.
  • the font file and according to the relationship between the capacity of the font file and the transmission limit threshold, whether the font file needs to be segmented, and only the font file is segmented when the capacity of the font file is greater than the transmission limit threshold, and does not need to be All the font files stored by the server are segmented, which saves storage space and improves service conditions.
  • the gateways corresponding to user devices that need to download font files from the server may be different, and the transmission limit thresholds of each gateway may be different.
  • the server in the embodiment of the present invention determines whether to perform the segmentation processing on the font file according to the transmission restriction threshold of the gateway corresponding to each user equipment in real time, thereby improving the working efficiency of
  • the server 10 of the embodiment of the present invention includes:
  • the segmentation processing module 100 is configured to perform segmentation processing on the font file when the capacity of the font file that the user equipment 20 needs to download is greater than the transmission limit threshold of the gateway corresponding to the user equipment 20, and obtain that the plurality of capacities are not greater than the transmission limit threshold.
  • Sub-word library file
  • the sending module 101 is configured to send all the sub-word files to the user equipment 20.
  • the segmentation processing module 100 of the trigger server 10 When the capacity of the font file to be downloaded by the user equipment 20 is greater than the transmission limit threshold of the gateway corresponding to the user equipment 20, the segmentation processing module 100 of the trigger server 10 performs segmentation processing on the font file, and the specific segmentation processing package Including the following two ways:
  • the gateway corresponding to the user equipment 20 is used as an example for the China Mobile's cmwap gateway.
  • the cmwap gateway is usually limited to a capacity of 1 M: (1024* 1024 bytes) for each file to be downloaded, that is, the cmwap gateway.
  • the transmission limit threshold is 1 M - when the capacity of the file to be downloaded is greater than 1 M, the cmwap gateway usually blocks the download, thereby causing the user device 20 to download the file from the server 10; assuming that the user device 20 needs to be from the server 10 Downloading the font file, i setting the font file named F, the segmentation processing module 100 determines the segmentation unit of the font file according to the transmission limit threshold (where the segmentation unit is not greater than the transmission limit threshold) and determining the naming rules of the sub-word library file (eg, The sub-word library files are named as Fi, F 2 ... ...
  • the split unit refers to the capacity of the sub-word library file processed by a single split, thereby determining the number of sub-word library files
  • the capacity of the last sub-library file after segmentation may be less than the value of the split unit, except for the last sub-library file. Capacity is equal to the segmentation unit
  • the font file is divided into nine sub-word files according to the capacity and the unit of the font file.
  • the segmentation processing module 100 can Re-establish nine empty files, then the first byte of the ⁇ font file starts to copy 819200 bytes and put it in the first empty file, as the first sub-font file F 1 ; copy 819200 from the 819201 bytes Byte to the second empty file, as the second sub-font file F 2 , and so on; the splitting method retains the original font file, so that the server 10 can send the font file or the sub-word library file to the user device 20 as needed.
  • the incremental segmentation can be directly performed from the original font file as needed, without retaining the original font file, thereby saving the storage space of the server 10.
  • the user equipment 20 can determine the order of the sub-word library files according to the naming rules of the sub-word library files, and the nine sub-word library files F wide F 9 according to the serial number
  • the latter sub-word library file is added one by one to the end of the file of the previous sub-word library file, that is, the sub-word library file F 2 is appended to the end of the sub-library file, and the sub-word library file F 3 is appended to the end of the sub-library file F 2 .
  • the merging process of all the sub-font files is completed, thereby obtaining a font file F containing all the font outline data and being usable.
  • the font outline data is the core part, and its capacity is the largest in the font file.
  • the capacity of the font curve outline data glyf occupies the TTF font file. 90%, this method includes the following four situations:
  • the first case if the capacity of the font outline data in the font file is not greater than the transmission limit threshold, and the font file If the capacity of the data other than the font outline data is not greater than the transmission limit threshold, then the segmentation processing of the font file includes the following two methods:
  • Method A The font outline data is used as a sub-font file, and the data other than the font outline data is used as another sub-font file;
  • the user device 20 after receiving all the sub-character files after the segmentation, merges the sub-character files to obtain a font file that can be used and includes all the font profile data;
  • the TTF font file includes 23 tables, such as head (font header), cmap (character code to primitive mapping), glyf (font curve outline metadata). , maxp (maximum demand table), mmtx (horizontal specification), loca (location table index), name (naming table), hmtx (horizontal layout), kerm (kerning table), post PostScript information, etc.;
  • the outline map metadata glyf occupies 90% of the TTF font file;
  • the font outline data corresponding to the glyf table is used as the sub-word library file F t , and the data corresponding to the other tables except the glyf table is used as the sub-word library file F 2 ;
  • Method B performing segmentation processing on the font outline data to obtain a plurality of sub-word library files including partial font contour data; for any one of the sub-word library files, all data except the font outline data in the font file is set In the sub-word library file, wherein the capacity of the sub-word library file is not greater than a transmission limit threshold;
  • the segmentation processing module 100 divides the font outline data into sub-word library files ⁇ ⁇ ⁇ ⁇ ⁇ 1 ⁇ , where ⁇ is a positive integer, and all data except the font outline data are respectively placed in each sub-child In the font files F u ⁇ F ln , and the capacity of each sub-word library file F ln is not greater than the transmission limit threshold; ⁇ each sub-word library file obtained by this method includes not only part of the font outline data but also the font type All data except the outline data, so each sub-font file can be used separately, which improves the flexibility of the font file usage.
  • each sub-word library file Fu ⁇ F ln can directly use each sub-word library file Fu ⁇ F ln , except that each sub-word library file only contains partial font contour data; All of the sub-font files Fu to F ln can be combined to obtain a font file F that can contain all of the font outline data and can be used.
  • the second case if the capacity of the font outline data in the font file is larger than the transmission limit threshold, and the capacity of the data other than the font outline data in the font file is not greater than the transmission limit threshold, the font file is sliced. There are two ways to do this:
  • Method C performing segmentation processing on the font contour data to obtain a plurality of sub-word library files including partial font contour data and having a capacity not greater than a transmission limit threshold, and using data other than the font contour data as a sub-word library file;
  • the segmentation processing module 100 divides the font outline data into sub-word library files F ir -F ]n according to the determined segmentation unit, where n is a positive integer, and data other than the font outline data is used as one Sub-word library file F 2 ;
  • the user equipment 20 may combine the multiple sub-word files in the following two ways:
  • the sub-character files Fu and F 2 are combined to obtain a font file containing partial font contour data and usable, and the sub-word library files F 12 and F 2 are combined to obtain partial font contour data and can be obtained.
  • Method D performing segmentation processing on the font outline data to obtain a plurality of sub-word library files including partial font contour data; for any one of the sub-word library files, all data except the font outline data in the font file is set In the sub-word library file, wherein the capacity of the sub-word library file is not greater than a transmission limit threshold;
  • the user equipment 20 can directly use each sub-word library file Fu F ⁇ , but only each partial font file contains only partial font contour data; All the sub-letter files Fi wide F ln are combined to obtain a font file F containing all the font outline data and usable.
  • the segmentation process includes: The font contour data is subjected to segmentation processing to obtain a plurality of sub-word library files including partial font contour data and having a capacity not greater than a transmission limit threshold; and dividing data other than the font contour data into a plurality of inclusions a sub-word library file partially with data other than the font outline data and having a capacity not greater than the transmission limit threshold;
  • the segmentation processing module 100 divides the font profile data into a plurality of sub-character files Fi-wide F in which only partial font profile data is included according to the determined segmentation unit, where n is a positive integer, and each sub-character library The capacity of the file F ⁇ Fh is not greater than the transmission limit alarm value; and the data other than the font outline data is divided into a plurality of data according to the determined segmentation unit, wherein m is a positive integer;
  • the user device 20 Fu ⁇ F ln all sub font files F 2 and F after extensive 2m, can preclude the process of merging a plurality of sub-after receiving the font file splitting in two ways:
  • the second is to combine the sub-character files Fu and F 21 to F 2m 3 ⁇ 4 lines to obtain a font file containing partial font outline data and usable; and to merge the sub-word library files F 12 and F 2 wide F 2m ii lines, A font file containing partial font outline data and usable is obtained, and so on; a plurality of font files including partial font outline data and usable are obtained.
  • the slicing process includes: dividing the font outline data as a sub-word library file; and dividing the data other than the font outline data Processing, obtaining a plurality of sub-word library files whose capacity is not greater than a transmission limit threshold;
  • the segmentation processing module 100 uses the font outline data as a sub-word library file F t ; and divides the data other than the font outline data into the sub-word library files F 21 ⁇ F 2m according to the determined segmentation unit, Where m is a positive integer;
  • the international character encoding UNICODE corresponding to each font contour data may be segmented;
  • the segmentation rules include but are not limited to the following rules.
  • the severing rule when performing the splicing process, the severing rule needs to be sent to the user equipment, so that the user equipment can perform the merging process on the sub-character files according to the severing rules to obtain the font file that can be used, in order to ensure the transmission.
  • the sharding rules of the font file can be encrypted, so that even if other user equipments steal the font outline data, other user equipment cannot obtain the sharding rules, so other user equipment cannot use the font file;
  • segmenting the font outline data it may also be divided according to the ID number corresponding to each font contour data; it may also be divided according to the national standard GBK/GB18030 corresponding to each font contour data, which is cut.
  • the sub-rules are similar to the UNICODE segmentation rules and will not be described here.
  • the segmentation processing module 100 of the embodiment of the present invention is further configured to:
  • the index file includes the capacity of the font file to be downloaded, the unit of division, and the naming rule of the sub-word library file after the segmentation ;
  • the capacity of the font file in the index file refers to the physical size of the font file (in integer type, byte number); the split unit refers to the capacity of the sub-word library file processed by a single split (in integer type, word)
  • the number of sections is a unit, where the split unit is not greater than the transmission limit threshold of the gateway.
  • the capacity of the last sub-file file may be smaller than the split unit, except for the last sub-word library.
  • the capacity of the file is equal to the split unit.
  • the establishment of the index file may be completed before the splicing process, or may be completed after the splicing process; correspondingly, the sending module 101 is further configured to send the index file to the user equipment 20;
  • the user equipment 20 After receiving the index file sent by the server 10, the user equipment 20 reads the index file, determines the file name of each sub-word library file that needs to be downloaded according to the index file, and creates a corresponding empty file for storage to be downloaded from the server 10.
  • the server 10 of the embodiment of the present invention further includes:
  • the determining module 102 is configured to determine whether the capacity of the font file to be downloaded is greater than a transmission limit threshold of the gateway. When the capacity of the font file is greater than the transmission limit threshold, the segmentation processing module 100 is triggered to work; the capacity of the font file is not greater than When the transmission limits the threshold, the trigger sending module 101 directly sends the font file to the user equipment 20.
  • the server 10 of the embodiment of the present invention further includes:
  • the compression processing module 103 is configured to compress the font file before the font file is larger than the transmission limit threshold, and perform the compression processing on the font file, and then trigger the judging module 102 to work again after performing the compression processing.
  • the compression processing module 103 of the embodiment of the present invention may compress the font file by using various compression algorithms well known to those skilled in the art, such as open source zip, winzip, 7-zip, etc. compression/decompression algorithms; different font files
  • the compression ratio may be different. Some font files can be compressed to about 70% of the original capacity. Some font files can only be compressed to about 90% of the original capacity, but for wireless networks, small traffic reduction will be Will bring economic savings and download speed.
  • the plurality of sub-font files are processed to obtain a compressed font file that can be used; and the obtained compressed font file is decompressed to obtain a usable font file.
  • the segmentation processing module 100 does not perform the segmentation process on the compressed font file, and the sending module 101 compresses the file.
  • the font file is sent to the user device 20, so the user device 20 receives the compressed font file, and decompresses the compressed font file to obtain a usable font file.
  • a method for downloading a font file is also provided in the embodiment of the present invention.
  • the principle of solving the problem is similar to the server shown in FIG. 2, so the implementation of the method can be referred to the server shown in FIG. The implementation, the repetition will not be repeated.
  • An embodiment of the present invention provides a method for downloading a font file. As shown in FIG. 4, the method includes the following steps: S401. If the capacity of the font file that the user equipment needs to download is greater than the transmission limit threshold of the gateway corresponding to the user equipment, perform a segmentation process on the font file to obtain a plurality of sub-word library files whose capacity is not greater than a transmission limit threshold.
  • the segmentation processing of the font file in S401 includes:
  • the font outline data in the font file is greater than the transmission limit threshold, the font outline data is sliced to obtain a plurality of sub-word library files including partial font contour data and having a capacity not greater than a transmission limit threshold;
  • the data other than the font outline data in the font file is subjected to the segmentation processing to obtain a plurality of partial de-contoured contour data. If the capacity of the data other than the font outline data in the font file is not greater than the transmission limit threshold, the data other than the font outline data in the font file is taken as one Sub-word library file.
  • the segmentation processing on the font file in S401 includes:
  • the font contour data is sliced to obtain a plurality of sub-word library files including partial font contour data
  • the user equipment 20 of the embodiment of the present invention includes:
  • the download module 200 is configured to download all the sub-word library files
  • the processing module 201 is configured to process all the sub-word files to obtain a font file that can be used.
  • the processing module 201 is specifically configured to:
  • the processing module 201 is specifically configured to:
  • each sub-library file downloaded is used as a usable font file.
  • the user equipment 20 In the process of downloading all the sub-library files by the user equipment 20, if an interruption occurs with the server 10, and after restoring the normal connection with the server 10, if the download still needs to be continued, the user equipment 20 first obtains the local completed download. The total capacity of the sub-library file, and then calculate the total capacity and the segmentation unit of the font file, and set the required The downloaded sub-character file is sent to the server 10 to send a request for re-downloading, thereby implementing a resume of the breakpoint. Specifically, the user device 20 first reads the index file of the font file to be downloaded, thereby determining the capacity and the segmentation of the font file. Unit, and sequentially determine the capacity of each sub-library file that has been downloaded to determine whether the downloaded sub-library file is complete, as follows:
  • the sub-word library file For each downloaded sub-word library file, if the capacity of the sub-word library file is not zero, and the capacity of the sub-library file is obtained and the actual capacity of the corresponding sub-word library file in the server 10 is consistent, the sub-word library file is described as Download completed;
  • the capacity of the sub-word library file is smaller than the actual capacity of the corresponding sub-word library file in the server 10
  • the corresponding sub-word library file in the server 10 is pointer-shifted, and the specific offset is the sub-word library file that the user equipment 20 has downloaded.
  • the capacity value, the remaining capacity value of the sub-word library file to be downloaded is the difference between the actual capacity of the corresponding sub-word library file in the server 10 and the capacity of the sub-word library file that has been downloaded locally;
  • the user device 20 does not record the amount of downloaded data inside the program, but directly reads the capacity value directly from the stored sub-word library file, and then the sub-character file is read.
  • the capacity value as the starting position for re-initiating the download request, the downloaded segment still uses the size of the set segment.
  • the server 10 of the embodiment of the present invention performs compression processing on the font file, and the user equipment 20, as shown in FIG. 6, further includes:
  • the decompression processing module 202 is configured to perform decompression processing after processing all the sub-word files to obtain a font file that can be used.
  • a method for downloading a font file is also provided in the embodiment of the present invention.
  • the principle of solving the problem is similar to the device shown in FIG. 5, so the implementation of the method can be referred to the device shown in FIG. The implementation, the repetition will not be repeated.
  • An embodiment of the present invention provides a method for downloading a font file, as shown in FIG. 7, including:
  • the S70 K user device downloads all sub-font files
  • the user equipment processes all the sub-character files to obtain a font file that can be used.
  • the processing of all the sub-word library files in S702 includes: combining the sub-word library files including the partial font contour data with all the sub-word library files including the data other than the font outline data, to obtain a font file that can be used; Or a sub-word library file containing partial font outline data, and the sub-font file is combined with all sub-word library files containing data other than the font outline data to obtain a font file that can be used.
  • processing all the sub-word files in S702 includes:
  • each sub-library file downloaded is used as a usable font file.
  • the compression processing module 103 on the server side compresses the font file that needs to be downloaded with a capacity larger than the transmission limit threshold; the server-side segmentation processing module 100 performs segmentation processing on the compressed font file to obtain more a sub-library file, and sent to the user device;
  • the download module 200 of the user equipment side downloads all sub-character files from the server side; the processing module of the user equipment side
  • the decompression processing module 202 of the user device decompresses the obtained font file to obtain a font file that can be used.
  • the method for downloading a font file in the embodiment of the present invention includes the following steps:
  • the server compresses the font file that needs to be downloaded and has a capacity greater than a transmission limit threshold
  • the server reads an attribute table of the compressed font file, where the attribute table includes a capacity of the font file.
  • the server determines, according to the transmission limit threshold, a segmentation unit
  • the server determines a naming rule of the sub-word library file after the segmentation, manages the sub-word library file, and distributes all the determined sub-word library files to the user equipment through the network; wherein, managing the sub-word library file includes: determining each sub- The uniqueness of the actual naming of the font file, the correspondence between the actual naming of the sub-library file and the sharding rule, avoiding the problem of overlapping the sub-word files after multiple sharding, recording the attributes of each sub-word file and other sub-library files. The combination of attributes, etc.;
  • the embodiment of the present invention performs segmentation processing on the font file to obtain a plurality of sub-word library files whose capacity is not greater than the transmission limit threshold, so that the user
  • each sub-font file is downloaded and processed to obtain a font file that can be used.
  • the capacity of the font file exceeds the limit of the corresponding gateway of the user, the user cannot be downloaded from the file server. The situation of the required font file occurs; the embodiment of the invention also improves the download speed and improves the user experience.
  • the font file when the capacity of the font file to be downloaded is greater than the transmission limit idle value of the gateway corresponding to the user equipment, and the capacity of the data of the font outline data in the font file is not greater than the transmission limit threshold, the font file may be The font outline data in the segmentation processing is performed to obtain a plurality of sub-word library files including partial font type 4 warehouse data, and all data except the font wheel data is placed in each sub-font file, so that each obtained The sub-library files can be used directly, which improves the flexibility of the use of font files;
  • each sub-word library file may be encrypted (such as parity check and shift processing) when the font file is divided and processed. Etc.) After downloading all the sub-library files using the .user+device, decryption processing is required before all sub-font files can be processed accordingly to obtain a usable font file.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)
  • Document Processing Apparatus (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本发明涉及计算机技术领域,特别涉及一种下载字库文件的方法和系统,用于解决现有技术中存在的在用户所需下载的字库文件的容量超过该用户对应的网关的限制时,导致用户无法从文件服务器中下载所需的字库文件的问题。本发明实施例的下载字库文件的方法包括:若用户设备需要下载的字库文件的容量大于该用户设备对应的网关的传输限制阈值,对字库文件进行切分处理,得到多个容量不大于传输限制阈值的子字库文件;向用户设备发送所有的子字库文件。通过本发明实施例的方法,避免了在字库文件的容量超过该用户对应的网关的限制时,导致用户无法从文件服务器中下载所需的字库文件的情况。

Description

一种下载字库文件的方法和系统
技术领域
本发明涉及计算机技术领域, 特别涉及一种下载字库文件的方法和系统。 背景技术
随着嵌入式技术的发展和嵌入式电子设备的普及, 使通过无线网络接入, 以获取所需 的服务变成了可能。 但提供服务的网络提供商或运营商, 通常会通过其对应的网关
( Gateway )对无线传输的文件的容量进行限制, 以防止某个用户设备长时间占用网络带宽 资源,使有限的带宽资源能够为尽可能多的用户设备提供服务,如 WAP( Wireless Application Protocol, 无线应用协议) 网关, 会对容量超过网关限制的文件进行拦截。
字库是外文字体、 中文字体以及相关字符的电子文字字体集合库, 被广泛用于计算机、 网络及相关电子设备(如手机、 平板电脑等) 中, 用户可以使用用户设备通过 WAP网关从 文件服务器下载字库文件进行安装使用, 但字库文件一般都很大, 由于 WAP网关对无线传 输的文件的容量进行了限制, 若字库文件的容量超过了 WAP网关的限制, 则 WAP网关会 对该字库文件进行拦截, 导致用户设备无法通过 WAP网关从文件服务器中获取所需的字库 文件。
综上所述, 在用户所需下载的字库文件的容量超过该用户对应的网关的限制时, 导致 用户无法从文件服务器中下载所需的字库文件。 发明内容
本发明提供了一种下载字库文件的方法和系统, 用于解决现有技术中存在的在用户所 需下载的字库文件的容量超过该用户对应的网关的限制时, 导致用户无法从文件服务器中 下载所需的字库文件的问题。
本发明提供了一种下载字库文件的方法, 包括: 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值的子字库文件; 向所述用户设备发送所有的所述子字库文件。
优选的, 对所述字库文件进行切分处理包括:
若所述字库文件中字型轮廓数据的容量大于所述传输限制阈值, 对所述字型轮靡数据 进行切分处理, 字库文件;
若所述字库文件中除字型轮廓数据之外的数据的容量大于所述传输限制阈值, 对所述 除字型轮廓数据之外的数据进行切分处理, 得到多个包含部分除字型轮廓数据之外的数据 且容量不大于所述传输限制阈值的所述子字库文件; 若所述字库文件中除字型轮廓数据之 外的数据的容量不大于所述传输限制阈值, 将所述字库文件中除字型轮廓数据之外的数据 作为一个所述子字库文件。
优选的, 对所述字库文件进行切分处理包括:
若所述字库文件中除字型轮廓数据之外的数据的容量不大于所述传输限制阈值, 对所 述字型轮廓数据进行切分处理, 得到多个包含部分字型轮廓数据的所述子字库文件;
针对上述子字库文件中的任一个子字库文件, 将所述字库文件中除字型轮廓数据之外 的所有数据置于该子字库文件中, 且该子字库文件的容量不大于所述传输限制阈值。
所述下载字库文件的方法还包括:
用户设备下载所有子字库文件;
所述用户设备对所有所述子字库文件进行处理 , 得到能够使用的字库文件。
优选的, 所述用户设备对所有所述子字库文件进行处理包括: 包含部分字型轮廓数据的子字库文件与所有包含除字型轮廓数据之外的数据的子字库文件 进行合并处理, 得到能够使用的字库文件; 或 一个包含部分字型轮廓数据的子字库文件, 将该子字库文件与所有包含除字型轮廓数据之 外的数据的子字库文件进行合并处理, 得到一个能够使用的字库文件。
优选的 , 所述用户设备对所有所述子字库文件进行处理包括:
若包含字型轮庫数据的子字库文件中包含除字型轮廓数据之外的所有数据, 将下载的 每个所述子字库文件作为一个能够使用的字库文件。
本发明提供了一种下载字库文件的系统, 包括:
服务器, 用于在用户设备需要下载的字库文件的容量大于该用户设备对应的网关的传 输限制闹值时, 对所述字库文件进行切分处理, 以得到多个容量不大于所述传输限制阈值 的子字库文件; 以及向所述用户设备发送所有的所述子字库文件;
用户设备, 用于下载所有子字库文件; 以及对所有所述子字库文件进行处理, 得到能 够使用的字库文件。
优选的, 所述用户设备还用于通过其对应的网关向服务器发送下载请求, 以获取所需 的字库文件;
所述服务器还用于在接收到用户设备发送的下载请求后, 根据用户设备的标识信息确 定该用户设备对应的网关, 从而确定该网关对应的传输限制阔值; 并根据用户设备发送的 下载请求确定需要下载的字库文件, 并根据所述字库文件的容量与传输限制阈值的关系确 定是否需要对字库文件进行切分处理。
优选的, 所迷用户设备的标识信息包括国际移动设备识别码、 国际移动用户识别码、 移动台号薄号码、 客户识别模块中的至少一种。
优选的, 所述服务器包括: 关的传输限制阈值, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈 值的子字库文件;
发送模块, 用于向所述用户设备发送所有的所述子字库文件。
优选的, 所述切分处理模块具体用于:
Figure imgf000005_0001
阈值。
优选的, 所述切分处理模块还用于根据所述切分单位确定子字库文件的数量; 并建立 多个空文件, 所述空文件的数量与所述子字库文件的数量相同; 以及按照所述切分单位的 值将所述字库文件中的数据依次复制并分别置于所述多个空文件中, 以得到多个容量不大 于所述传输限制阈值的子字库文件。
优选的, 所述切分处理模块还用于按照所述切分单位的值依次对所述字库文件中的数 据进行切分以得到多个容量不大于所述传输限制闹值的子字库文件, 而不保留所述字库文 件。
优选的, 所述切分处理模块还用于确定子字库文件的命名规则;
所述发送模块还用于向所迷用户设备发送所迷子字库文件的命名规则; 述子字库文件的命名规则确定所有子字库文件的排序, 并根据所述排序将后一个子字库文 件逐一追加至前一个子字库文件的文件尾, 以完成所有子字库文件的合并处理, 从而得到 能够使用的字库文件。 优选的, 所述切分处理模块还用于确定子字库文件的命名规则; 以及建立所述需要下 载的字库文件的索引文件, 该索引文件包括所述字库文件的容量、 所述切分单位以及所述 子字库文件的命名规则;
所述发送模块还用于向所述用户设备发送所述索引文件;
所述用户设备还用于在下载所有子字库文件及所述索引文件后, 根据所述索引文件确 定需要下载的每个子字库文件的文件名, 并建立对应的空文件以依次存储从发送模块下载 的子字库文件; 在下载子字库文件的过程中, 每个子字库文件的偏移量均从零开始实时记 录当前下栽的子字库文件的下载偏移量, 以便于对下载的子字库文件进行合并处理, 从而 得到能够使用的字库文件。
优选的, 所述用户设备还用于:
下载所有子字库文件的过程中, 若出现与服务器之间的中断, 且在恢复与所述服务器 的正常连接之后, 若仍需继续下载, 则先获取已完成下载的子字库文件的总容量, 然后将 定需要继续下载的子字库文件, 向所述服务器发送重新下载的请求, 从而实现断点续传。
优选的, 所述用户设备还用于:
读取需要下载的字库文件的索引文件, 从而确定所述字库文件的容量及切分单位, 并 顺序判断已下载的每个子字库文件的容量, 以确定已下载的子字库文件是否完整;
针对每一个已下载的子字库文件, 若该子字库文件的容量不为零, 且获取该子字库文 件的容量与服务器中对应的子字库文件的实际容量一致, 则判定该子字库文件已经下载完 毕;
若该子字库文件的容量小于服务器中对应的子字库文件的实际容量, 则对服务器中对 应的子字库文件进行指针偏移, 具体偏移量为用户设备已下载的该子字库文件的容量值, 该子字库文件待下载的剩余的容量值为服务器中对应的子字库文件的实际容量与本地已经 下载的该子字库文件的容量之差。
优选的, 所述切分处理模块具体用于: 时,
若所述字库文件中字型轮廊数据的容量不大于所述传输限制阈值, 且所述字库文件中 除字型轮廓数据之外的数据的容量不大于所述传输限制阈值, 则
对所述字库文件进行切分处理, 得到一个包含所述字库文件中字型轮廓数据的子字库 文件, 以及一个包含所述字库文件中除字型轮廓数据之外的数据的子字库文件; 或者, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值且包含 库文件;
若所述字库文件中字型轮廓数据的容量大于所述传输限制阈值, 且所述字库文件中除 字型轮廓数据之外的数据的容量不大于所述传输限制阈值, 则
对所述字库文件进行切分处理, 得到一个包含所述字库文件中除字型轮廓数据之外的 型轮廓数据的子字库文件;
或者, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值且包含 所述字库文件中部分字型轮廓数据和所述字库文件中除字型轮廓数据之外的数据的子字库 文件;
若所述字库文件中字型轮廓数据的容量大于所述传输限制阈值, 且所述字库文件中除 字型轮廓数据之外的数据的容量大于所述传输限制阈值, 则
对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值且包含所述字 库文件中部分字型轮廓数据的子字库文件, 以及多个容量不大于所述传输限制阈值且包含 所述字库文件中部分除字型轮廓数据之外的数据的子字库文件;
若所述字库文件中字型轮廓数据的容量不大于传输限制阈值, 且所述字库文件中除字 型轮廓数据之外的数据的容量大于传输限制阈值, 则
对所述字库文件进行切分处理, 得到一个包含所述字库文件中字型轮廓数据的子字库 之外的数据的子字库文件。
优选的, 所述切分处理模块还用于在对所述字库文件进行切分处理以形成包含所述字 库文件中部分字型轮廓数据的子字库文件时, 按照每个字型轮廓数据对应的国际字符编码、 ID序号或国家标准对所述字库文件中的字型轮廓数据进行切分, 并建立切分规则;
所述发送模块还用于向所述用户设备发送所述切分规则;
所述用户设备还用于在下载所有子字库文件后, 根据所述切分规则对所有子字库文件 进行合并处理, 以得到能够使用的字库文件。
优选的, 所述用户设备包括:
下载模块, 用于下载所有子字库文件;
处理模块, 用于对所有所述子字库文件进行处理, 得到能够使用的字库文件。
优选的, 所述处理模块具体用于: 若包含部分字型轮廓数据的子字库文件中不包含除字型轮廓数据之外的数据 , 子字库文件进行合并处理, 得到能够使用的字库文件; 或
针对任一个包含部分字型轮廓数据的子字库文件, 将该子字库文件与所有包含除字型 轮廓数据之外的数据的子字库文件进行合并处理, 得到一个能够使用的字库文件;
若包含字型轮廓数据的子字库文件中包含除字型轮廓数据之外的所有数据, 将下载的 每个所述子字库文件作为一个能够使用的字库文件。
优选的, 所述服务器还包括:
判断模块, 用于判断用户设备需要下载的字库文件的容量是否大于该用户设备对应的 网关的传输限制阈值, 在所述字库文件的容量大于该传输限制阈值时, 触发切分处理模块 工作; 在所述字库文件的容量不大于该传输限制阈值时, 触发发送模块将该字库文件直接 发送给用户设备。
优选的, 所述服务器还包括压缩处理模块,
所述压缩处理模块用于在判断模块判断所述字库文件的容量大于该传输限制阔值时, 且在判断模块触发切分处理模块工作之前, 对所述字库文件进行压缩处理, 并在进行压缩 处理之后, 再次触发判断模块工作; 大于该用户设备对应的网关的传输限制阈值, 在所述压缩后的字库文件的容量大于该传输 限制阈值时, 触发切分处理模块工作; 在所述压缩后的字库文件的容量不大于该传输限制 阈值时, 触发发送模块将该压缩后的字库文件直接发送给用户设备;
所述用户设备还用于在下载所有子字库文件后, 对所述所有子字库文件进行处理, 得 到能够使用的压缩处理后的字库文件; 所述用户设备包括解压缩处理模块, 其用于对所迷 压缩后的字库文件进行解压缩处理, 从而得到能够使用的字库文件。 字库文件进行切分处理, 得到多个容量不大于该传输限制阈值的子字库文件, 使用户设备 在下载时, 分别下载每个子字库文件并进行处理, 得到能够使用的字库文件, 避免了在字 库文件的容量超过该用户对应的网关的限制时, 导致用户无法从文件服务器中下载所需的 字库文件的情况。 附图说明
图 1为本发明实施例的第一种下载字库文件的系统的结构示意图; 图 2为本发明实施例的第一种服务器的结构示意图;
图 3为本发明实施例的第二种服务器的结构示意图;
图 4为本发明实施例的第一种下载字库文件的方法流程图;
图 5为本发明实施例的第一种用户设备的结构示意图;
图 6为本发明实施例的第二种用户 i殳备的结构示意图;
图 7为本发明实施例的第二种下载字库文件的方法流程图;
图 8为本发明实施例的第二种下载字库文件的系统的结构示意图;
图 9为本发明实施例的第三种下载字库文件的方法流程图。 具体实施方式
本发明实施例在需要下载的字库文件的容量大于用户设备对应的网关的传输限制阈值 时, 对字库文件进行切分处理, 得到多个容量不大于该传输限制阈值的子字库文件, 使用 户设备在下载时, 分别下载每个子字库文件并进行处理, 得到能够使用的字库文件, 从而 从文件服务器中下载所需的字库文件的问题。
下面结合说明书附图对本发明实施例作进一步详细描述。
如图 1所示, 本发明实施例提供了一种下载字库文件的系统, 包括:
服务器 10,用于在用户设备 20需要下载的字库文件的容量大于该用户设备对应的网关 的传输限制阈值时, 对字库文件进行切分处理, 得到多个容量不大于传输限制阈值的子字 库文件; 以及向用户设备 20发送所有的子字库文件;
用户设备 20, 用于下载所有子字库文件; 以及对所有子字库文件进行处理, 得到能够 使用的字库文件。
本发明实施例的用户设备 20可以是手机、 平板电脑等嵌入式电子设备; 用户设备 20 根据需要通过其对应的 WAP网关向服务器 10发送下载请求, 以获取所需的字库文件, 并 用于安装使用; 其中 WAP 网关用于连接无线网络和因特网, 能够实现无线应用协议 WAP 堆栈的转换、 内容格式转换(如无线置标语言 WML到超文本置标语言 HTML ( Hypertext Markup Language ) )等功能;
另外, 字库文件中的中文字库文件的容量一般比较大, 有的中文超大字库文件的数据 容量, 甚至可以达到几百兆, 而网关一般都会对通过其进行无线传输的文件的容量进行限 制, 以防止某个用户设备长时间占用网絡带宽资源。
服务器〗 0在接收到用户设备 20发送的下载请求后, 根据用户设备 20的标识信息, 如 国际移动设备识别码 ( IMEI, International MoFile Equipment Identity )、 国际移动用户识别 码(IMSI, International MoFile SuFscriFer Identity ), 移动台号薄号码 ( MSISDN, Mobile Subscriber International ISDN/PSTN number )、 SIM卡( Subscriber Identity Module, 客户识别 模块)等可以确定用户设备对应的网关的特征参量, 确定用户设备 20对应的 WAP网关, 从而确定该 WAP网关对应的传输限制阈值; 并根据用户设备 20发送的下载请求确定需要 下载的字库文件; 存储字库文件的服务器与对需要下载的字库文件进行处理的服务器可以 是同一台服务器, 也可以是相互独立且能够交互的两台服务器;
服务器 10在确定了需要下载的字库文件及用户设备 10对应的网关的传输限制阈值之 后 , 判断该字库文件的容量是否大于传输限制阈值;
若是, 则先对该字库文件进行切分处理, 得到多个容量不大于传输限制阈值的子字库 文件, 再将每个子字库文件发送给用户设备 20; 相应的, 用户设备 20在通过网关从 i£务器 10完成所有子字库文件的下载之后,根据服务器 10的不同切分方式对所有子字库文件进行 处理, 得到能够使用的字库文件, 从而可以在用户设备 20上使用该字库文件;
若否, 则直接将字库文件发送给用户设备 20; 相应的, 用户设备 20在通过网关从服务 器 10完成字库文件的下载之后, 可以在用户设备 20上使用该字库文件。
本发明实施例的服务器在接收到用户设备发送的下载请求后, 先根据用户设备的标识 信息确定用户设备对应的网关, 进而确定该网关对应的传输限制阈值, 及根据下载请求确 定所需下载的字库文件; 并根据字库文件的容量与传输限制阈值的关系确定是否需要对字 库文件进行切分处理, 仅在字库文件的容量大于传输限制阈值时才对字库文件进行切分处 理, 而不需要对服务器存储的所有字库文件进行切分, 从而节省了存储空间, 提高了服务 况; 由于需要从服务器下载字库文件的用户设备对应的网关有可能不同, 而每个网关对应 的传输限制阈值也有可能不同, 本发明实施例的服务器实时根据每个用户设备对应的网关 的传输限制阈值确定是否对字库文件进行切分处理 , 从而提高了服务器的工作效率。
本发明实施例的服务器 10, 如图 2所示, 包括:
切分处理模块 100 - 用于在用户设备 20需要下载的字库文件的容量大于该用户设备 20 对应的网关的传输限制阈值时 , 对字库文件进行切分处理, 得到多个容量不大于传输限制 阈值的子字库文件;
发送模块 101 , 用于向用户设备 20发送所有的子字库文件。
在用户设备 20需要下载的字库文件的容量大于该用户设备 20对应的网关的传输限制 阈值时, 触发服务器 10的切分处理模块 100对字库文件进行切分处理, 具体的切分处理包 括以下两种方式:
方式一:
具体的, 以用户设备 20对应的网关为中国移动的 cmwap 网关为例进行说明, cmwap 网关通常限制为每个需要下载的文件的容量在 1 M: ( 1024* 1024字节)以内, 即 cmwap网关 的传输限制阈值为 1 M - 当需要下载的文件的容量大于 1M时,该 cmwap网关通常会屏蔽该 下载, 从而导致用户设备 20无法从服务器 10上下载该文件; 假设用户设备 20需要从服务 器 10下载字库文件, i设字库文件的命名为 F, 切分处理模块 100根据传输限制阈值确定 字库文件的切分单位(其中切分单位不大于传输限制阈值) 以及确定子字库文件的命名规 则 (如将子字库文件依次命名为 Fi、 F2... ... ), 其中切分单位是指单次切分处理的子字库文 件的容量, 从而确定子字库文件的数量, 需要说明的是, 切分后的最后一个子字库文件的 容量可能会小于切分单位的值, 除最后一个子字库文件之外的子字库文件的容量等于该切 分单位;
假设切分单位为 819200 字节 ( 800* 1024 ), 根据字库文件的容量及切分单位需要将字 库文件切分为九个子字库文件, 则在切分处理的过程中, 切分处理模块 100可以重新建立 九个空文件, 然后^字库文件的第一个字节开始复制 819200字节并置于第一个空文件中, 作为第一个子字库文件 F1 ; 从第 819201字节开始复制 819200字节到第二个空文件中, 作 为第二个子字库文件 F2, 依次类推; 该切分方式保留了原字库文件, 从而可以使服务器 10 根据需要向用户设备 20发送字库文件或子字库文件; 切分过程中也可以根据需要直接从原 字库文件中进行递增切分, 而不保留原字库文件, 从而节省了服务器 10的存储空间;
相应的, 用户设备 20在接收到切分后所有子字库文件 F,~F9后, 可根据子字库文件的 命名规则确定子字库文件的排序,将九个子字库文件 F广 F9按照序号将后一个子字库文件逐 一追加至前一个子字库文件的文件尾, 即子字库文件 F2追加至子字库文件 的文件尾, 子 字库文件 F3追加至子字库文件 F2的文件尾, 依此类推, 完成所有子字库文件的合并处理, 从而得到包含所有字型轮廓数据且能够使用的字库文件 F。 理;
在字库文件中, 字型轮廓数据是核心部分, 其容量是字库文件中最大的, 如 TTF ( True Type Font )字库文件中,其字型曲线轮廓图元数据 glyf的容量占据了 TTF字库文件的 90%, 该方式包括以下四种情况:
第一种情况: 若字库文件中的字型轮廓数据的容量不大于传输限制阈值, 且字库文件 中除字型轮廓数据之外的数据的容量不大于传输限制阈值, 则对字库文件进行切分处理包 括以下两种方式:
方式 A: 将字型轮廓数据作为一个子字库文件, 将除字型轮廓数据之外的数据作为另 一个子字库文件;
相应的,用户 i殳备 20在接收到切分后所有子字库文件后,对子字库文件进行合并处理, 从而得到包含所有字型轮廓数据且能够使用的字库文件;
以 TTF ( True Type Font )字库文件为例进行说明, TTF字库文件包括 23个表, 如 head (字体头)、 cmap (字符代码到图元的映射)、 glyf (字型曲线轮廓图元数据)、 maxp (最大 需求表)、 mmtx (水平规格)、 loca (位置表索引 )、 name (命名表 )、 hmtx (水平布局)、 kerm (字距调整表)、 post PostScript信息等;其中字型曲线轮廓图元数据 glyf的容量占据了 TTF 字库文件的 90%;
将 glyf表对应的字型轮廓数据作为子字库文件 Ft , 将除 glyf表之外的其他表对应的数 据作为子字库文件 F2;
方式 B:对字型轮廓数据进行切分处理,得到多个包括部分字型轮廓数据的子字库文件; 针对其中任一个子字库文件, 将字库文件中除字型轮廓数据之外的所有数据置于该子字库 文件中, 其中该子字库文件的容量不大于传输限制阈值;
具体的, 切分处理模块 100将字型轮廓数据切分为子字库文件 Ρι Γ·Ρ1 η, 其中 η为正整 数, 并将除字型轮廓数据之外的所有数据分别置于每个子字库文件 Fu〜Fln中, 且每个子字 库文件 广 Fln的容量均不大于传输限制阈值; 釆用该方式得到的每个子字库文件中不仅包 括部分字型轮廓数据, 还包括除字型轮廓数据之外的所有数据, 所以, 每个子字库文件都 是可以单独使用的, 提高了字库文件使用的灵活性。
相应的, 用户设备 20在接收到切分后所有子字库文件 F„〜Fln后,可直接使用每个子字 库文件 Fu〜Fln, 只是每个子字库文件中仅包含部分字型轮廓数据; 也可以将所有子字库文 件 Fu〜Fln进行合并处理, 得到包含所有字型轮廓数据且能够使用的字库文件 F。
第二种情况: 若字库文件中的字型轮廓数据的容量大于传输限制阈值, 且字库文件中 除字型轮廓数据之外的数据的容量不大于传输限制阈值, 则对字库文件进行切分处理包括 以下两种方式:
方式 C:对字型轮廓数据进行切分处理,得到多个包括部分字型轮廓数据且容量不大于 传输限制阈值的子字库文件, 将除字型轮廓数据之外的数据作为一个子字库文件;
具体的, 切分处理模块 100 根据确定的切分单位将字型轮廓数据切分为子字库文件 Fi r-F]n, 其中 n为正整数, 将除字型轮廓数据之外的数据作为一个子字库文件 F2; 相应的, 用户设备 20在接收到切分后所有子字库文件 Ft广 Fln及 F2后, 可采用以下两 种方式对多个子字库文件进行合并处理:
一是将所有子字库文件 F Fln及 F2进行合并处理 ,得到包含所有字型轮廓数据且能够 使用的字库文件 F;
二是将子字库文件 Fu及 F2进行合并处理,得到包含部分字型轮廓数据且能够使用的字 库文件,将子字库文件 F12及 F2进行合并处理,得到包含部分字型轮廓数据且能够使用的字 库文件, 依次类推; 得到多个能够使用且仅包含部分字型轮廓数据的字库文件;
方式 D: 对字型轮廓数据进行切分处理, 得到多个包括部分字型轮廓数据的子字库文 件; 针对其中任一个子字库文件, 将字库文件中除字型轮廓数据之外的所有数据置于该子 字库文件中, 其中该子字库文件的容量不大于传输限制阈值;
相应的, 用户设备 20在接收到切分后所有子字库文件 F„~Fln后,可直接使用每个子字 库文件 Fu F^, 只是每个子字库文件中仅包含部分字型轮廓数据; 也可以将所有子字库文 件 Fi广 Fln进行合并处理, 得到包含所有字型轮廓数据且能够使用的字库文件 F。
第三种情况: 若字库文件中的字型轮廓数据的容量大于传输限制阈值, 且字库文件中 除字型轮廓数据之外的数据的容量大于传输限制阈值, 则切分处理过程中包括: 对字型轮 廓数据进行切分处理, 得到多个包括部分字型轮廓数据且容量不大于传输限制阈值的子字 库文件; 以及将除字型轮廓数据之外的数据进行切分处理, 得到多个包含部分除字型轮廓 数据之外的数据且容量不大于传输限制阈值的子字库文件;
具体的, 切分处理模块 100根据确定的切分单位将字型轮廓数据切分为多个仅包含部 分字型轮廓数据的子字库文件 Fi广 Fin, 其中 n为正整数, 且每个子字库文件 F^Fh的容量 均不大于传输限制闹值; 及根据确定的切分单位将除字型轮廓数据之外的数据切分为多个 其中 m为正整数;
相应的, 用户设备 20在接收到切分后所有子字库文件 Fu〜Fln及 F2广 F2m后, 可釆用以 下两种方式对多个子字库文件进行合并处理:
一是将所有子字库文件 广 Fln及 F2广 F2m进行合并处理, 得到包含所有字型轮廓数据 且能够使用的字库文件 F;
二是将子字库文件 Fu及 F21〜F2m ¾行合并处理, 得到包含部分字型轮廓数据且能够使 用的字库文件; 将子字库文件 F12及: F2广 F2m ii行合并处理, 得到包含部分字型轮廓数据且 能够使用的字库文件, 依次类推; 得到多个包含部分字型轮廓数据且能够使用的字库文件。
第四种情况: 若字库文件中的字型轮廓数据的容量不大于传输限制阈值, 且字库文件 中除字型轮廓数据之外的数据的容量大于传输限制阈值, 则切分处理过程中包括: 将字型 轮廓数据作为一个子字库文件; 及将除字型轮廓数据之外的数据进行切分处理, 得到多个 容量不大于传输限制阈值的子字库文件;
具体的, 切分处理模块 100将字型轮廓数据作为一个子字库文件 Ft; 并根据确定的切 分单位将除字型轮廓数据之外的数据切分为子字库文件 F21〜F2m, 其中 m为正整数;
相应的, 用户设备 20在接收到切分后所有子字库文件 Fi及 F21〜F2m后, 所有子字库文 件 及 F2广 F2m进行合并处理, 得到包含所有字型轮廓数据且能够使用的字库文件。
上述方式 B、 方式 C和方式 D中对字型轮廓数据进行切分处理时, 可以按照每个字型 轮廓数据对应的国际字符编码 UNICODE进行切分; 切分规则包括但不限于下列规则中的 一种或多种: 顺序切分, 如将 0X4E00~0X4F00 划分为一组作为第一个子字库文件中, 将 0X4F01-0X5001 划分为一组作为第二个子字库文件中, 依此类推, 但必须保证每个子字库 文件的容量不大于传输限制阈值; 打乱 UNICODE字符编码顺序, 如从 UNICODE编码在 0X4E00-0X4F00区间中随机提取若千 UNICODE的字型轮廓数据, 再从 UNICODE编码在 0X4F01-0X5001 区间中随机提取若千 UNICODE的字型轮廓数据, 组合成第一个子字库文 件, 然后从剩下未被选择的编码中, 再随机组合成第二个子字库文件, 依此类推, 但必须 保证每个子字库文件的容量不大于传输限制阈值;
需要说明的是, 在进行切分处理时, 需要将切分规则发送给用户设备, 以使用户设备 可根据切分规则对子字库文件进行合并处理, 以得到能够使用的字库文件, 为了保证传输 的安全性, 可对字库文件的切分规则进行加密处理, 这样即使其他用户设备盗用了该字型 轮廓数据, 由于其他用户设备无法获取切分规则, 故其他用户设备无法使用该字库文件; 在对字型轮廓数据进行切分处理时, 也可以按照每个字型轮廓数据对应的 ID序号进行 切分; 还可以按照每个字型轮廓数据对应的国家标准 GBK/GB18030进行切分, 其切分规则 与按照 UNICODE的切分规则类似, 此处不再赘述。
优选的, 本发明实施例的切分处理模块 100还用于:
根据需要下载的字库文件的容量和网关的传输限制阈值, 建立所述字库文件的索引文 件; 该索引文件包括需要下载的字库文件的容量、 切分单位、 切分后的子字库文件的命名 规則;
其中, 索引文件中字库文件的容量是指字库文件的物理尺寸 (以整数型、 字节数为单 位); 切分单位是指单次切分处理的子字库文件的容量(以整数型、 字节数为单位), 其中, 切分单位不大于网关的传输限制阈值, 需要说明的是, 最后一个子字库文件的容量有可能 小于该切分单位, 除最后一个子字库文件之外的子字库文件的容量等于该切分单位。 需要说明的是, 索引文件的建立可在切分处理之前完成, 也可以在切分处理之后完成; 相应的, 发送模块 101还用于将索引文件发送给用户设备 20;
相应的, 用户设备 20在接收到服务器 10发送的索引文件之后, 读取该索引文件, 根 据索引文件确定需要下载的每个子字库文件的文件名, 并建立对应的空文件以存储从服务 器 10下载的子字库文件; 在下载的过程中, 每个子字库文件的偏移量均从零开始, 实时记 录当前下载的子字库文件的下载偏移量。
如图 3所示, 本发明实施例的服务器 10还包括:
判断模块 102, 用于判断需要下载的字库文件的容量是否大于网关的传输限制阈值, 在 字库文件的容量大于该传输限制阔值时, 触发切分处理模块 100 工作; 在字库文件的容量 不大于该传输限制阈值时, 触发发送模块 101将该字库文件直接发送给用户设备 20。
为了降低字库文件的容量, 提高服务器的处理效率, 优选的, 如图 3 所示, 本发明实 施例的服务器 10还包括:
压缩处理模块 103 , 用于在字库文件的容量大于该传输限制阈值时, 且在对字库文件进 行切分处理之前, 对字库文件进行压缩处理, 在进行压缩处理之后, 再次触发判断模块 102 工作。
本发明实施例的压缩处理模块 103 可采用本领域技术人员所熟知的各种压缩算法对字 库文件进行压缩处理, 如开源的 zip、 winzip、 7- zip等压缩 /解压縮算法; 不同的字库文件的 压缩率有可能不同, 有的字库文件能压缩至原容量的 70%左右, 有的字库文件只能压缩至 原容量的 90%左右, 但对于无线网络而言, 很小的流量降低都将会带来经济的节省和下载 速度的提升。 对该多个子字库文件进行处理, 得到能够使用的压縮后字库文件; 再对得到的压缩后字库 文件进行解压缩处理, 从而得到能够使用的字库文件。 当然, 如果经压缩处理模块 103 压 缩后的字库文件的容量不大于该传输限制阔值, 则切分处理模块 100 不对该压缩后的字库 文件进行切分处理, 且发送模块 101将该压縮后的字库文件发送给用户设备 20, 故用户设 备 20接收到的是该压缩后的字库文件, 并对该压缩后的字库文件进行解压缩处理, 从而得 到能够使用的字库文件。
基于同一发明构思, 本发明实施例中还提供了一种下载字库文件的方法, 由于该方法 解决问题的原理与图 2所示的服务器相似, 因此该方法的实施可以参见图 2所示的服务器 的实施, 重复之处不再赘述。
本发明实施例提供了一种下载字库文件的方法, 如图 4所示, 包括以下步骤: S401、 若用户设备需要下载的字库文件的容量大于该用户设备对应的网关的传输限制 阈值, 对字库文件进行切分处理, 得到多个容量不大于传输限制阈值的子字库文件;
S402、 向用户设备发送所有的子字库文件。
优选的, S401 中对字库文件进行切分处理包括:
若字库文件中字型轮廓数据的容量大于传输限制阈值, 对字型轮廓数据进行切分处理, 得到多个包括部分字型轮廓数据且容量不大于传输限制阈值的子字库文件;
若字库文件中除字型轮廓数据之外的数据的容量大于传输限制阈值, 对字库文件中除 字型轮廓数据之外的数据进行切分处理, 得到多个包含部分除字型轮廓数据之外的数据且 容量不大于传输限制阈值的子字库文件; 若字库文件中除字型轮廓数据之外的数据的容量 不大于传输限制阈值, 将字库文件中除字型轮廓数据之外的数据作为一个子字库文件。
优选的, S401中对字库文件进行切分处理包括:
若字库文件中除字型轮廓数据之外的数据的容量不大于传输限制阈值, 对字型轮廓数 据进行切分处理, 得到多个包含部分字型轮廓数据的子字库文件;
针对上述子字库文件中的任一个子字库文件, 将字库文件中除字型轮廓数据之外的所 有数据置于该子字库文件中, 且该子字库文件的容量不大于传输限制阈值。
本发明实施例的用户设备 20 , 如图 5所示, 包括:
下载模块 200 , 用于下载所有子字库文件;
处理模块 201 , 用于对所有子字库文件进行处理, 得到能够使用的字库文件。
其中, 处理模块 201具体用于:
Figure imgf000016_0001
进行合并处理, 得到能够使用的字库文件; 或 一个包含部分字型轮廓数据的子字库文件, 将该子字库文件与所有包含除字型轮廓数据之 外的数据的子字库文件进行合并处理, 得到一个能够使用的字库文件。
优选的, 处理模块 201具体用于:
若包含字型轮廓数据的子字库文件中包含除字型轮廓数据之外的所有数据, 将下载的 每个子字库文件作为一个能够使用的字库文件。
在用户设备 20下载所有子字库文件的过程中, 若出现与服务器 10之间的中断, 且在 恢复与服务器 10的正常连接之后, 若仍需继续下载, 则用户设备 20先获取本地已完成下 载的子字库文件的总容量, 然后将该总容量与该字库文件的切分单位进行运算, 设定需要 继续下载的子字库文件, 向服务器 10发送重新下载的请求, 从而实现断点续传; 具体的, 用户设备 20首先读取需要下载的字库文件的索引文件, 从而确定字库文件的 容量及切分单位, 并顺序判断已下载的每个子字库文件的容量, 以确定已下载的子字库文 件是否完整, 具体过程如下:
针对每一个已下载的子字库文件, 若该子字库文件的容量不为零, 且获取该子字库文 件的容量与服务器 10中对应的子字库文件的实际容量一致, 说明该子字库文件巳经下载完 毕;
若该子字库文件的容量小于服务器 10中对应的子字库文件的实际容量,则对服务器 10 中对应的子字库文件进行指针偏移, 具体偏移量为用户设备 20已下载的该子字库文件的容 量值, 该子字库文件待下载的剩余的容量值为服务器 10中对应的子字库文件的实际容量与 本地已经下载的该子字库文件的容量之差;
为了保证续传过程的安全性, 在恢复正常连接后, 用户设备 20不在程序内部记录下载 的数据量, 而是直接从存储的子字库文件中直接读取其容量值, 然后将该子字库文件的容 量值, 作为重新发起下载请求的起始位置, 下载的段仍旧采用设定的段的大小。
优选的, 本发明实施例的服务器 10对字库文件进行压缩处理, 则用户设备 20, 如图 6 所示, 还包括:
解压缩处理模块 202, 用于在对所有子字库文件进行处理之后, 进行解压缩处理, 以得 到能够使用的字库文件。
基于同一发明构思, 本发明实施例中还提供了一种下载字库文件的方法, 由于该方法 解决问题的原理与图 5所示的设备相似, 因此该方法的实施可以参见图 5所示的设备的实 施, 重复之处不再赘述。
本发明实施例提供了一种下载字库文件的方法, 如图 7所示, 包括:
S70 K 用户设备下载所有子字库文件;
S702、 用户设备对所有子字库文件进行处理, 得到能够使用的字库文件。
其中, S702中对所有子字库文件进行处理包括: 包含部分字型轮廓数据的子字库文件与所有包含除字型轮廓数据之外的数据的子字库文件 进行合并处理, 得到能够使用的字库文件; 或 一个包含部分字型轮廓数据的子字库文件, 将该子字库文件与所有包含除字型轮廓数据之 外的数据的子字库文件进行合并处理, 得到一个能够使用的字库文件。 优选的, S702中对所有子字库文件进行处理包括:
若包含字型轮廓数据的子字库文件中包含除字型轮廓数据之外的所有数据, 将下载的 每个子字库文件作为一个能够使用的字库文件。
下面以图 8为例, 对本发明实施例的下载字库文件的系统进行详细说明。
如图 8所示, 服务器端的压缩处理模块 103将需要下载的容量大于传输限制阈值的字 库文件进行压缩处理; 服务器端的切分处理模块 100对压縮处理后的字库文件进行切分处 理, 得到多个子字库文件, 并发送给用户设备端;
用户设备端的下载模块 200从服务器端下载所有子字库文件; 用户设备端的处理模块
201对已下载的所有子字库文件进行处理, 得到能够使用并处于压缩状态的字库文件; 用户 设备端的解压缩处理模块 202对得到的字库文件进行解压縮处理, 得到能够使用的字库文 件。
下面以图 9为例, 对本发明实施例的下载字库文件的方法进行详细说明。
如图 9所示, 本发明实施例的下载字库文件的方法包括以下步驟:
S901、 服务器对需要下载的且容量大于传输限制阔值的字库文件进行压缩处理;
S902、 服务器读取压缩后的字库文件的属性表, 所述属性表包括所述字库文件的容量;
S903、 服务器根据传输限制阈值确定切分单位; 分处理;
5905、 服务器确定切分后的子字库文件的命名规则, 对子字库文件进行管理, 并将确 定的所有子字库文件通过网络分发给用户设备; 其中, 对子字库文件的管理包括: 确定每 个子字库文件的实际命名的唯一性, 记录子字库文件实际命名与切分规则的对应关系, 避 免多次切分后的子字库文件相互覆盖问题, 记录每个子字库文件的属性与其他子字库文件 的属性之间的配合组合关系等;
5906、 依次下载子字库文件;
5907、 若发生中断, 中断后是否继续下载;
若是, 则执行 S908;
若否, 则结束本流程;
5908、 断点续传;
5909、 所有子字库文件下载完毕;
5910、 对所有子字库文件进行处理;
5911、 对处理后的子字库文件进行解压缩处理, 得到能够使用的字库文件, 并结束本 流程。
尽管已描述了本发明的优选实施例, 但本领域内的技术人员一旦得知了基本创造.性概 念, 则可对这些实施例作出另外的变更和修改:。 所以, 所附权利要求意欲解释为包括优选 实施例以及落入本发明范围的所有变更和修改。
本发明实施例在需要下载的字库文件的容量太于用户设备对应的网关的传输限制阈值 时, 对字库文件进行切分处理, 得到多个容量不大于该传输限制阈值的子字库文件, 使用 户设备在下载时, 分别下栽每个子字库文件并进行处理, 得到能够使用的字库文件, 避免 了在字库文件的容量超过该用户对应的网关的限制时, 寻致用户无法从文件服务器中下载 所需的字库文件的情况发生; 本发明实施例同时还提升了下载速度, 改善了用户体验。
本发明实施例在需要下载的字库文件的容量大于用户设备对应的网关的传输限制闲 值, 且字库文件中除字型轮廓数据的数据的容量不大于该传输限制阔值时, 可对字库文件 中的字型轮廓数据进行切分处理, 得到多个包含部分字型 4仓廓数据的子字库文件, 并将除 字型轮 数据之外的所有数据置每个子字库文件中, 使得得到的每个子字库文件均可以直 接使用, 提高了字库文件使用的灵活性;
本发明实施例'中如果不想被其他用户设备使用切分后的子字库文件, 可在对字库文件 进行切分处理的时候, 对每个子字库文件进行加密处理(如奇偶校验、 移位处理等), 使用 .户+设备下载所有子字库文件之后, 必须进行解密处理后才能对所有子字库文件进行相应处 理., 以得到能够使用的字库文件。
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和 ¾围。 这样, 倘若本发明的这些修改和变型属于本发明权利要求及其等'同技术的范围之内, 则本发明也意:图包含这些改动和变型在内。

Claims

权 利 要 求 书
1、 一种下载字库文件的方法, 其特征在于, 该方法包括:
若用户设备需要下载的字库文件的容量大于该用户设备对应的网关的传输限制阈值, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值的子字库文件; 向所述用户设备发送所有的所述子字库文件。
2、 如权利要求 1所述的方法, 其特征在于, 对所述字库文件进行切分处理包括: 若所述字库文件中字型轮廓数据的容量大于所述传输限制闹值, 对所述字型轮廓数据 进行切分处理, 得到多个包括部分字型轮廓数据且容量不大于所述传输限制阈值的所述子 字库文件; 除字型轮廓数据之外的数据进行切分处理, 得到多个包含部分除字型轮廓数据之外的数据 且容量不大于所述传输限制阈值的所述子字库文件; 若所述字库文件中除字型轮廓数据之 外的数据的容量不大于所述传输限制阈值, 将所述字库文件中除字型轮廓数据之外的数据 作为一个所述子字库文件。
3、 如权利要求 1所述的方法, 其特征在于, 对所述字库文件进行切分处理包括: 若所述字库文件中除字型轮庫数据之外的数据的容量不大于所述传输限制阈值, 对所 述字型轮廓数据进行切分处理, 得到多个包含部分字型轮廓数据的所述子字库文件;
针对上述子字库文件中的任一个子字库文件, 将所述字库文件中除字型轮廓数据之外 的所有数据置于该子字库文件中, 且该子字库文件的容量不大于所述传输限制闹值。
4、 如权利要求〗所述的方法, 其特征在于, 该方法还包括:
用户设备下载所有子字库文件;
所述用户设备对所有所述子字库文件进行处理, 得到能够使用的字库文件。
5、 如权利要求 4所述的方法, 其特征在于, 所述用户设备对所有所述子字库文件进行 处理包括:
若包含部分字型轮廓数据的子字库文件中不包含除字型轮廓数据之外的数据, 将所有 进行合并处理, 得到能够使用的字库文件; 或 一个包含部分字型轮廓数据的子字库文件, 将该子字库文件与所有包含除字型轮廓数据之 外的数据的子字库文件进行合并处理, 得到一个能够使用的字库文件。
6、 如权利要求 4所述的方法, 其特征在于, 所述用户设备对所有所述子字库文件进行 处理包括:
若包含字型轮廓数据的子字库文件中包含除字型轮廓数据之外的所有数据, 将下载的 每个所述子字库文件作为一个能够使用的字库文件。
7、 一种下载字库文件的系统, 其特征在于, 该系统包括: 输限制阈值时, 对所述字库文件进行切分处理, 以得到多个容量不大于所述传输限制阈值 的子字库文件; 以及向所述用户设备发送所有的所述子字库文件;
用户设备, 用于下载所有子字库文件; 以及对所有所述子字库文件进行处理, 以得到 能够使用的字库文件。
8、 如权利要求 7所述的系统, 其特征在于,
所述用户设备还用于通过其对应的网关向服务器发送下载请求, 以获取所需的字库文 件;
所述服务器还用于在接收到用户设备发送的下载请求后, 根据用户设备的标识信息确 定该用户设备对应的网关, 从而确定该网关对应的传输限制阈值; 并根据用户设备发送的 下载请求确定需要下载的字库文件, 并根据所述字库文件的容量与传输限制阈值的关系确 定是否需要对字库文件进行切分处理。
9、 如权利要求 8所述的系统, 其特征在于, 所述用户设备的标识信息包括国际移动设 备识别码、 国际移动用户识别码、 移动台号薄号码、 客户识别模块中的至少一种。
10、 如权利要求 7所述的系统, 其特征在于, 所述服务器包括:
切分处理模块, 用于在用户设备需要下载的字库文件的容量大于该用户设备对应的网 关的传输限制闹值时, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制 阈值的子字库文件;
发送模块, 用于向所述用户设备发送所有的所述子字库文件。
11、 如权利要求 10所述的系统, 其特征在于, 所述切分处理模块具体用于: 时, 根据 述传输限制阈值确定所述需要下载的字库文件的切分单位, 并根据所迷切分单
Figure imgf000021_0001
阈值。
12、 如权利要求 11所述的系统, 其特征在于, 所述切分处理模块还用于根据所述切分 单位确定子字库文件的数量; 并建立多个空文件, 所述空文件的数量与所述子字库文件的 多个空文件中, 以得到多个容量不大于所述传输限制阈值的子字库文件。
13、 如权利要求 11所述的系统, 其特征在于, 所述切分处理模块还用于按照所述切分 的子字库文件, 而不保留所述字库文件。
14、 如权利要求 11所述的系统, 其特征在于,
所述切分处理模块还用于确定子字库文件的命名规则;
所述发送模块还用于向所述用户设备发送所述子字库文件的命名规则;
所述用户设备还用于在下载所有子字库文件和所述子字库文件的命名规则后, 根据所 述子字库文件的命名规则确定所有子字库文件的排序, 并根据所述排序将后一个子字库文 件逐一追加至前一个子字库文件的文件尾, 以完成所有子字库文件的合并处理, 从而得到 能够使用的字库文件。
15、 如权利要求 11所述的系统, 其特征在于,
所述切分处理模块还用于确定子字库文件的命名规则; 以及建立所述需要下载的字库 文件的索引文件, 该索引文件包括所述字库文件的容量、 所述切分单位以及所述子字库文 件的命名规則;
所述发送模块还用于向所述用户设备发送所述索引文件;
所述用户设备还用于在下载所有子字库文件及所述索引文件后, 根据所述索引文件确 定需要下载的每个子字库文件的文件名, 并建立对应的空文件以依次存储从发送模块下载 的子字库文件; 在下载子字库文件的过程中, 每个子字库文件的偏移量均从零开始实时记 录当前下载的子字库文件的下载偏移量, 以便于对下载的子字库文件进行合并处理, 从而 得到能够使用的字库文件。
16、 如权利要求 15所述的系统, 其特征在于, 所述用户设备还用于:
下载所有子字库文件的过程中, 若出现与服务器之间的中断, 且在恢复与所述服务器 的正常连接之后, 若仍需继续下载, 则先获取已完成下载的子字库文件的总容量, 然后将 该巳完成下载的子字库文件的总容量与所述需要下载的字库文件的切分单位进行运算, 设 定需要继续下载的子字库文件, 向所述服务器发送重新下载的请求, 从而实现断点续传。
17、 如权利要求 16所述的系统, 其特征在于, 所述用户设备还用于:
读取需要下载的字库文件的索引文件, 从而确定所述字库文件的容量及切分单位, 并 顺序判断已下载的每个子字库文件的容量, 以确定已下载的子字库文件是否完整; 针对每一个已下载的子字库文件, 若该子字库文件的容量不为零, 且获取该子字库文 件的容量与服务器中对应的子字库文件的实际容量一致, 则判定该子字库文件已经下载完 毕;
若该子字库文件的容量小于服务器中对应的子字库文件的实际容量, 则对服务器中对 应的子字库文件进行指针偏移, 具体偏移量为用户设备已下载的该子字库文件的容量值, 该子字库文件待下载的剩余的容量值为服务器中对应的子字库文件的实际容量与本地已经 下载的该子字库文件的容量之差。
18、 如权利要求 10所述的系统, 其特征在于, 所述切分处理模块具体用于: 时,
若所述字库文件中字型轮廓数据的容量不大于所述传输限制阈值, 且所述字库文件中 除字型轮廓数据之外的数据的容量不大于所述传输限制阈值, 则
对所述字库文件进行切分处理, 得到一个包含所述字库文件中字型轮廓数据的子字库 文件, 以及一个包含所述字库文件中除字型轮廓数据之外的数据的子字库文件;
或者, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值且包含 库文件;
若所述字库文件中字型轮廊数据的容量大于所述传输限制阈值, 且所述字库文件中除 字型轮廓数据之外的数据的容量不大于所述传输限制阈值, 则
对所述字库文件进行切分处理, 得到一个包含所述字库文件中除字型轮廓数据之外的 型轮廓数据的子字库文件;
或者, 对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值且包含 文件;
若所述字库文件中字型轮廓数据的容量大于所述传输限制阈值, 且所述字库文件中除 字型轮廓数据之外的数据的容量大于所迷传输限制阈值, 则
对所述字库文件进行切分处理, 得到多个容量不大于所述传输限制阈值且包含所述字 库文件中部分字型轮廓数据的子字库文件, 以及多个容量不大于所述传输限制阈值且包含 所述字库文件中部分除字型轮廓数据之外的数据的子字库文件;
若所述字库文件中字型轮廓数据的容量不大于传输限制阔值, 且所述字库文件中除字 型轮廓数据之外的数据的容量大于传输限制阈值, 则
对所述字库文件进行切分处理, 得到一个包含所述字库文件中字型轮廓数据的子字库 文件, 以及多个容量不大于所述传输限制阈值且包含所述字库文件中部分除字型轮廓数据 之外的数据的子字库文件。
19、 如权利要求 18所述的系统, 其特征在于,
所述切分处理模块还用于在对所述字库文件进行切分处理以形成包含所述字库文件中 部分字型轮廓数据的子字库文件时, 按照每个字型轮廓数据对应的国际字符编码、 ID序号 或国家标准对所述字库文件中的字型轮廓数据进行切分, 并建立切分规则;
所述发送模块还用于向所述用户设备发送所述切分规则;
所述用户设备还用于在下载所有子字库文件后, 根据所述切分规则对所有子字库文件 进行合并处理, 以得到能够使用的字库文件。
20、 如权利要求 18所述的系统, 其特征在于, 所述用户设备包括:
下载模块, 用于下载所有子字库文件;
处理模块 , 用于对所有所述子字库文件进行处理, 得到能够使用的字库文件。
21、 如权利要求 20所述的系统, 其特征在于, 所述处理模块具体用于:
若包含部分字型轮廓数据的子字库文件中不包含除字型轮廓数据之外的数据, 将所有包含部分字型轮廓数据的子字库文件与所有包含除字型轮靡数据之外的数据的 子字库文件进行合并处理, 得到能够使用的字库文件; 或
针对任一个包含部分字型轮廓数据的子字库文件, 将该子字库文件与所有包含除字型 轮廓数据之外的数据的子字库文件进行合并处理, 得到一个能够使用的字库文件;
若包含字型轮庫数据的子字库文件中包含除字型轮廓数据之外的所有数据, 将下载的 每个所述子字库文件作为一个能够使用的字库文件。
22、 如权利要求 10所述的系统, 其特征在于, 所述服务器还包括:
判断模块, 用于判断用户设备需要下载的字库文件的容量是否大于该用户设备对应的 网关的传输限制阈值, 在所述字库文件的容量大于该传输限制阈值时, 触发切分处理模块 工作; 在所述字库文件的容量不大于该传输限制阈值时, 触发发送模块将该字库文件直接 发送给用户设备。
23、 如权利要求 22所述的系统, 其特征在于, 所述服务器还包括压缩处理模块, 所述压缩处理模块用于在判断模块判断所述字库文件的容量大于该传输限制阈值时, 且在判断模块触发切分处理模块工作之前, 对所述字库文件进行压缩处理, 并在进行压缩 处理之后, 再次触发判断模块工作; 所
大于该用户设备对应的网关的传输限制阈值, 在所述压缩后的字库文件的容量大于该传输 限制阈值时, 触发切分处理模块工作; 在所述压缩后的字库文件的容量不大于该传输限制 阈值时, 触发发送模块将该压缩后的字库文件直接发送给用户设备;
所述用户设备还用于在下载所有子字库文件后, 对所述所有子字库文件进行处理, 得 到能够使用的压缩处理后的字库文件; 所述用户设备包括解压缩处理模块, 其用于对所迷 压缩后的字库文件进行解压缩处理, 从而得到能够使用的字库文件。
PCT/CN2012/088054 2011-12-31 2012-12-31 一种下载字库文件的方法和系统 WO2013097812A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2014521938A JP5753946B2 (ja) 2011-12-31 2012-12-31 フォントファイルをダウンロードする方法およびシステム
US14/130,664 US20140164574A1 (en) 2011-12-31 2012-12-31 Method and System for Downloading a Font File
KR1020147004150A KR101568947B1 (ko) 2011-12-31 2012-12-31 폰트 파일을 다운로드하는 방법 및 시스템

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110460619.7A CN103186644B (zh) 2011-12-31 2011-12-31 一种下载字库文件的方法、设备及系统
CN201110460619.7 2011-12-31

Publications (1)

Publication Number Publication Date
WO2013097812A1 true WO2013097812A1 (zh) 2013-07-04

Family

ID=48677813

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/088054 WO2013097812A1 (zh) 2011-12-31 2012-12-31 一种下载字库文件的方法和系统

Country Status (5)

Country Link
US (1) US20140164574A1 (zh)
JP (1) JP5753946B2 (zh)
KR (1) KR101568947B1 (zh)
CN (1) CN103186644B (zh)
WO (1) WO2013097812A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015107935A1 (ja) * 2014-01-18 2015-07-23 株式会社モリサワ フォント配信システム、及びフォント配信方法

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9473561B2 (en) * 2013-03-15 2016-10-18 International Business Machines Corporation Data transmission for transaction processing in a networked environment
EP3661122A3 (en) * 2014-05-14 2020-07-29 Pagecloud Inc. Methods and systems for web content generation
CN104965830B (zh) 2014-06-06 2018-07-17 腾讯科技(深圳)有限公司 一种字符更新方法及装置
CN105677646B (zh) * 2014-11-17 2019-03-01 北京大学 字库生成方法、字库生成系统和服务器
CN104506381A (zh) * 2014-12-16 2015-04-08 新余兴邦信息产业有限公司 一种通过仪表监控文件上传的方法及装置
CN106504333A (zh) * 2016-10-14 2017-03-15 海尔集团技术研发中心 一种实现三维模型在线快速浏览的方法和系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369953A (zh) * 2008-09-17 2009-02-18 北大方正集团有限公司 一种字库的网络分发方法及系统
CN101867617A (zh) * 2010-06-13 2010-10-20 优视科技有限公司 一种基于移动终端的文件上传方法、系统和上传服务器
CN102088696A (zh) * 2011-03-15 2011-06-08 广州市动景计算机科技有限公司 一种移动终端从目标服务器下载大文件的方法和系统
CN102129394A (zh) * 2010-01-14 2011-07-20 优必达科技有限公司 分布式计算方法及系统

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11242640A (ja) * 1998-02-25 1999-09-07 Kdd Corp ファイル転送方法
JP3171160B2 (ja) * 1998-03-20 2001-05-28 日本電気株式会社 圧縮ファイルサーバ方式
JPH11328058A (ja) * 1998-05-14 1999-11-30 Toshiba Corp データ処理システム
JP4354565B2 (ja) * 1999-03-04 2009-10-28 東芝テック株式会社 電子メールの送信方法、送信装置、受信方法、受信装置、および送受信システム
US6466983B1 (en) * 1999-09-30 2002-10-15 Steven Paul Strazza Systems and methods for controlling access to data maintained in a repository
JP2001117844A (ja) * 1999-10-20 2001-04-27 Nec Corp 無線通信システム及びそれに用いる無線クライアントの表示言語切替方法
US6952580B2 (en) * 2000-12-12 2005-10-04 The Directv Group, Inc. Multiple link internet protocol mobile communications system and method therefor
JP2002312279A (ja) * 2001-04-11 2002-10-25 Kenwood Corp 情報通信システム、ゲートウェイサーバ、その通信方法、及び情報通信端末
US6990079B2 (en) * 2001-06-08 2006-01-24 International Business Machines Corporation Optimizing fragment sizes in frame relay networks
FR2868226B1 (fr) * 2004-03-29 2006-05-26 Philippe Joliot Procede de transmission d'un fichier de donnees numeriques au travers de reseaux de telecommunications ou de radiocommunications
JP2006019802A (ja) * 2004-06-30 2006-01-19 Canon Inc Http通信装置
US7447836B2 (en) * 2006-02-14 2008-11-04 Software Site Applications, Limited Liability Company Disk drive storage defragmentation system
US20080240675A1 (en) * 2007-03-27 2008-10-02 Adam Berger Coordinating Audio/Video Items Stored On Devices
US8295615B2 (en) * 2007-05-10 2012-10-23 International Business Machines Corporation Selective compression of synchronized content based on a calculated compression ratio
CN101198016A (zh) * 2007-12-05 2008-06-11 中兴通讯股份有限公司 交互式个人电视媒体交付系统的内容发布和存储方法
CN101217638B (zh) * 2007-12-28 2012-10-24 深圳市迅雷网络技术有限公司 视频文件分段下载的方法、系统及装置
WO2010134919A1 (en) * 2009-05-21 2010-11-25 Hewlett-Packard Development Company, L.P. Generation of an individual glyph, and system and method for inspecting individual glyphs
US10033779B2 (en) * 2009-07-08 2018-07-24 Dejero Labs Inc. Multipath data streaming over multiple wireless networks
US8769050B2 (en) * 2009-10-16 2014-07-01 Celartern, Inc. Serving font files in varying formats based on user agent type
JP2011130363A (ja) * 2009-12-21 2011-06-30 Rtv:Kk 無線端末装置、コンテンツ送受信システム、サーバ装置及びプログラム
US8683006B2 (en) * 2010-07-17 2014-03-25 Adobe Systems Incorporated Method and systems for serving fonts during web browsing sessions
US20140372516A1 (en) * 2011-02-02 2014-12-18 Imvu Inc. System and method for providing a scalable translation between polling-based clients and connection-based message queues

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369953A (zh) * 2008-09-17 2009-02-18 北大方正集团有限公司 一种字库的网络分发方法及系统
CN102129394A (zh) * 2010-01-14 2011-07-20 优必达科技有限公司 分布式计算方法及系统
CN101867617A (zh) * 2010-06-13 2010-10-20 优视科技有限公司 一种基于移动终端的文件上传方法、系统和上传服务器
CN102088696A (zh) * 2011-03-15 2011-06-08 广州市动景计算机科技有限公司 一种移动终端从目标服务器下载大文件的方法和系统

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015107935A1 (ja) * 2014-01-18 2015-07-23 株式会社モリサワ フォント配信システム、及びフォント配信方法
JP2015135638A (ja) * 2014-01-18 2015-07-27 株式会社モリサワ フォント配信システム、及びフォント配信方法
US9984046B2 (en) 2014-01-18 2018-05-29 Morisawa Inc. Font delivery system and font delivery method

Also Published As

Publication number Publication date
CN103186644B (zh) 2016-09-21
JP2014526098A (ja) 2014-10-02
KR101568947B1 (ko) 2015-11-12
KR20140051310A (ko) 2014-04-30
JP5753946B2 (ja) 2015-07-22
US20140164574A1 (en) 2014-06-12
CN103186644A (zh) 2013-07-03

Similar Documents

Publication Publication Date Title
WO2013097812A1 (zh) 一种下载字库文件的方法和系统
CN102684827B (zh) 数据处理方法及数据处理设备
US8453040B2 (en) Obscuring information in messages using compression with site-specific prebuilt dictionary
EP3013015B1 (en) Packet compression method and apparatus
EP2863593B1 (en) A method, apparatus and computer program for modifying messages in a communications network
CN108512898B (zh) 文件推送方法、装置、计算机设备和存储介质
CN105677646A (zh) 字库生成方法、字库生成系统和服务器
CN106790334A (zh) 一种页面数据传输方法及系统
CN112165331A (zh) 数据压缩方法及其装置、数据解压方法及其装置、存储介质及电子设备
US10049089B2 (en) Methods for compressing web page menus and devices thereof
CN110413711B (zh) 一种差异数据获取方法及其存储介质
US20050256836A1 (en) HTML file processing technique
CN113273163A (zh) 文件上传方法、文件下载方法和文件管理装置
CN104023046B (zh) 移动终端识别方法和装置
CN105446975A (zh) 一种文件打包方法及装置
GB2512899A (en) A method, apparatus and computer program for adding content to a data container
EP2380098A1 (en) Dictionary-based data compression and subsequent data transmission in a server / client architecture
CN108881124B (zh) 在模块间实现高性能通信的方法、系统、存储介质及设备
CN108460044B (zh) 数据的处理方法和装置
CN113055455A (zh) 文件上传方法及设备
CN110519656B (zh) 自适应流媒体的播放方法、系统以及服务器
JP2011024179A (ja) Httpパケットにおけるハングルまたは日本語のデコード方法と装置、及びこれを用いたハングルまたは日本語ウェブコンテンツの分析方法
CN113900990A (zh) 文件分片存储方法、装置、设备及存储介质
US10168909B1 (en) Compression hardware acceleration
CN114125071B (zh) 数据压缩传输方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12861884

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14130664

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2014521938

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20147004150

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12861884

Country of ref document: EP

Kind code of ref document: A1