CN106776527B - Electronic book data display method and device and terminal equipment - Google Patents

Electronic book data display method and device and terminal equipment Download PDF

Info

Publication number
CN106776527B
CN106776527B CN201611155950.7A CN201611155950A CN106776527B CN 106776527 B CN106776527 B CN 106776527B CN 201611155950 A CN201611155950 A CN 201611155950A CN 106776527 B CN106776527 B CN 106776527B
Authority
CN
China
Prior art keywords
data
line
poetry
font size
chinese
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611155950.7A
Other languages
Chinese (zh)
Other versions
CN106776527A (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.)
Zhangyue Technology Co Ltd
Original Assignee
Zhangyue 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 Zhangyue Technology Co Ltd filed Critical Zhangyue Technology Co Ltd
Priority to CN201611155950.7A priority Critical patent/CN106776527B/en
Publication of CN106776527A publication Critical patent/CN106776527A/en
Application granted granted Critical
Publication of CN106776527B publication Critical patent/CN106776527B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/189Automatic justification

Abstract

The embodiment of the invention provides a method, a device and a terminal device for displaying electronic book data, wherein the method for displaying the electronic book data comprises the following steps: analyzing the data of the electronic book according to a set analysis rule, and determining Chinese poetry data to be displayed according to an analysis result; determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line; and displaying the Chinese poetry data according to the font size. By the embodiment of the invention, the Chinese poems in each line can be completely displayed in one line, the typesetting and displaying effect of the Chinese poems is optimized, and the experience of reading electronic books by users is improved.

Description

Electronic book data display method and device and terminal equipment
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a method and a device for displaying electronic book data and terminal equipment.
Background
Along with the popularization of terminal equipment, more and more people read electronic books on the terminal equipment, the electronic book reading through the terminal equipment has the advantages of environmental protection, low power consumption, large storage capacity, convenience for a user to carry and the like.
At present, when the electronic book is typeset, if the size of the font of the electronic book is adjusted, the too large or too small adjustment of the font of the electronic book can affect the typesetting effect of the electronic book, for example, the Chinese poetry in the electronic book is typeset, the size of the font of the electronic book is adjusted, the too large adjustment is carried out, one sentence of the Chinese poetry is displayed incompletely in one line, so that one sentence of the Chinese poetry is displayed in two lines, the typesetting of other contents of the Chinese poetry can be affected, the typesetting of the Chinese poetry is disordered, and the experience of a user for reading the electronic book is.
Disclosure of Invention
The embodiment of the invention provides a method and a device for displaying data of an electronic book and a terminal device, and aims to solve the problems that typesetting of Chinese poems is disordered and experience of reading the electronic book by a user is poor when typesetting the electronic book at present.
According to an aspect of an embodiment of the present invention, there is provided a method for displaying electronic book data, including:
analyzing the data of the electronic book according to a set analysis rule, and determining Chinese poetry data to be displayed according to an analysis result;
determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line;
and displaying the Chinese poetry data according to the font size.
According to another aspect of an embodiment of the present invention, there is provided a display apparatus of electronic book data, including:
the data analysis module is used for analyzing the e-book data according to a set analysis rule and determining Chinese poetry data to be displayed according to an analysis result;
the font determining module is used for determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line;
and the data display module is used for displaying the Chinese poetry data according to the font size.
According to another aspect of the embodiments of the present invention, there is also provided a terminal device, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the display method of the electronic book data.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing: the executable instruction is used for analyzing the electronic book data according to a set analysis rule and determining the Chinese poetry data to be displayed according to an analysis result; an executable instruction for determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line; and executable instructions for displaying the Chinese poetry data according to the font size.
According to the method, the device and the terminal equipment for displaying the electronic book data, provided by the embodiment of the invention, the electronic book data are analyzed according to the set analysis rule, the Chinese poetry data to be displayed are determined according to the analysis result, the font size of each line of poetry is determined according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, and the Chinese poetry data are displayed according to the font size. Compared with the traditional method that when typesetting is carried out on Chinese poetry, the font size of the Chinese poetry is adjusted, so that one line or one sentence of the Chinese poetry cannot be completely displayed in one line, the embodiment of the invention determines the displayable text data of each line according to the text number of each line of poetry and the typesetting width of the electronic book, thereby realizing that each line of the Chinese poetry can be completely displayed in one line, optimizing the typesetting and displaying effect of the Chinese poetry, and improving the experience of a user for reading the electronic book.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for displaying electronic book data according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a method for displaying electronic book data according to a second embodiment of the present invention;
FIG. 3 is a block diagram of a display device for displaying data of an electronic book according to a third embodiment of the present invention;
fig. 4 is a block diagram of a display device for electronic book data according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal device according to a fifth embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the invention is provided in conjunction with the accompanying drawings (like numerals indicate like elements throughout the several views) and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present invention are used merely to distinguish one element, step, device, module, or the like from another element, and do not denote any particular technical or logical order therebetween.
Example one
Referring to fig. 1, a flowchart illustrating steps of a method for displaying electronic book data according to an embodiment of the present invention is shown.
The method for displaying electronic book data in this embodiment may be implemented by any suitable terminal device, such as a smart phone, a tablet computer, or a desktop computer, but is not limited thereto, and other devices with similar data processing functions may refer to the method for displaying electronic book data in this embodiment, and this is not limited in this embodiment of the present invention. The present embodiment is only described by taking a terminal device as an example, and a screen of the terminal device is narrower than other devices, so that when an electronic book is read by using a related electronic book reading application, the problem of displaying electronic book data, especially the data of chinese poetry is more likely to occur.
The method for displaying the data of the electronic book of the embodiment comprises the following steps:
and S100, analyzing the data of the electronic book according to a set analysis rule, and determining the data of the Chinese poems to be displayed according to an analysis result.
In this embodiment, the electronic book data may be regarded as any form of data stored or recorded in the electronic book medium, such as text, symbols, tables, graphics, and the like, and the specific content of the electronic data is not limited in this embodiment. The electronic book medium may be any medium supported by the terminal device or an operating system and an application of the terminal device, such as a file in txt text format, a file in chm text format, and the like.
In this embodiment, the chinese poetry data may be regarded as poetry data conforming to a certain format, such as five-language absolute sentence, seven-language absolute sentence, and the like.
In step S100, the data of the electronic book is analyzed, and then the data of the chinese poems to be displayed is determined from the data of the electronic book. The e-book data may be the data of the chinese poetry to be displayed, and may also be data including the data of the chinese poetry to be displayed, and other characters and/or pictures.
And S102, determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line.
In this embodiment, the number of characters in each line of poetry in the chinese poetry data may be the same or different, and the layout width of the electronic book is usually narrower than the screen width of the terminal device because space needs to be reserved for some set regions such as a margin region and a remark region.
In this embodiment, each line of poetry may be regarded as each sentence of poetry, and the display form of a certain chinese poetry is "XXXXX, yyyy". "where" xxxxxx "may be considered a line or a sentence of poetry," YYYYY "may be considered another line or another sentence of poetry. Through this step, the font size of each text in "xxxxxx" or "YYYYY" can be determined, such that "xxxxxx" is displayed completely in one row and "YYYYY" is displayed completely in the other row.
And step S104, displaying the Chinese poetry data according to the font size.
After determining the font size of each character in the chinese poetry in step S102, the chinese poetry data may be displayed according to the determined font size, where the font size may be considered as the font size or the pixel value corresponding to the font size, and the specific representation form of the font size is not limited in this embodiment.
According to the method for displaying the e-book data, provided by the embodiment, the e-book data is analyzed according to a set analysis rule, the Chinese poetry data to be displayed is determined according to an analysis result, the font size of each line of poetry is determined according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the e-book, and the Chinese poetry data is displayed according to the font size. Compared with the traditional method for typesetting Chinese poetry, the method for typesetting Chinese poetry has the advantages that the font size of the Chinese poetry is adjusted, so that one line or one sentence of the Chinese poetry cannot be completely displayed in one line, the displayable text data of each line is determined according to the text number of each line of poetry and the typesetting width of the electronic book, so that the Chinese poetry of each line can be completely displayed in one line, the typesetting display effect of the Chinese poetry is optimized, and the experience of a user in reading the electronic book is improved.
Example two
Referring to fig. 2, a flowchart illustrating steps of a method for displaying electronic book data according to a second embodiment of the present invention is shown.
The method for displaying electronic book data in this embodiment may be implemented by any suitable terminal device, such as a smart phone, a tablet computer, or a desktop computer, but is not limited thereto, and other devices with similar data processing functions may refer to the method for displaying electronic book data in this embodiment.
The present embodiment is based on the above embodiments, and the differences from the above embodiments are emphasized, and reference may be made to the description and illustration of the above embodiments for the same points.
The method for displaying the data of the electronic book of the embodiment comprises the following steps:
and S200, analyzing the data of the electronic book according to a set analysis rule, and determining the data of the Chinese poems to be displayed according to an analysis result.
In this embodiment, the chinese poetry data to be displayed may be determined in any one or more of the following three ways, including:
the first method is as follows: and determining the Chinese poetry data to be displayed according to the number of the characters and the number of lines of the Chinese poetry.
The method comprises the steps of breaking lines of electronic book data to obtain character data of each line, identifying the number of characters of the character data of each line, judging whether the number of lines of the character data of a plurality of continuous lines is equal to the set number of lines if the number of the characters of the character data of a plurality of continuous lines is equal to the set number of lines, and determining the character data of a plurality of continuous lines as Chinese poetry data to be displayed if the number of lines of the character data of a plurality of continuous lines is equal to the set number of. The number of the set characters and the number of the set lines can be set properly by those skilled in the art according to actual needs and specific situations of Chinese poems, which is not limited in the embodiment of the present invention. For example, 4 consecutive lines of alphanumeric data each equal 5 or 7, etc.
The method includes the steps of cutting off lines of electronic book data to obtain each line of character data, is suitable for the condition that the electronic book data are not cut off or are disordered, and is specifically realized in a mode that the typesetting marks in the electronic book data are obtained, and the character data between two adjacent typesetting marks are determined to be a line of character data. In this embodiment, the layout identifier includes at least one of the following: punctuation, symbols, spaces. For example, the e-book data is "# xxxxxx, YYYYY. ", the typesetting marks" # "," and "are obtained. "the layout marks" # "and" xxxxxx "between", "are determined as one line of character data, and" are set. "yyyy" between "is determined as a line of character data. For another example, the electronic book data is "xxxxxx yyyyyy", a "space" layout mark exists between "xxxxxx" and "YYYYY", and "xxxxxx" is a start part of the electronic book data, and "yyyy" is an end part of the electronic book data, and the start part of the electronic book data, or "xxxxxx" before "space", is determined as a line of character data, and the end part of the electronic book data, or "YYYYY" after "space", is determined as a line of character data.
If the set number of characters in the set analysis rule is 5 and the set number of lines is 4, determining character data of 4 continuous lines and character data of 5 characters in each line of character data as the Chinese poetry data to be displayed.
The second method comprises the following steps: and carrying out grammatical analysis on the data of the electronic book, and determining the data of the Chinese poems to be displayed according to the result of the grammatical analysis.
The syntactic analysis is performed on the e-book data, which is suitable for the situation that the number of characters or the number of rows of characters in the e-book data is not standard and irregular, and the syntactic analysis needs to be performed on the character data in the e-book data, such as analyzing characters belonging to a subject, an object, a fixed language, a shape, and the like. The syntax analysis of the e-book data may be implemented by any appropriate related technology, such as a trained syntax analysis network model, and the specific technical means used for syntax analysis is not limited in this embodiment.
The third method comprises the following steps: acquiring character type labels carried in electronic book data, and determining character data with the character type labels marked as Chinese poems as the Chinese poems data to be displayed.
If the e-book data carries a text type tag, the meaning of the text type tag to the text data can be identified, for example, a certain e-book data carries three text type tags, which are respectively text type tags b1, b2 and b3, a text type tag b1 is used for marking a name of a person, for example, text data "bob" is marked as a b1 tag, a text type tag b2 is used for marking a quotation, for example, text data "relativity" is marked as a b2 tag, and a text type tag b3 is used for marking a Chinese poem, for example, text data "white day is kept in mountain, yellow river is entered into ocean current. "is labeled b 3. Thus, the character data "white-day-mountain-based, yellow-river-based, ocean-going according to the character type label b3 can be obtained. "determined as the data of the chinese poetry to be displayed.
Step S202, dividing the typesetting width of the electronic book by the number of characters of each line of poetry to obtain the font size of each line of poetry.
In step S202, the electronic book layout width may be regarded as the maximum electronic book layout width, the obtained font size of each line of poetry may be regarded as the maximum font size of each line of poetry, and one line or one sentence of poetry may be completely displayed in one line according to the font size. However, in practical applications, due to differences in screen manufacturing processes and hardware parameters of the terminal devices, even if the screen is displayed according to a certain font size, a problem that a line of poems cannot be completely displayed in a line may occur. Therefore, the embodiment of the invention provides a further optimization scheme, namely, the size of the font is finely adjusted to ensure the complete display of a line of poems in a line. One possible fine tuning operation is shown in steps S204 to S208. It should be noted that the following steps S204 to S208 are optional steps, and need not be executed in the case where a line of poems can be completely displayed in a line according to the determined font size.
And step S204, pre-displaying the Chinese poetry data according to the font size.
In the step S204, the pre-display of the chinese poetry data is not the actual display of the chinese poetry data, and the pre-display operation is invisible to the user, so that whether the font size is appropriate or not and whether further fine adjustment is required or not is determined according to the pre-display result.
Step S206, judging whether the font size needs to be adjusted or not according to the pre-display result, and executing step S208 if the font size needs to be adjusted; if the font size does not need to be adjusted, step S210 is executed, and the chinese poetry data is displayed according to the font size obtained in step S202.
In this step S206, it is determined whether the font size needs to be adjusted, specifically, it may be determined whether each line of poetry in the pre-displayed chinese poetry data is completely displayed in one line, and if there is one line of chinese poetry or one sentence of chinese poetry that cannot be completely displayed in one line, it is determined that the font size needs to be adjusted.
And step S208, adjusting the font size according to the set adjustment rule.
For example, the display pixel value corresponding to the font size may be reduced by a preset pixel.
In this embodiment, the preset pixels are preferably 1 to 3 pixels, so that when a line of poetry is completely displayed in a line, the font size does not need to be adjusted greatly or determined again, the data processing load of font size adjustment is reduced, and the font size adjustment efficiency is improved. In the practical application process, how many pixels are specifically selected from 1-3 pixels can be set according to practical situations, and the embodiment does not limit the specific pixels which are reduced when the font size is adjusted.
And step S210, displaying the Chinese poetry data according to the determined font size.
If the font size is adjusted, the step displays the Chinese poetry data according to the adjusted font size; if the font size is not adjusted, the step displays the Chinese poetry data according to the font size obtained in the step S202.
According to the method for displaying the e-book data, provided by the embodiment, the e-book data is analyzed according to a set analysis rule, the Chinese poetry data to be displayed is determined according to an analysis result, the font size of each line of poetry is determined according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the e-book, and the Chinese poetry data is displayed according to the font size. Compared with the traditional method for typesetting Chinese poetry, the method for typesetting Chinese poetry has the advantages that the font size of the Chinese poetry is adjusted, so that one line or one sentence of the Chinese poetry cannot be completely displayed in one line, the displayable text data of each line is determined according to the text number of each line of poetry and the typesetting width of the electronic book, so that the Chinese poetry of each line can be completely displayed in one line, the typesetting display effect of the Chinese poetry is optimized, and the experience of a user in reading the electronic book is improved.
When determining the Chinese poetry data to be displayed, the embodiment can determine the Chinese poetry data to be displayed through three modes according to different formats of character data in the electronic book data. If the number of words and the number of lines of the character data in the electronic book data are relatively standard, the Chinese poetry data to be displayed can be determined according to the set number of words and the set number of lines; if the number of words and the number of lines of character data in the electronic book data are irregular, the Chinese poetry data to be displayed can be determined according to the result of the grammatical analysis of the electronic book data; if the e-book data carries the character type label, the Chinese poetry data to be displayed can be determined according to the character type label for marking the Chinese poetry. The embodiment provides rich Chinese poetry data determining modes, is suitable for various electronic book data, and enlarges the application range of determining the Chinese poetry data to be displayed according to the electronic book data.
In the embodiment, after the font size of the Chinese poetry data is determined, the font size can be further adjusted to adapt to the difference of displaying the Chinese poetry on screens of different terminal devices, so that the display effect of the Chinese poetry data is improved.
EXAMPLE III
Referring to fig. 3, a block diagram of a display device for electronic book data according to a third embodiment of the present invention is shown.
The display device of the electronic book data of the embodiment includes: the data analysis module 300 is configured to analyze the e-book data according to a set analysis rule, and determine the chinese poetry data to be displayed according to an analysis result; the font determining module 302 is configured to determine the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the layout width of the electronic book, so that each line of poetry is completely displayed in one line; and the data display module 304 is configured to display the Chinese poetry data according to the font size.
According to the display device for the electronic book data provided by the embodiment, the electronic book data is analyzed according to the set analysis rule, the Chinese poetry data to be displayed is determined according to the analysis result, the font size of each line of poetry is determined according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, and the Chinese poetry data is displayed according to the font size. Compared with the traditional method for typesetting Chinese poetry, the method for typesetting Chinese poetry has the advantages that the font size of the Chinese poetry is adjusted, so that one line or one sentence of the Chinese poetry cannot be completely displayed in one line, the displayable text data of each line is determined according to the text number of each line of poetry and the typesetting width of the electronic book, so that the Chinese poetry of each line can be completely displayed in one line, the typesetting display effect of the Chinese poetry is optimized, and the experience of a user in reading the electronic book is improved.
The display device of the e-book data of the present embodiment may be disposed in a suitable device with data processing capability, including but not limited to a mobile terminal, a desktop computer, and the like.
Example four
Referring to fig. 4, a block diagram of a display device for electronic book data according to a fourth embodiment of the present invention is shown.
The display device of the electronic book data of the embodiment includes: the data analysis module 400 is configured to analyze the e-book data according to a set analysis rule, and determine the chinese poetry data to be displayed according to an analysis result; a font determining module 402, configured to determine a font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the layout width of the electronic book, so that each line of poetry is completely displayed in one line; and a data display module 404, configured to display the chinese poetry data according to the font size.
Optionally, the data display module 404 includes: the pre-display module 4040 is used for pre-displaying the Chinese poetry data according to the font size; a size determining module 4042, configured to determine whether the font size needs to be adjusted according to the pre-display result; the adjusting module 4044 is configured to adjust the font size according to a set adjustment rule if the font size needs to be adjusted; the display module 4046 is configured to display the chinese poetry data according to the adjusted font size.
Optionally, the adjusting module 4044 is configured to reduce the display pixel value corresponding to the font size by a preset pixel.
Optionally, the adjusting module 4044 is configured to reduce the display pixel value corresponding to the font size by 1 to 3 pixels.
Optionally, the data analysis module 400 comprises: the line breaking module 4000 is used for breaking the line of the electronic book data to obtain each line of text data; the recognition module 4002 is used for recognizing the number of characters in each line of character data; the line number judging module 4004 is configured to, if the number of the consecutive lines of text data is equal to the set number of text, judge whether the number of lines of the consecutive lines of text data is equal to the set number of lines; the first determining module 4006 is configured to determine, if the number of rows of the consecutive rows of text data is equal to the set number of rows, the consecutive rows of text data as to-be-displayed chinese poetry data.
Optionally, the trip module 4000 comprises: the identification acquisition module is used for acquiring the typesetting identification in the electronic book data; and the line determining module is used for determining the character data between two adjacent typesetting marks as the character data of each line.
Optionally, the layout identifier includes at least one of: punctuation, symbols, spaces.
Optionally, the data analysis module 400 comprises: and the grammar analysis module 4008 is used for carrying out grammar analysis on the e-book data and determining the Chinese poetry data to be displayed according to the grammar analysis result.
Optionally, the data analysis module 400 comprises: the tag obtaining module 4010 is configured to obtain a text type tag carried in the electronic book data; the second determining module 4012 is configured to determine the text data in which the text type tag is marked as the chinese poetry data to be displayed.
Optionally, the font determining module 402 is configured to divide the electronic book typesetting width by the number of characters in each line of poetry to obtain the font size of each line of poetry.
The display device of electronic book data of this embodiment is used to implement the display method of the corresponding electronic book data in the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the terminal device.
As shown in fig. 5, the terminal device may include: a processor (processor)510, a Communications Interface 520, a memory 530, and a communication bus 540.
Wherein:
processor 510, communication interface 520, and memory 530 communicate with one another via a communication bus 540.
A communication interface 520 for communicating with network elements such as servers or other terminal equipment.
The processor 510 is configured to execute the program 532, and may specifically perform the relevant steps in the above method embodiments.
In particular, the program 532 may include program code comprising computer operating instructions.
Processor 510 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention. The terminal device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
A memory 530 for storing related e-book data and programs 532. Memory 530 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 532 may specifically be used to cause the processor 510 to perform the following operations: analyzing the data of the electronic book according to a set analysis rule, and determining Chinese poetry data to be displayed according to an analysis result; determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line; and displaying the Chinese poetry data according to the font size.
In an alternative embodiment, program 532 is further configured to cause processor 510 to pre-display the chinese poetry data according to font size when displaying the chinese poetry data according to font size; judging whether the font size needs to be adjusted or not according to a pre-displayed result; if the font size needs to be adjusted, adjusting the font size according to a set adjustment rule; and displaying the Chinese poetry data according to the adjusted font size.
In an alternative embodiment, the program 532 is further configured to enable the processor 510 to reduce the display pixel value corresponding to the font size by the preset pixel when the font size is adjusted according to the set adjustment rule.
In an alternative embodiment, the program 532 is further configured to enable the processor 510 to reduce the display pixel value corresponding to the font size by 1 to 3 pixels when the display pixel value corresponding to the font size is reduced by the preset pixel.
In an alternative embodiment, the program 532 is further configured to enable the processor 510 to, when analyzing the electronic book data according to a set analysis rule and determining the chinese poetry data to be displayed according to the analysis result, break the line of the electronic book data to obtain each line of text data; identifying the number of characters of each line of character data; if the number of the characters of the continuous multi-line character data is equal to the set number of the characters, judging whether the number of lines of the continuous multi-line character data is equal to the set number of lines; and if the number of lines is equal to the set number of lines, determining continuous lines of character data as the Chinese poetry data to be displayed.
In an optional implementation manner, the program 532 is further configured to enable the processor 510 to obtain a layout identifier in the electronic book data when breaking the line of the electronic book data to obtain each line of text data; and determining the text data between two adjacent typesetting marks as a row of text data.
In an alternative embodiment, the layout identifier includes at least one of: punctuation, symbols, spaces.
In an alternative embodiment, the program 532 is further configured to enable the processor 510 to perform syntax analysis on the electronic book data when analyzing the electronic book data according to the set analysis rule, determining the chinese poetry data to be displayed according to the analysis result, and determining the chinese poetry data to be displayed according to the syntax analysis result.
In an alternative embodiment, the program 532 is further configured to enable the processor 510 to obtain a character type tag carried in the electronic book data when analyzing the electronic book data according to a set analysis rule and determining the chinese poetry data to be displayed according to an analysis result; and determining the character data with the character type labels marked as the Chinese poems as the Chinese poem data to be displayed.
In an alternative embodiment, the program 532 is further configured to enable the processor 510 to divide the electronic book layout width by the number of characters of each line of poetry to obtain the font size of each line of poetry when determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the layout width of the electronic book.
For specific implementation of each step in the program 532, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing embodiments, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
According to the terminal device provided by the embodiment, the electronic book data is analyzed according to the set analysis rule, the Chinese poetry data to be displayed is determined according to the analysis result, the font size of each line of poetry is determined according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, and the Chinese poetry data is displayed according to the font size. Compared with the traditional method for typesetting Chinese poetry, the method for typesetting Chinese poetry has the advantages that the font size of the Chinese poetry is adjusted, so that one line or one sentence of the Chinese poetry cannot be completely displayed in one line, the displayable text data of each line is determined according to the text number of each line of poetry and the typesetting width of the electronic book, so that the Chinese poetry of each line can be completely displayed in one line, the typesetting display effect of the Chinese poetry is optimized, and the experience of a user in reading the electronic book is improved.
It should be noted that the electronic book data display scheme provided in the embodiment of the present invention is applicable to a scene in which electronic book data is displayed by using an electronic book reading application, but is not limited to this, and other scenes similar to this are also applicable.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the display method of electronic book data described herein. Further, when a general-purpose computer accesses code for implementing the displays shown herein, execution of the code transforms the general-purpose computer into a special-purpose computer for performing the displays shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.
The embodiment of the invention provides a1 and a method for displaying electronic book data, which comprises the following steps:
analyzing the data of the electronic book according to a set analysis rule, and determining Chinese poetry data to be displayed according to an analysis result;
determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line;
and displaying the Chinese poetry data according to the font size.
A2, the method according to a1, wherein the displaying the chinese poetry data according to the font size includes:
pre-displaying the Chinese poetry data according to the font size;
judging whether the font size needs to be adjusted or not according to the pre-displayed result;
if the font size needs to be adjusted, adjusting the font size according to a set adjustment rule;
and displaying the Chinese poetry data according to the adjusted font size.
A3, the method according to A2, wherein the adjusting the font size according to the set adjustment rule includes:
and reducing the display pixel value corresponding to the font size by a preset pixel.
A4, the method according to A3, wherein the reducing the display pixel value corresponding to the font size by a preset pixel comprises:
and reducing the display pixel value corresponding to the font size by 1 to 3 pixels.
A5, the method according to A1, wherein the analysis of the e-book data according to the set analysis rules and the determination of the Chinese poetry data to be displayed according to the analysis results comprises:
breaking the lines of the electronic book data to obtain each line of character data;
identifying the number of characters of each line of character data;
if the number of the characters of the continuous multi-line character data is equal to the set number of the characters, judging whether the number of lines of the continuous multi-line character data is equal to the set number of lines;
and if the number of lines is equal to the set number of lines, determining continuous lines of character data as the Chinese poetry data to be displayed.
A6, the method according to A5, wherein the line breaking of the electronic book data to obtain each line of the character data includes:
acquiring a typesetting identifier in the electronic book data;
and determining the character data between two adjacent typesetting marks as a row of character data.
A7, the method according to A6, wherein the layout identification includes at least one of: punctuation, symbols, spaces.
A8, the method according to A1, wherein the analysis of the e-book data according to the set analysis rules and the determination of the Chinese poetry data to be displayed according to the analysis results comprises:
and carrying out grammatical analysis on the electronic book data, and determining Chinese poetry data to be displayed according to a grammatical analysis result.
A9, the method according to A1, wherein the analysis of the e-book data according to the set analysis rules and the determination of the Chinese poetry data to be displayed according to the analysis results comprises:
acquiring a character type label carried in the electronic book data;
and determining the character data of which the character type labels are marked as Chinese poems as the Chinese poem data to be displayed.
A10, determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the layout width of the electronic book, and including:
and dividing the typesetting width of the electronic book by the number of characters of each line of poetry to obtain the font size of each line of poetry.
An embodiment of the present invention further provides B11, a display device of electronic book data, including:
the data analysis module is used for analyzing the e-book data according to a set analysis rule and determining Chinese poetry data to be displayed according to an analysis result;
the font determining module is used for determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line;
and the data display module is used for displaying the Chinese poetry data according to the font size.
B12, the device according to B11, wherein the data display module comprises:
the pre-display module is used for pre-displaying the Chinese poetry data according to the font size;
the size judging module is used for judging whether the font size needs to be adjusted or not according to the pre-displayed result;
the adjusting module is used for adjusting the font size according to a set adjusting rule if the font size needs to be adjusted;
and the display module is used for displaying the Chinese poetry data according to the adjusted font size.
B13, and the apparatus according to B12, wherein the adjusting module is configured to reduce the display pixel value corresponding to the font size by a preset pixel.
B14, the apparatus according to B13, wherein the adjusting module is configured to reduce the display pixel value corresponding to the font size by 1 to 3 pixels.
B15, the device according to B11, wherein the data analysis module comprises:
the line breaking module is used for breaking the line of the electronic book data to obtain each line of character data;
the identification module is used for identifying the character quantity of each line of character data;
the line number judging module is used for judging whether the line number of the continuous multi-line character data is equal to the set line number or not if the character number of the continuous multi-line character data is equal to the set character number;
the first determining module is used for determining the continuous multi-line character data as the Chinese poetry data to be displayed if the line number of the continuous multi-line character data is equal to the set line number.
B16, the device according to B15, wherein the line breaking module comprises:
the identification acquisition module is used for acquiring the typesetting identification in the electronic book data;
and the row determining module is used for determining the character data between two adjacent typesetting marks as a row of character data.
B17, the apparatus according to B16, wherein the typesetting identification includes at least one of: punctuation, symbols, spaces.
B18, the apparatus of B11, wherein the data analysis module comprises: a syntax analysis module;
and the grammar analysis module is used for carrying out grammar analysis on the electronic book data and determining the Chinese poetry data to be displayed according to the grammar analysis result.
B19, the device according to B11, wherein the data analysis module comprises:
the tag acquisition module is used for acquiring a character type tag carried in the electronic book data;
and the second determining module is used for determining the character data of which the character type labels are marked as Chinese poems as the Chinese poem data to be displayed.
And B20, the device according to B11, wherein the font determining module is configured to divide the electronic book typesetting width by the number of characters of each line of poetry to obtain the font size of each line of poetry.
The embodiment of the present invention further provides C21, a terminal device, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the display method of the electronic book data as described in any one of A1-A10.

Claims (17)

1. A display method of electronic book data comprises the following steps:
analyzing the data of the electronic book according to a set analysis rule, and determining Chinese poetry data to be displayed according to an analysis result; determining Chinese poetry data to be displayed according to the number of words and the number of lines of the Chinese poetry; or, carrying out grammar analysis on the e-book data, and determining Chinese poetry data to be displayed according to a grammar analysis result; or acquiring a character type label carried in the electronic book data, and determining character data marked as Chinese poems by the character type label as the Chinese poems data to be displayed;
determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line;
and displaying the Chinese poetry data according to the font size.
2. The method of claim 1, wherein displaying the Chinese poetry data according to the font size comprises:
pre-displaying the Chinese poetry data according to the font size;
judging whether the font size needs to be adjusted or not according to the pre-displayed result;
if the font size needs to be adjusted, adjusting the font size according to a set adjustment rule;
and displaying the Chinese poetry data according to the adjusted font size.
3. The method of claim 2, wherein adjusting the font size according to a set adjustment rule comprises:
and reducing the display pixel value corresponding to the font size by a preset pixel.
4. The method of claim 3, wherein reducing the display pixel value corresponding to the font size by a preset pixel comprises:
and reducing the display pixel value corresponding to the font size by 1 to 3 pixels.
5. The method of claim 1, wherein analyzing the e-book data according to a set analysis rule, and determining the chinese poetry data to be displayed according to the analysis result comprises:
breaking the lines of the electronic book data to obtain each line of character data;
identifying the number of characters of each line of character data;
if the number of the characters of the continuous multi-line character data is equal to the set number of the characters, judging whether the number of lines of the continuous multi-line character data is equal to the set number of lines;
and if the number of lines is equal to the set number of lines, determining continuous lines of character data as the Chinese poetry data to be displayed.
6. The method of claim 5, wherein breaking lines of the electronic book data to obtain each line of the character data comprises:
acquiring a typesetting identifier in the electronic book data;
and determining the character data between two adjacent typesetting marks as a row of character data.
7. The method of claim 6, wherein the layout identification comprises at least one of: punctuation, symbols, spaces.
8. The method of claim 1, wherein determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the layout width of the electronic book comprises:
and dividing the typesetting width of the electronic book by the number of characters of each line of poetry to obtain the font size of each line of poetry.
9. A display device of electronic book data, comprising:
the data analysis module is used for analyzing the e-book data according to a set analysis rule and determining Chinese poetry data to be displayed according to an analysis result;
the font determining module is used for determining the font size of each line of poetry according to the number of characters of each line of poetry in the Chinese poetry data and the typesetting width of the electronic book, so that each line of poetry is completely displayed in one line;
the data display module is used for displaying the Chinese poetry data according to the font size;
wherein the data analysis module is further to: determining Chinese poetry data to be displayed according to the number of words and the number of lines of the Chinese poetry; or, the data analysis module comprises: the grammar analysis module is used for carrying out grammar analysis on the electronic book data and determining Chinese poetry data to be displayed according to a grammar analysis result; or, the data analysis module comprises: the tag acquisition module is used for acquiring a character type tag carried in the electronic book data; and the second determining module is used for determining the character data of which the character type labels are marked as the Chinese poems as the Chinese poem data to be displayed.
10. The apparatus of claim 9, wherein the data display module comprises:
the pre-display module is used for pre-displaying the Chinese poetry data according to the font size;
the size judging module is used for judging whether the font size needs to be adjusted or not according to the pre-displayed result;
the adjusting module is used for adjusting the font size according to a set adjusting rule if the font size needs to be adjusted;
and the display module is used for displaying the Chinese poetry data according to the adjusted font size.
11. The apparatus of claim 10, wherein the adjusting module is configured to reduce a display pixel value corresponding to the font size by a preset pixel.
12. The apparatus of claim 11, wherein the adjusting module is configured to reduce the display pixel value corresponding to the font size by 1 to 3 pixels.
13. The apparatus of claim 9, wherein the data analysis module comprises:
the line breaking module is used for breaking the line of the electronic book data to obtain each line of character data;
the identification module is used for identifying the character quantity of each line of character data;
the line number judging module is used for judging whether the line number of the continuous multi-line character data is equal to the set line number or not if the character number of the continuous multi-line character data is equal to the set character number;
the first determining module is used for determining the continuous multi-line character data as the Chinese poetry data to be displayed if the line number of the continuous multi-line character data is equal to the set line number.
14. The apparatus of claim 13, wherein the outage module comprises:
the identification acquisition module is used for acquiring the typesetting identification in the electronic book data;
and the row determining module is used for determining the character data between two adjacent typesetting marks as a row of character data.
15. The apparatus of claim 14, wherein the layout identification comprises at least one of: punctuation, symbols, spaces.
16. The apparatus of claim 9, wherein the font determining module is configured to divide the electronic book typesetting width by the number of characters of each line of poetry to obtain the font size of each line of poetry.
17. A terminal device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the display method of the electronic book data according to any one of claims 1 to 8.
CN201611155950.7A 2016-12-14 2016-12-14 Electronic book data display method and device and terminal equipment Active CN106776527B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611155950.7A CN106776527B (en) 2016-12-14 2016-12-14 Electronic book data display method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611155950.7A CN106776527B (en) 2016-12-14 2016-12-14 Electronic book data display method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN106776527A CN106776527A (en) 2017-05-31
CN106776527B true CN106776527B (en) 2020-03-17

Family

ID=58888014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611155950.7A Active CN106776527B (en) 2016-12-14 2016-12-14 Electronic book data display method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN106776527B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113298741B (en) * 2020-11-13 2024-01-12 阿里巴巴集团控股有限公司 Picture synthesis method and device and electronic equipment
CN112711674A (en) * 2020-12-28 2021-04-27 维沃移动通信有限公司 Method and device for generating song list
CN114546192B (en) * 2021-12-31 2023-11-28 北京达佳互联信息技术有限公司 Content display processing method and device and content display method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008083316A2 (en) * 2006-12-29 2008-07-10 Amazon Technologies, Inc. Invariant referencing in digital works
CN101645970A (en) * 2009-05-15 2010-02-10 上海闻泰电子科技有限公司 Method and device for adjusting test font size of mobile terminal
CN101916174A (en) * 2010-06-28 2010-12-15 汉王科技股份有限公司 Display method and device thereof, treatment method and device thereof for electronic document handwriting
CN102521280A (en) * 2011-11-26 2012-06-27 华为技术有限公司 Loading method and loading device of EPub electronic book
CN103268185A (en) * 2013-04-26 2013-08-28 珠海全志科技股份有限公司 Text display method and text display device for e-book reader
US8655411B2 (en) * 2005-08-23 2014-02-18 Samsung Electronics Co., Ltd Method and apparatus of displaying a character input in a portable terminal
CN104239282A (en) * 2014-09-09 2014-12-24 百度在线网络技术(北京)有限公司 Processing method and device for electronic book
CN104915332A (en) * 2015-06-15 2015-09-16 广东欧珀移动通信有限公司 Method and device for generating composing template

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8655411B2 (en) * 2005-08-23 2014-02-18 Samsung Electronics Co., Ltd Method and apparatus of displaying a character input in a portable terminal
WO2008083316A2 (en) * 2006-12-29 2008-07-10 Amazon Technologies, Inc. Invariant referencing in digital works
CN101645970A (en) * 2009-05-15 2010-02-10 上海闻泰电子科技有限公司 Method and device for adjusting test font size of mobile terminal
CN101916174A (en) * 2010-06-28 2010-12-15 汉王科技股份有限公司 Display method and device thereof, treatment method and device thereof for electronic document handwriting
CN102521280A (en) * 2011-11-26 2012-06-27 华为技术有限公司 Loading method and loading device of EPub electronic book
CN103268185A (en) * 2013-04-26 2013-08-28 珠海全志科技股份有限公司 Text display method and text display device for e-book reader
CN104239282A (en) * 2014-09-09 2014-12-24 百度在线网络技术(北京)有限公司 Processing method and device for electronic book
CN104915332A (en) * 2015-06-15 2015-09-16 广东欧珀移动通信有限公司 Method and device for generating composing template

Also Published As

Publication number Publication date
CN106776527A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US8830241B1 (en) Image conversion of text-based images
US11455460B2 (en) Method for displaying handwritten note in electronic book, electronic device and computer storage medium
CN107688789B (en) Document chart extraction method, electronic device and computer readable storage medium
CN106776527B (en) Electronic book data display method and device and terminal equipment
CN109492177B (en) web page blocking method based on web page semantic structure
CN111309671B (en) Method and device for exporting PDF (Portable document Format) from web report and storage medium
CN108804469B (en) Webpage identification method and electronic equipment
US8386943B2 (en) Method for query based on layout information
CN110244921A (en) Label printing method, device, electronic equipment and system
CN112417826B (en) PDF online editing method and device, electronic equipment and readable storage medium
US9977794B2 (en) Management apparatus, design management method, and non-transitory computer readable medium
CN106095270B (en) Method for displaying key sentences and determining mark range, terminal device and server
CN116311300A (en) Table generation method, apparatus, electronic device and storage medium
CN105260353A (en) Typesetting method and device for mobile terminal
US20150331837A1 (en) Text processing method and mobile terminal
JP5715172B2 (en) Document display device, document display method, and document display program
CN106598934B (en) Display methods, device and the terminal device of electronic book data
CN113038184B (en) Data processing method, device, equipment and storage medium
CN115034177A (en) Presentation file conversion method, device, equipment and storage medium
CN104156345A (en) Method and device for identifying explanatory text in portable document format file
CN105335346B (en) A kind of Text Extraction and device of PDF document
CN115686492A (en) H5 page editing method and device
CN113836462A (en) Page description file generation method, device, equipment and storage medium
CN113268949A (en) Form display method and device based on dynamic field, computer equipment and medium
CN106776489B (en) Electronic document display method and system of display device

Legal Events

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