Disclosure of Invention
The present invention provides a method and an apparatus for displaying an electronic book, so as to improve the above problems.
A first embodiment of the present invention provides a display method of an electronic book, including:
analyzing and typesetting the selected electronic book file, wherein: selecting a background picture corresponding to each pre-displayed page from a preset background picture library;
and generating and displaying the content of the specified page, including the text picture and the selected background picture.
The pre-displayed page comprises a plurality of pages which are obtained through typesetting and determine the text content to be displayed.
Wherein, the display method further comprises: when the color of the text on the displayed text picture is the same as or similar to the main tone of the background picture, the color of the text is automatically adjusted to form contrast color with the main tone of the background picture, and further the text content is clearly highlighted.
A second embodiment of the present invention provides a display method of an electronic book, including:
analyzing and typesetting the selected electronic book file, wherein: performing semantic recognition on the text content typeset on the pre-displayed pages, determining the attention information of each pre-displayed page, and selecting a background picture associated with the attention information of each pre-displayed page from a preset background picture library;
and generating and displaying the content of the specified page, including the text picture and the selected associated background picture.
The pre-displayed page comprises a plurality of pages which are obtained through typesetting and determine the text content to be displayed.
The focus information refers to a center of gravity to be expressed by text content to be displayed on each page, and includes, but is not limited to: event, weather, environment, scenery, character, animal, or plant.
Wherein, the display method further comprises: and setting priorities for the attention information in advance, and when 2 or more attention information is determined to exist on a certain pre-displayed page, selecting a background picture associated with the determined attention information with the highest priority from a preset background picture library.
Wherein, the display method further comprises: when it is determined that there are 2 or more pieces of attention information on a certain pre-displayed page, selecting background pictures associated with each piece of attention information from a preset background picture library, respectively, and displaying the selected background pictures according to a predetermined rule when displaying the content of a specified page.
Wherein, the display method further comprises: and when a certain pre-displayed page is not identified to have the attention information or a background picture associated with the attention information is not found from a preset background picture library, displaying a default background picture when the content of the specified page is displayed.
Wherein, the display method further comprises: when the color of the text on the displayed text picture is the same as or similar to the main tone of the background picture, the color of the text is automatically adjusted to form contrast color with the main tone of the background picture, and further the text content is clearly highlighted.
A third embodiment of the present invention provides an apparatus for displaying an electronic book, including:
the analysis unit is used for analyzing the selected electronic book file;
the typesetting engine is used for typesetting the parsed text;
the background picture selection unit is used for selecting a background picture corresponding to each pre-displayed page from a preset background picture library;
and the display unit is used for generating and displaying the content of the specified page, including the text picture and the selected background picture.
A fourth embodiment of the present invention provides an apparatus for displaying an electronic book, including:
the analysis unit is used for analyzing the selected electronic book file;
the typesetting engine is used for typesetting the analyzed text;
the attention information identification unit is used for carrying out semantic identification on the text content typeset on the pre-displayed pages and determining the attention information of each pre-displayed page;
the background picture selection unit is used for selecting a background picture associated with the attention information of each pre-displayed page from a preset background picture library;
and the display unit is used for generating and displaying the content of the specified page, including the text picture and the selected associated background picture.
Wherein, the focus information refers to the gravity center to be expressed by the text content to be displayed on each page, which includes but is not limited to: event, weather, environment, scenery, character, animal, or plant.
The device also comprises a priority setting unit which is used for setting the priority of the different concerned information determined by the concerned information identification unit.
The background picture selection unit is used for selecting a background picture associated with the determined attention information with the highest priority from a preset background picture library.
Wherein, when the background picture selection unit is used for selecting a plurality of corresponding background pictures associated with a plurality of the attention information from a preset background picture library, the display unit displays the selected plurality of background pictures according to a preset rule when displaying the content of a specified page.
Wherein, when the background picture selection unit does not find the background picture associated with the attention information in a preset background picture library, the display unit displays a default background picture when displaying the content of a specified page.
Wherein the apparatus further comprises:
the color analysis unit is used for analyzing whether the color of the text on the text picture to be displayed is the same as or similar to the main tone of the background picture;
and the text color adjusting unit is used for automatically adjusting the text color when the color of the text on the text picture to be displayed is the same as or similar to the main tone of the background picture, so that the text color and the main tone of the background picture form contrast color, and the text content can be clearly highlighted.
A fifth embodiment of the invention provides a memory device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to the first or second embodiment.
According to the method and the device for displaying the electronic book, provided by the embodiment of the invention, different background pictures are displayed for each page of the electronic book, the defect that each page of the electronic book displayed after the background picture is set only uses the set single background picture in design is overcome, the background picture associated with each plot can be automatically displayed according to different main plot parts described by each page of content of the electronic book, different background pictures are dynamically generated for each page of content, so that a user cannot generate visual monotone when reading the electronic book, the coordination and matching of characters, colors and backgrounds are realized, and the good reading experience of the user is greatly improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention and the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
People often install electronic book reading software on intelligent electronic products such as smart phones or smart tablet computers to read electronic books and the like. When the electronic book file in various formats, such as txt, umd, epub, chm, pdf, or the like, is opened by using the reading software, the electronic book file needs to be parsed, such as decompression, format parsing, and description language parsing, and then a typesetting engine in the electronic book reading software typesets the parsed text, such as font, font size and font style setting, paging processing, and the like, which can be implemented by using the prior art.
The conventional method for opening an e-book starts an e-reading software APP installed on a smart phone or a smart tablet computer to enter a home page of the e-book. Displaying one or more electronic books on a home page or other special electronic book list pages, displaying a corresponding shortcut icon for each electronic book, and opening the electronic book to enter a reading scene and display a reading page through a touch instruction generated by touching the shortcut icon. Obviously, the instruction for opening the electronic book on the user interface is also not limited to touch control, for example, when the electronic reading software APP has a function of executing a voice instruction, the electronic book instructed by the voice may be opened by receiving the voice instruction of the user, and the electronic book enters a reading page of the electronic book.
Currently, a page displayed by an electronic book corresponds to a text picture and a background picture. The background picture refers to a picture only containing background content of the displayed page and not containing text content, and the text picture refers to a picture only containing text content of the displayed page and not containing background content. At present, the default background picture is a transparent picture, and is usually a pure color, such as white, black, pink, blue, etc. And, after setting the background picture, each page of the displayed electronic book uses only the set single background picture.
Aiming at the design defect that each page of the existing electronic book displayed after the background picture is set only uses the set single background picture, in order to improve the visual monotony sense of a user in the reading process, the inventor of the application proposes a design concept that: and automatically displaying different background pictures for each page of the displayed electronic book. A specific process for implementing this design concept is described below by way of a first embodiment.
Fig. 1 is a flowchart of a method for displaying an electronic book according to a first embodiment of the present invention. As shown in fig. 1, the method for displaying an electronic book of the present invention includes:
s1: analyzing and typesetting the selected electronic book file, wherein: and selecting a background picture corresponding to each pre-displayed page from a preset background picture library.
The selected e-book file is a certain e-book text opened by an e-book reader, which may be an e-book file stored on a local storage medium or an e-book text loaded through a network.
The pre-displayed page includes a plurality of pages determined to be the text content to be displayed, which is obtained through the typesetting process, and this can be implemented through the existing known paging technology. Generally, a smart phone or a tablet computer equipped with an electronic reading APP product, or an electronic book reader specially used for reading an electronic book performs paging processing on the electronic book when the electronic book is opened, and the number of pages of a page and the number of characters in each page can be determined in a subsequent reading process. The paging information after paging processing may include the number of pages, position information or page number of each page in the electronic book, the number of characters in each page, the start and stop positions of the characters, and the like. For a simple illustration: the paging unit in the typesetting engine can page the electronic book according to the set display parameters and font parameters of the electronic reader, for example, calculate the number of pages of the opened electronic book, mark the position information or page number of each page in the electronic book, make a list, the number of characters in each page, and the starting and ending positions of the characters displayed in each page in the electronic book, for example, the characters displayed in page 1 include from 1 character to 128 character, and the characters displayed in page 2 include from 129 character to 300 character … until the last page. The set display parameters comprise the width and the height of a screen, the frame width of a character display area, the character line spacing and the like; the font parameters include font, font size, etc.
When the electronic book is opened by using the electronic reading APP, because characters displayed on a screen are displayed in the form of page images, up to several M memory spaces are required for rendering 1 page image, and one book is displayed on a terminal device and may reach thousands of pages or even tens of thousands of pages, the contents of the whole book cannot be typeset and rendered at one time, and generally a few pages are pre-rendered, that is, a few pages to be displayed, such as 3 pages, 5 pages, 7 pages and the like, are predetermined.
The preset background picture library is a preset background picture library which stores a plurality of background pictures, and the plurality of stored background pictures can be a plurality of pure-color background pictures without patterns with different colors, can also be a plurality of background pictures with different patterns, and can also be both the background pictures with different patterns. The specific content of the background picture is not limited herein.
The selection method may be random selection or selection in a designated order.
S2: and generating and displaying the content of the specified page, including the text picture and the selected background picture.
The generation and display of the content of the specified page, i.e. the display of the text picture and the selected background picture, can be implemented using any generation and display method known in the art, not too much.
In the first embodiment, if it is determined that the dominant hue of the selected background picture is the same as or similar to the color of the text on the text picture of the pre-displayed page, the color of the text is automatically adjusted to form a contrast color with the dominant hue of the background picture, so that the text content can be clearly highlighted. That is, when the color of the text on the displayed text picture is the same as or similar to the dominant hue of the background picture, the color of the text is automatically adjusted to form a contrast color with the dominant hue of the background picture, so that the text content can be clearly highlighted.
The contrasting colors are two types of colors with completely different individuality, and are two colors which can be distinguished obviously, such as red and green, blue and orange, black and white, purple and yellow, and the like, or dark and light colors, bright and dark colors, and the like. When the text color on the text picture and the main tone of the background picture form contrast color, the text content can be clearly displayed, and the reading of a user is facilitated.
In the first embodiment, the background pictures corresponding to each pre-displayed page are selected from a preset background picture library, and the background pictures of each page may be different, or the background pictures of partial pages may be different and the background pictures of partial pages are the same. For example, it is assumed that the different background pictures selected are pure color unpatterned background pictures of different colors, the different colors including: pink, white, yellow, green, blue, purple, black, etc., then page 1 background picture can be pink, page 2 background picture can be white … … page 7 background picture can be black, page 8 background picture can be pink, page 9 background picture can be white … …, and so on.
According to the method for displaying the electronic book provided by the first embodiment of the invention, different background pictures are displayed for each page of the electronic book, and the defect that each page of the electronic book displayed after the background picture is set only uses the set single background picture is overcome, so that a user cannot generate visual monotone when reading the electronic book, and the reading experience of the user is improved.
However, merely achieving automatic display of different background pictures for each page of a displayed electronic book is not sufficient for a user to expect a good reading experience. Can the special setting of the background picture further improve the user's good experience of using an electronic reading APP product (e.g., a flag novel APP)? To achieve this, the inventors propose an improved design concept: and selecting attention information aiming at each page content of the displayed electronic book, and automatically selecting a background picture associated with the attention information from a preset background picture library. A specific procedure for realizing this improved design concept will be described below by way of a second embodiment.
Fig. 2 is a flowchart of a method for displaying an electronic book according to a second embodiment of the present invention. As shown in fig. 2, the method for displaying an electronic book of the present invention includes:
s21: analyzing and typesetting the selected electronic book file, wherein: performing semantic recognition on the text content typeset on the pre-displayed pages, and determining the attention information of each pre-displayed page; and selecting a background picture associated with the attention information of each pre-displayed page from a preset background picture library.
The selected electronic book file is the same as that described in the first embodiment, that is, a certain electronic book text opened by an electronic book reader, and may be an electronic book file stored on a local storage medium or an electronic book text loaded through a network.
The pre-displayed page is also the same as that described in the first embodiment, and includes a plurality of pages determined to display text content through the typesetting process, which may be implemented by a paging technique known in the art. The description is not repeated here.
In the typesetting process, semantic recognition can be carried out on the text content typeset on the pre-displayed pages, and then the attention information of each pre-displayed page is determined. Semantic recognition of textual content may be performed using semantic recognition methods known in the art. The focus information refers to the center of gravity to be expressed by the text content to be displayed on each page, and includes but is not limited to: event, weather, environment, scenery, character, animal, or plant. The center of gravity to be expressed by the text content mentioned here, in other words, refers to the main part expressed by the text content displayed on the page, for example: competition in a game field, snow, clean indoor layout, beautiful scenery, depiction of character features, introductions about animals, introductions about plants, and the like.
In order to enable the wide and different attention information to have corresponding background pictures as much as possible, a background picture library storing a plurality of different background pictures can be preset, the plurality of background pictures are classified in multiple categories, and each category of the categories can be classified in multiple levels according to different dimensions, so that the plurality of background pictures can be stored in the background picture library in multiple categories and multiple levels.
The various category classifications may include, but are not limited to: characters, matches, weather, environments, landscapes, animals, plants, actions, martial arts … …, and the like.
For the classification of each category, multiple classification methods can be adopted for performing multi-level classification according to different dimensions, and the implementation manner of multi-level classification is described below by using a specific example, but the specific example is not limited as the only feasible method for multi-level classification. In addition, the multi-level classification method under different classes can be different, and a proper multi-level classification method is freely selected according to the respective characteristics of each class.
The character classification can be further divided into the following steps: cartoon character images, mythological character images, sports star images authorized for use, movie star images, singer images … …, and the like, may be subdivided into sub-categories … … such as multi-level subdivisions based on gender, age, skilled skills, and the like, under different character image classifications.
The game classification can be subdivided into: soccer, basketball, volleyball, tennis, rowing, sprinting, racing, bicycling … …, etc., sub-categories … … may be subdivided at different levels, such as according to gender, age, playing specifications (e.g., olympic games, international games, domestic games, etc.), etc., under different play scenarios.
The landscape classification can be subdivided into: natural scenery, artificial scenery, scenery … … combined with natural scenery and artificial scenery, under natural scenery the subclasses can be subdivided again according to the different scenes: sea scenery, glacier scenery, mountain scenery, grassland scenery, field scenery … …, etc., under artificial scenery, subclasses can be subdivided again according to different scenes: modern style buildings, ancient style buildings, Chinese style buildings, western style buildings, castle buildings, artificial canal … …, and the like; such as such a multi-level subdivision.
……
……
Such as the multi-level subdivision described by way of example above, and will not be further enumerated. After reading the description herein, those skilled in the art can easily design a suitable multi-level classification method according to the characteristics of different classification categories.
The following describes multi-level classification according to different dimensions by taking weather-snow as an example. The picture library can be provided with a weather category, and subdivided categories such as raining, frosting, wind blowing, snowing and the like are arranged under the weather category. When there are many background picture material about snowing, the subdivision can continue according to sub-dimensions, for example: storm snow, big snow, small snow, plain snow, forest snow, wind and snow overtaking … … and the like, thereby realizing multi-level subdivision subclasses under the weather big class.
In the implementation process of selecting the background picture associated with the attention information of each pre-displayed page from the preset background picture library, the minimum classification associated with the attention information can be found, and one picture is randomly selected from a plurality of background pictures stored under the classification as the associated background picture. The name of each saved background picture can also be set as the name capable of clearly expressing the content of the picture, and when the name of the picture is matched with the content of the attention information or the name of the picture contains the content of the attention information, the picture is selected as the associated background picture.
The following proceeds to describe an implementation process of selecting a background picture associated with the attention information of each pre-displayed page from a preset background picture library by a specific example.
As described in the first embodiment, when the electronic book is opened by using the electronic reading APP, since the text displayed on the screen is displayed in the form of page images, up to several M memory spaces are required for rendering 1 page image, and a book is displayed on the terminal device for possibly thousands of pages or even tens of thousands of pages, the content of the whole book is not typeset and rendered at one time, and typically a few pages are pre-rendered, that is, a few pages to be displayed, such as 3 pages, 5 pages, 7 pages, etc., are pre-determined.
Assuming that the pre-displayed page is 3 pages, it can be known which characters are contained on each page to be pre-displayed during paging processing in the typesetting process, and semantic recognition is respectively performed on the character contents on each page of the 3 pages by a known semantic recognition method, assuming that the character contents of the 3 pages are the scene of tracing the cruise ship navigating at sea, for example, the beginning content of a book in the "city of the city". Because of the screen size limitation of the smartphone, the attention information identified from the page content displayed on the screen is mostly 1, for example, the attention information of the page 1 content is a marine scene navigating at sea, and a scene picture about the marine scene is selected from the background picture library as the background picture of the page 1; the concerned information of the page 2 content is the scene on the cruise ship deck, and at the moment, the picture related to the cruise ship deck is selected from the background picture library to be used as the background picture of the page 2; the focus information of the content on page 3 is the appearance of a specific character on the cruise ship, and at this time, an image picture of a character corresponding to the appearance of the specific character is selected from the background picture library as the background picture of page 3, for example, if the specific character is a young and beautiful woman, an image picture of a star of a woman that is relatively close to the words of the appearance can be selected from the background picture library as the background picture of page 3.
However, despite the small screen size of the smartphone, there is also a possibility of identifying 2 different pieces of attention or more from the content of the page displayed on the screen. If the electronic book is read through an electronic device such as a tablet computer with a larger screen size, the possibility of identifying 2 different pieces of attention or more different pieces of attention from the displayed page content is higher due to the fact that the number of characters contained in the displayed page content is larger. For example, in martial arts books, weather or surrounding scenery is often described in a martial arts scene, where 2 or more different pieces of interesting information, such as martial arts, weather, scenery, are easily identified from the content of the screen-displayed pages.
In one embodiment, the method for displaying an electronic book further includes: and setting priorities for the attention information in advance, and when 2 or more attention information is determined to exist on a certain pre-displayed page, selecting a background picture associated with the determined attention information with the highest priority from a preset background picture library. That is, priorities are set in advance for classification categories to which the central words of the above-mentioned plural pieces of attention information belong, and when 2 or more pieces of attention information on a certain pre-displayed page are determined by semantic recognition, a picture associated with the determined attention information of the highest priority is selected from a preset background picture library as a corresponding background picture based on the determined priorities of the plural pieces of attention information.
S22: and generating and displaying the content of the specified page, including the text picture and the selected associated background picture.
The generation and display of the content of the specified page, i.e. the display of the text picture and the selected background picture, can be implemented using any generation and display method known in the art, not too much.
In the second embodiment, when it is determined that there are 2 or more pieces of attention information on a certain pre-displayed page, processing may be performed by other methods than the above-described processing method of setting priority. In another specific embodiment, the method for displaying an electronic book further includes: when it is determined that there are 2 or more pieces of attention information on a certain pre-displayed page, selecting background pictures associated with each piece of attention information from a preset background picture library, respectively, and displaying the selected background pictures according to a predetermined rule when displaying the content of a specified page. That is, when it is determined through semantic recognition that there are 2 or more different pieces of attention information on a certain pre-displayed page, a picture associated with each piece of attention information is selected from a preset background picture library as a corresponding background picture; for the selected plurality of background pictures, when step S22 is executed, the selected plurality of background pictures are displayed according to a predetermined rule. The predetermined rule may be, for example, that each background picture is randomly displayed in chronological order, in which case, the average reading time required by a plurality of users to browse the content of page 1 is counted in advance, and the time for displaying each background picture can be obtained based on the average reading time and the number of selected background pictures. In addition, the predetermined rule may be, for example, that the time for displaying each background picture is obtained based on the average reading time and the number of the selected background pictures, and the background picture associated with each piece of recognized attention information is sequentially displayed according to the sequence of appearance of the plurality of pieces of recognized attention information in the page. The predetermined rule may be, for example, that priorities are set in advance for classification categories to which the keywords of the plurality of items of attention information belong, and as described above, the time for displaying each background picture is obtained based on the average reading time and the number of selected background pictures, and the background pictures associated with each identified item of attention information are displayed in order of magnitude according to the priorities. The predetermined rules are described herein by way of example only, and other predetermined rules not listed are also applicable herein.
In the second embodiment, since the types of pictures stored in the preset background picture library are limited, or the electronic book opened by the reader does not contain any attention information, such as a technical book of a scientific class, a legal technical book, and the like, there is a possibility that a specific background picture cannot be found from the preset background picture library. In another specific embodiment, the method for displaying an electronic book further includes: and when a certain pre-displayed page is not identified to have any attention information or no background picture associated with the attention information is found from a preset background picture library, displaying a default background picture when the content of the specified page is displayed. That is, in the case where a specific background picture cannot be selected from a preset background picture library because attention information is not recognized, or in the case where a specific background picture associated with the attention information is not found from the background picture library because the kinds of pictures stored in the preset background picture library are limited, a default background picture preset by the electronic reading APP product or a user is used as a background picture of a relevant page, that is, in the case where a specific background picture cannot be selected, a background picture defaulted by the electronic reading APP product is selected in step S21, and the default background picture is displayed in step S22.
In the second embodiment, if it is determined that the dominant hue of the selected background picture is the same as or similar to the color of the text on the text picture of the pre-displayed page, the color of the text is automatically adjusted to form a contrast color with the dominant hue of the background picture, so that the text content can be clearly highlighted. That is, when the color of the text on the displayed text picture is the same as or similar to the dominant hue of the background picture, the color of the text is automatically adjusted to form a contrast color with the dominant hue of the background picture, so that the text content can be clearly highlighted.
The contrasting colors are two types of colors with completely different individuality, and are two colors which can be distinguished obviously, such as red and green, blue and orange, black and white, purple and yellow, and the like, or dark and light colors, bright and dark colors, and the like. When the text color on the text picture and the main tone of the background picture form contrast color, the text content can be clearly displayed, and the reading of a user is facilitated.
According to the method for displaying the electronic book provided by the second embodiment of the invention, different background pictures are displayed for each page of the electronic book, so that the defect that each page of the electronic book displayed after the background picture is set only uses a single set background picture is overcome, the background picture associated with each plot can be automatically displayed according to different main plot parts described by each page of the content of the electronic book, different background pictures are dynamically generated for each page of the content, a user cannot generate visual monotone sense when reading the electronic book, the coordination and matching of characters, colors and backgrounds are realized, and the good reading experience of the user is further improved.
Fig. 3 is a schematic block diagram of an apparatus for displaying an electronic book according to a third embodiment of the present invention. As shown in fig. 3, the apparatus for displaying an electronic book includes:
the analysis unit is used for analyzing the selected electronic book file;
the typesetting engine is used for typesetting the parsed text;
the background picture selection unit is used for selecting a background picture corresponding to each pre-displayed page from a preset background picture library;
and the display unit is used for generating and displaying the content of the specified page, including the text picture and the selected background picture.
The pre-displayed page comprises a plurality of pages which are obtained through typesetting and determine the text content to be displayed.
The preset background picture library is a preset background picture library which stores a plurality of background pictures, and the plurality of stored background pictures can be a plurality of pure color background pictures without patterns with different colors, can also be a plurality of background pictures with different patterns, and can also be both the pure color background pictures and the background pictures. The specific content of the background picture is not limited herein.
The selection mode may be random selection or selection in a designated order.
In a specific embodiment, the apparatus for displaying an electronic book further includes:
the color analysis unit is used for analyzing whether the color of the text on the text picture to be displayed is the same as or similar to the main tone of the background picture;
and the text color adjusting unit is used for automatically adjusting the text color when the color of the text on the text picture to be displayed is the same as or similar to the dominant hue of the background picture, so that the text color and the dominant hue of the background picture form a contrast color, and the text content can be clearly highlighted.
It is clear to those skilled in the art that for the convenience and brevity of description, the specific operation of the apparatus described in the third embodiment may refer to the corresponding operation in the foregoing first embodiment, the example and the related description listed in the first embodiment are also applicable to explain the operation of the apparatus described in the third embodiment, and the description is not repeated here.
According to the device for displaying the electronic book provided by the third embodiment of the invention, different background pictures are displayed for each page of the electronic book, and the defect that each page of the electronic book displayed after the background picture is set only uses the set single background picture is overcome, so that a user cannot generate visual monotone when reading the electronic book, and the reading experience of the user is improved.
Fig. 4 is a schematic block diagram of an apparatus for displaying an electronic book according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus for displaying an electronic book includes:
the analysis unit is used for analyzing the selected electronic book file;
the typesetting engine is used for typesetting the analyzed text;
the attention information identification unit is used for carrying out semantic identification on the text content typeset on the pre-displayed pages and determining the attention information of each pre-displayed page;
the background picture selection unit is used for selecting a background picture associated with the attention information of each pre-displayed page from a preset background picture library;
and the display unit is used for generating and displaying the content of the specified page, including the text picture and the selected associated background picture.
The pre-displayed page comprises a plurality of pages which are obtained through typesetting and determine the text content to be displayed.
The focus information refers to a center of gravity to be expressed by text content to be displayed on each page, and includes, but is not limited to: event, weather, environment, scenery, character, animal, or plant.
The method comprises the steps of presetting a background picture library storing a plurality of different background pictures, classifying the plurality of background pictures by multiple categories, and classifying each category according to different dimensionalities in a multi-level mode, so that the plurality of background pictures are stored in the background picture library in a multi-category and multi-level mode.
In addition, in a specific embodiment, the apparatus for displaying an electronic book further includes a priority setting unit configured to set priorities for different pieces of attention information determined by the attention information identifying unit. In this embodiment, the background picture selection unit is configured to select one background picture associated with the determined attention information with the highest priority from a preset background picture library.
In addition, in another specific embodiment, when the background picture selection unit is configured to select a corresponding plurality of background pictures associated with a plurality of the attention information from a preset background picture library, the display unit displays the selected plurality of background pictures according to a predetermined rule while displaying the content of a specified page.
In addition, in another specific embodiment, when the background picture selection unit does not find a background picture associated with the attention information in a preset background picture library, the display unit displays a default background picture when displaying the content of a specified page.
In addition, in a specific embodiment, the apparatus for displaying an electronic book further includes:
the color analysis unit is used for analyzing whether the color of the text on the text picture to be displayed is the same as or similar to the main tone of the background picture;
and the text color adjusting unit is used for automatically adjusting the text color when the color of the text on the text picture to be displayed is the same as or similar to the dominant hue of the background picture, so that the text color and the dominant hue of the background picture form a contrast color, and the text content can be clearly highlighted.
It is clear to those skilled in the art that for the convenience and brevity of description, the specific operation of the apparatus described in the fourth embodiment may refer to the corresponding process in the foregoing second embodiment, the example and the related description in the second embodiment are also applicable to explain the operation of the apparatus described in the fourth embodiment, and the description is not repeated here.
According to the apparatus for displaying an electronic book provided by the fourth embodiment of the present invention, different background pictures are displayed for each page of the electronic book, which not only solves the design defect that each page of the electronic book displayed after the background picture is set only uses a single background picture, but also can automatically display the background picture associated with each plot of the content description of each page of the electronic book, and dynamically generate different background pictures for each page of the content, so that a user does not have visual monotone when reading the electronic book, and the coordination and matching of characters, colors and backgrounds are also realized, thereby further improving the good reading experience of the user.
The computer program product for executing the method for displaying an electronic book according to another embodiment of the present invention includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the first embodiment or the second embodiment, and specific implementation may refer to the first embodiment or the second embodiment, and will not be described herein again.
To this end, further embodiments of the present invention provide a storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to the first embodiment or a combination thereof.
To this end, further embodiments of the present invention provide a storage device having stored therein a plurality of instructions adapted to be loaded by a processor and to perform the method according to the second embodiment or a combination thereof.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a smart tablet, a smart phone, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.