CN105718428A - Text output method and output device - Google Patents

Text output method and output device Download PDF

Info

Publication number
CN105718428A
CN105718428A CN201610049574.7A CN201610049574A CN105718428A CN 105718428 A CN105718428 A CN 105718428A CN 201610049574 A CN201610049574 A CN 201610049574A CN 105718428 A CN105718428 A CN 105718428A
Authority
CN
China
Prior art keywords
size
text
font
output
font size
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610049574.7A
Other languages
Chinese (zh)
Other versions
CN105718428B (en
Inventor
王亭慰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610049574.7A priority Critical patent/CN105718428B/en
Publication of CN105718428A publication Critical patent/CN105718428A/en
Application granted granted Critical
Publication of CN105718428B publication Critical patent/CN105718428B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention provides a variable-length text output method.The method comprises the steps that text is obtained, wherein the text is variable text; a font, a word size and resolution of output equipment are obtained; the text size is calculated according to the font, the word size and the resolution of the output equipment; the text size is compared with the size of an area to be output; the font and the word size are adjusted according to the comparison result.By means of the method, adaptive output of a form is completed, the variable-length text is matched with the area to be output, and the output effect and attractive degree are improved.Meanwhile, the invention provides an output device corresponding to the output method.

Description

The output intent of a kind of text and output device
Technical field
The present invention relates to logistics field, in particular it relates to the output intent of a kind of text and output device.
Background technology
Logistics distribution industry, each parcel label, it is used in the process transporting goods in order to record the document of sender, addressee and the relevant information such as product weight, price.The multiplex bar code express delivery list of current express delivery industry, automatic letter sorting machine can read bar code information and carry out automatic sorting, and dispensing person is delivered by address of the addressee and contact method.
About bar code express delivery list, market mainstream solution party is the template file first designing correspondence, the tag element such as figure, one-dimension code, Quick Response Code, picture, text are filled in the way of placeholder, text arranges fixing font size, when printing label, placeholder is replaced with corresponding data, then carries out resolving printing.
The printing type of this bar code express delivery list is not provided that the adaptation function of text.Such as: label address of the addressee is elongated, reserved address area is fixing, and text font size is fixing, when address of the addressee overlength, will cause that address prints complete, or overflow other content of covering when printing label.
Summary of the invention
In view of this, the present invention provides output intent and the output device of a kind of text, the particularly output of elongated text, it is adaptable to the bar code express delivery list used in output logistics field.
According to the first aspect of the invention, it is provided that the output intent of a kind of text, including: obtaining described text, described text is variable text;Obtain the resolution of font, font size and outut device;According to described go out font, font size and outut device resolution calculate described text size;The size of the size of described text and region to be output is compared;And described font and font size is adjusted according to comparative result.
Preferably, described adjust described font and font size according to comparative result and include: if the size of described text is more than the size in region to be output, described font size is reduced;If the size of described text is less than the size in region to be output, described font size is increased;And repeat the above steps, until obtain the ideal font size of described font.
Preferably, also include: according to described ideal font size, described text is updated in template, and exported by described outut device.
Preferably, described template includes the template of bar code express delivery list.
Preferably, described outut device includes printer and display.
According to the second aspect of the invention, it is provided that the output device of a kind of text, including: acquiring unit, it is used for obtaining the resolution of described text, font, font size and outut device, described text is elongated text;Computing unit, the resolution going out font, font size and outut device described in basis calculates the size of described text;Relatively adjustment unit, for comparing the size of described text and the size in region to be output;And described font and font size is adjusted according to comparative result.
Preferably, the described adjustment unit that compares includes: if the size of described text is more than the size in region to be output, reduced by described font size;If the size of described text is less than the size in region to be output, described font size is increased;And repeat the above steps, until obtain the ideal font size of described font.
Preferably, also include: output unit, for described text being updated in template according to described ideal font size, and exported by described outut device.
Preferably, described template includes the template of bar code express delivery list.
Preferably, described outut device includes printer and display.
The output intent of the elongated text that the embodiment of the present invention provides, including: obtaining described text, described text is variable text;Obtain the resolution of font, font size and outut device;According to described go out font, font size and outut device resolution calculate described text size;The size of the size of described text and region to be output is compared;And described font and font size is adjusted according to comparative result.The method completes the adaptive output of list, makes elongated text and Region Matching to be output, improves output effect and aesthetic measure.Present invention simultaneously provides the output device corresponding with described output intent.
Accompanying drawing explanation
By referring to the following drawings description to the embodiment of the present invention, the above-mentioned and other objects, features and advantages of the present invention will be apparent from, in the accompanying drawings:
Fig. 1 is the flow chart of the output intent of elongated text according to embodiments of the present invention;
Fig. 2 is the flow chart of the output intent of elongated according to another embodiment of the present invention text;
Fig. 3 is the structure chart of the output device of elongated text according to embodiments of the present invention.
Detailed description of the invention
Below based on embodiment, present invention is described, but the present invention is not restricted to these embodiments.In below the details of the present invention being described, detailed describe some specific detail sections.The description not having these detail sections for a person skilled in the art can also understand the present invention completely.In order to avoid obscuring the essence of the present invention, known method, process, flow process do not describe in detail.Additionally accompanying drawing is not necessarily drawn to scale.
Flow chart in accompanying drawing, the block diagram illustration system of the embodiment of the present invention, method, the possible System Framework of device, function and operation, square frame on flow chart and block diagram can represent a module, program segment or be only one section of code, and described module, program segment and code are all used to realize the executable instruction of regulation logic function.It should also be noted that the described executable instruction realizing regulation logic function can reconfigure, thus generating new module and program segment.Therefore the square frame of accompanying drawing and square frame order are used only to better illustrate process and the step of embodiment, and should in this, as the restriction to invention itself.
Fig. 1 is the flow chart of the output intent of elongated text according to embodiments of the present invention.Described output intent includes step 100-step 104.
In step 100, elongated text is obtained.Elongated text in step is that content is uncertain and the uncertain text of length.
In a step 101, the resolution of font, font size and outut device is obtained.In this step, the default configuration of outut device is obtained, including font, font size and resolution.
In a step 102, the size of elongated text is calculated according to the resolution of font, font size and outut device.In this step, calculate the space size that elongated text takies, namely space length and height.
In step 103, the size of the size of elongated text and region to be output is compared.
At step 104, font and font size are adjusted according to comparative result.
In step 100-104, before exporting elongated text, first calculate the text filed space size taken, and compare with region to be output, and adjust font size according to comparative result.In a preferred embodiment, if the space that elongated text takies is less than region to be output, then increase font size, otherwise reduce font size.
This mode is applied to list and prints, type list individual event adaptively.Such as, an address table individual event, output area is that 32 characters (are assumed, No. four words of the Song typeface), but someone address size is more than 32 characters, then when printing this people address, automatically reduce font size, so that this people address can be printed upon the region specified completely, be unlikely to overflow.In like manner, contrary situation increases font size, in order to avoid spare area is too many.
Fig. 2 is the flow chart of the output intent of elongated according to another embodiment of the present invention text.Described output intent includes step 200-step 206.
In step 200, elongated text is obtained.Elongated text in step is that content is uncertain and the uncertain text of length.
In step 201, the resolution of font, font size and outut device is obtained.
In this step, the acquiescence output obtaining elongated text is arranged, including the resolution of output font and font size and outut device.Outut device can be display device, or printing device, and in the display device, resolution can affect the output effect of elongated text.Such as, text exceedes screen width, or the form item printed exceedes given region, bad to the experience of user.
In step 202., the size of elongated text is calculated according to the resolution of font, font size and outut device.
In this step, calculate, according to above-mentioned parameter, length and the height that elongated text takes up room.
In step 203, the size of the size of elongated text and region to be output is compared.
In this step, the size taken up room by elongated text and the size in region to be output compare.Such as, by the length ratio of the length taken up room and on-screen display (osd) area relatively.Or by the length in the length of occupied area and height and space reserved on list and aspect ratio relatively.If the size of elongated text is more than the size in region to be output, perform step 204, if the size of elongated text is less than the size in region to be output, perform step 205, if equal, perform step 206.
In step 204, font size is reduced.
In step 205, font size is increased.
In step 206, obtain ideal font size, use ideal font size to export elongated text.
By step 204-step 206, obtain an elongated text and complete to specify ideal font size and the font of output, this elongated text is updated in template file, and according to this ideal font size and font, elongated text is submitted to outut device output.Template file herein is predefined text formatting, variable uses placeholder occupy-place therein.The template of text formatting is than the template file simple structure using the forms such as XML, PDF, it is not required that the support of third party's plug-in unit, as long as obtaining the content of text of this variable during parsing, uses text content to replace placeholder.Outut device includes display and printer.
Output intent shown in Fig. 2, the method than Fig. 1 is further.By repeatedly increasing or reducing font size, find the ideal font size that elongated text is corresponding.This method is applicable to adaptive text printing, is adapted to the situation of text change.It is particularly suited for printing various list, enables the elongated text in list content to carry out adaptive output.
Fig. 3 is the structure chart of the output device of elongated text according to embodiments of the present invention.Output device shown in Fig. 3 includes structure acquiring unit 301, computing unit 302, compares adjustment unit 303 and output unit 304.
Acquiring unit 301 is for obtaining the resolution of text, font, font size and outut device.Wherein, text is that content is uncertain and the uncertain elongated text of length.
Computing unit 302 goes out the size of the resolution elongated text of calculating of font, font size and outut device described in basis.According to the parameters obtained in acquiring unit 301, computing unit calculates the size taken up room of elongated text.
Relatively adjustment unit 303 is for comparing the size of described text and the size in region to be output, and adjusts described font and font size according to comparative result.Size comparison by the size taken up room calculated in computing unit 302 and region to be output.Best result should be just mate, but is generally not capable of obtaining such effect.Therefore font size adjustment is carried out according to comparative result, so that mating as much as possible between the two.
Output unit 304 is for being updated to elongated text in template according to ideal font size, and is exported by outut device.
In a preferred embodiment, the described adjustment unit 303 that compares includes: if the size of described text is more than the size in region to be output, reduced by described font size, if the size of described text is less than the size in region to be output, is increased by described font size;And repeat the above steps, until obtain the ideal font size of described font.
In a preferred embodiment, described template includes the template of bar code express delivery list.
In a preferred embodiment, described outut device includes printer and display.
Output device provided by the invention, solve the problem that in list, elongated text self adaptation prints, pass through custom built forms, elongated text is filled in placeholder, and by calculating the size (long and wide) that elongated text takes up room, and the size of the size taken up room and region to be output is compared, thus obtain a best font and font size.This kind of device is applied to the printing of the bar code express delivery list of logistics field, improves the printing effect of bar code express delivery list.
The modules of system or unit can pass through hardware, firmware or software and realize.Software such as includes the encoding procedure adopting the various programming languages such as JAVA, C/C++/C#, SQL to be formed.Although providing the step of the embodiment of the present invention and the order of step in method and method legend, but the executable instruction of the logic function of described step realization regulation can reconfigure, thus generating new step.The order of described step also should not be restricted solely to the sequence of steps in described method and method legend, it is possible to according to function need be adjusted at any time.Such as some step therein parallel or is performed according to reverse order.
System and a method according to the invention can be deployed on single or multiple server.For example, it is possible to different modules disposed respectively on a different server, form private server.Or, it is possible to functional unit, module or the system that distributed deployment is identical on multiple servers, to alleviate load pressure.Described server is included but not limited at same LAN and the multiple PCs connected by Internet, PC server, rolling reamer machine, supercomputer etc..
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, to those skilled in the art, the present invention can have various change and change.Any amendment of making within all spirit in the present invention and principle, equivalent replacement, improvement etc., should be included within protection scope of the present invention.

Claims (10)

1. an output intent for text, including:
Obtaining described text, described text is variable text;
Obtain the resolution of font, font size and outut device;
Resolution according to described font, font size and outut device calculates the size of described text;
The size of the size of described text and region to be output is compared;And
Described font and font size is adjusted according to comparative result.
2. output intent according to claim 1, wherein, described adjust described font and font size according to comparative result and includes:
If the size of described text is more than the size in region to be output, described font size is reduced;
If the size of described text is less than the size in region to be output, described font size is increased;And
Repeat the above steps, until obtaining the ideal font size of described font.
3. output intent according to claim 2, also includes: be updated in template by described text according to described ideal font size, and is exported by described outut device.
4. output intent according to claim 3, wherein, described template includes the template of bar code express delivery list.
5. output intent according to claim 3, wherein, described outut device includes printer and display.
6. an output device for text, including:
Acquiring unit, for obtaining the resolution of described text, font, font size and outut device, described text is elongated text;
Computing unit, the resolution going out font, font size and outut device described in basis calculates the size of described text;
Relatively adjustment unit, for comparing the size of described text and the size in region to be output;And described font and font size is adjusted according to comparative result.
7. output device according to claim 6, wherein, the described adjustment unit that compares includes:
If the size of described text is more than the size in region to be output, described font size is reduced;
If the size of described text is less than the size in region to be output, described font size is increased;And
Repeat the above steps, until obtaining the ideal font size of described font.
8. output device according to claim 7, also includes: output unit, for being updated in template by described text according to described ideal font size, and is exported by described outut device.
9. output device according to claim 8, wherein, described template includes the template of bar code express delivery list.
10. output device according to claim 8, wherein, described outut device includes printer and display.
CN201610049574.7A 2016-01-25 2016-01-25 A kind of output method and output device of text Active CN105718428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610049574.7A CN105718428B (en) 2016-01-25 2016-01-25 A kind of output method and output device of text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610049574.7A CN105718428B (en) 2016-01-25 2016-01-25 A kind of output method and output device of text

Publications (2)

Publication Number Publication Date
CN105718428A true CN105718428A (en) 2016-06-29
CN105718428B CN105718428B (en) 2018-10-02

Family

ID=56154049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610049574.7A Active CN105718428B (en) 2016-01-25 2016-01-25 A kind of output method and output device of text

Country Status (1)

Country Link
CN (1) CN105718428B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331828A (en) * 2016-08-19 2017-01-11 暴风集团股份有限公司 Method and system for adjusting subtitle according to picture
CN110889071A (en) * 2019-11-20 2020-03-17 山东中创软件工程股份有限公司 Text generation method, device and equipment and computer readable storage medium
CN112115708A (en) * 2020-08-31 2020-12-22 深圳市镜玩科技有限公司 Adaptive label display method, related device, equipment and medium
CN112198998A (en) * 2020-08-31 2021-01-08 深圳市镜玩科技有限公司 Text input control method, related device, equipment and medium
CN112652371A (en) * 2020-12-30 2021-04-13 湖南长城医疗科技有限公司 A nursing document designer and generate device for wisdom medical field
CN112677659A (en) * 2020-12-22 2021-04-20 厦门喵宝科技有限公司 Control method of portable intelligent printing device and printing device
TWI816181B (en) * 2021-09-09 2023-09-21 虹光精密工業股份有限公司 Document processing device, image processing method and computer program product
CN117236356A (en) * 2023-11-15 2023-12-15 冠骋信息技术(苏州)有限公司 Label on-line design and printing method based on WEB

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102082931A (en) * 2009-11-30 2011-06-01 新奥特(北京)视频技术有限公司 Method and device for self-adaptive adjustment of title areas
CN103577387A (en) * 2012-07-24 2014-02-12 腾讯科技(深圳)有限公司 Typeface changing method and device
CN105159868A (en) * 2015-09-01 2015-12-16 广东欧珀移动通信有限公司 Text display method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102082931A (en) * 2009-11-30 2011-06-01 新奥特(北京)视频技术有限公司 Method and device for self-adaptive adjustment of title areas
CN103577387A (en) * 2012-07-24 2014-02-12 腾讯科技(深圳)有限公司 Typeface changing method and device
CN105159868A (en) * 2015-09-01 2015-12-16 广东欧珀移动通信有限公司 Text display method and system

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331828A (en) * 2016-08-19 2017-01-11 暴风集团股份有限公司 Method and system for adjusting subtitle according to picture
CN106331828B (en) * 2016-08-19 2019-02-05 暴风集团股份有限公司 The method and system of subtitle are adjusted according to picture
CN110889071A (en) * 2019-11-20 2020-03-17 山东中创软件工程股份有限公司 Text generation method, device and equipment and computer readable storage medium
CN112115708A (en) * 2020-08-31 2020-12-22 深圳市镜玩科技有限公司 Adaptive label display method, related device, equipment and medium
CN112198998A (en) * 2020-08-31 2021-01-08 深圳市镜玩科技有限公司 Text input control method, related device, equipment and medium
CN112677659A (en) * 2020-12-22 2021-04-20 厦门喵宝科技有限公司 Control method of portable intelligent printing device and printing device
CN112677659B (en) * 2020-12-22 2022-09-09 厦门喵宝科技有限公司 Control method of portable intelligent printing device and printing device
CN112652371A (en) * 2020-12-30 2021-04-13 湖南长城医疗科技有限公司 A nursing document designer and generate device for wisdom medical field
TWI816181B (en) * 2021-09-09 2023-09-21 虹光精密工業股份有限公司 Document processing device, image processing method and computer program product
CN117236356A (en) * 2023-11-15 2023-12-15 冠骋信息技术(苏州)有限公司 Label on-line design and printing method based on WEB

Also Published As

Publication number Publication date
CN105718428B (en) 2018-10-02

Similar Documents

Publication Publication Date Title
CN105718428A (en) Text output method and output device
US8935607B2 (en) Method, apparatus and system of displaying webpages
KR101101828B1 (en) Image forming control apparatus, image forming apparatus and control method of the same
US20180074999A1 (en) Systems and methods for automatically reformatting publications
US11640685B2 (en) Technology for managing graphic design using metadata relationships
CN105095166A (en) Method for generating stream-type electronic book and website system
CN106326522B (en) Automated 3D font for manufacturing designs
US10750036B1 (en) Rapid workflow design using machine learning
CN107612966A (en) Feed information feedback processing methods and system
CN117420974B (en) Thermal printer page mode control method and related device
US20210125386A1 (en) Systems and methods for clipping images
CN103034990B (en) The method and apparatus of publication verification
US11380031B2 (en) Technology for enabling elastic graphic design
US11138647B2 (en) Method, device, and computer-readable storage medium for managing variations of a graphic design within a framework
US8817285B2 (en) Method and apparatus for printing HTML content
JP2010221429A (en) Label printer and information processor
CN102521327A (en) Method and system for demonstrating electronic form
JP2009238179A (en) Variable printing method using web, variable printing system using web, and received data processing device
US10204083B2 (en) Computer systems and methods using multiple neutral type characters as delimiters between segments in structured, multi-segment data values
KR20060098669A (en) Method for printing web page
WO2023172525A1 (en) System and method for combining data sources in a package printing system
CN117931106A (en) Cloud printer data processing method and related device based on edge computing
Sankaliya et al. Wavelet Based Image Fusion
JP2017168894A (en) Information processing apparatus, information processing method, and program
JP2015229329A (en) Printing system, printing control method, and printing control program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant