CN113553801A - Typesetting of dynamic effect characters of webpage, device, equipment and storage medium - Google Patents

Typesetting of dynamic effect characters of webpage, device, equipment and storage medium Download PDF

Info

Publication number
CN113553801A
CN113553801A CN202110741782.4A CN202110741782A CN113553801A CN 113553801 A CN113553801 A CN 113553801A CN 202110741782 A CN202110741782 A CN 202110741782A CN 113553801 A CN113553801 A CN 113553801A
Authority
CN
China
Prior art keywords
dynamic effect
webpage
text
typesetting
characters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110741782.4A
Other languages
Chinese (zh)
Other versions
CN113553801B (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.)
Shanghai Hard Link Network Technology Co ltd
Original Assignee
Shanghai Hard Link Network 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 Shanghai Hard Link Network Technology Co ltd filed Critical Shanghai Hard Link Network Technology Co ltd
Priority to CN202110741782.4A priority Critical patent/CN113553801B/en
Publication of CN113553801A publication Critical patent/CN113553801A/en
Application granted granted Critical
Publication of CN113553801B publication Critical patent/CN113553801B/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/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a typesetting method of dynamic effect characters of a webpage, which is characterized in that the display positions of the dynamic effect characters and the dynamic effect characters on the webpage are obtained by responding to a webpage language switching instruction, and the language type conversion is carried out on the dynamic effect character content according to the language type needing to be switched at present, so as to obtain the dynamic effect character content after the language type conversion; determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position; and finally, displaying the language-converted dynamic effect character content on the webpage according to the dynamic effect format file packet, thereby realizing the language conversion of the dynamic effect characters of the webpage and the typesetting of the converted dynamic effect characters. Correspondingly, the embodiment of the invention also provides a typesetting device, equipment and a storage medium for the dynamic effect characters of the webpage.

Description

Typesetting of dynamic effect characters of webpage, device, equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to typesetting, a device, equipment and a storage medium of dynamic effect characters of a webpage.
Background
The conventional method for translating a web page generally acquires all text information in a current web page, translates all text information in the current web page according to a web language type of the current web page to generate a corresponding translation, and displays the acquired translation in the current web page.
However, some web pages in the prior art contain dynamic effect characters, and some dynamic effect characters do not support direct editing, so that when the web pages are translated, the dynamic effect characters which do not support direct editing cannot be subjected to language conversion, and the typesetting is performed on the dynamic effect characters after the language conversion.
Disclosure of Invention
The invention aims to provide a typesetting method, a typesetting device and a typesetting device for dynamic effect characters of a webpage, which can be used for carrying out language switching on the dynamic effect character contents of the webpage and typesetting the dynamic effect characters after the language conversion.
In order to achieve the above object, an embodiment of the present invention provides a method for typesetting dynamic effect texts of a web page, including:
responding to a webpage language switching instruction, and acquiring dynamic effect characters on a webpage and display positions of the dynamic effect characters;
performing language type conversion on the dynamic effect character content according to the language type needing to be switched currently to obtain the dynamic effect character content after the language type conversion;
determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position;
generating a dynamic effect format file packet of dynamic effect character contents after language conversion according to the display position and the character typesetting style;
and displaying the dynamic effect character content after language conversion on the webpage according to the dynamic effect format file packet.
As an improvement of the above scheme, the acquiring the dynamic effect characters on the webpage and the display positions of the dynamic effect characters specifically includes:
and comparing and analyzing the obtained screenshots of the webpage captured successively at different moments in a preset time period, and determining the dynamic effect characters on the webpage and the display positions of the dynamic effect characters according to the comparison and analysis result.
As an improvement of the above scheme, the acquiring the dynamic effect characters on the webpage and the display positions of the dynamic effect characters specifically includes:
and analyzing the configuration information of the source file of the webpage to acquire the dynamic effect characters on the webpage and the display positions of the dynamic effect characters.
As an improvement of the above scheme, the determining, according to the web page content within the preset distance around the display position, the text typesetting style corresponding to the converted dynamic effect text content specifically includes:
acquiring all webpage contents within a preset distance around the display position; the webpage content comprises a webpage picture and a webpage text;
identifying and classifying all the webpage contents to obtain the classification type of each webpage content;
determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the web page contents on the web page; the typesetting mode comprises the display color of the webpage text and the layout style of the webpage picture; the typesetting style comprises the following steps: the display color of the dynamic effect characters corresponding to the display color of the webpage text and the dynamic effect display type corresponding to the layout style of the webpage picture.
In order to achieve the above object, an embodiment of the present invention further provides a device for typesetting dynamic effect texts on a web page, including:
the dynamic effect character acquisition module is used for responding to a webpage language switching instruction and acquiring dynamic effect characters on a webpage and display positions of the dynamic effect characters;
the language type conversion module is used for performing language type conversion on the dynamic effect character content according to the language type needing to be switched currently to obtain the dynamic effect character content after the language type conversion;
the text typesetting style acquisition module is used for determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position;
the dynamic effect format file package acquisition module is used for generating a dynamic effect format file package of dynamic effect character contents after language conversion according to the display position and the character typesetting style;
and the converted dynamic effect character display module is used for displaying the dynamic effect character content after language conversion on the webpage according to the dynamic effect format file packet.
As an improvement of the above scheme, the dynamic effect character acquisition device is specifically configured to:
responding to a webpage language switching instruction, comparing and analyzing the obtained screenshots of the webpage captured successively at different moments in a preset time period, and determining the display positions of the dynamic effect characters on the webpage and the dynamic effect characters according to the comparison and analysis result.
As an improvement of the above scheme, the dynamic effect character acquisition device is specifically configured to:
and responding to a webpage language switching instruction, and analyzing configuration information of a source file of the webpage to acquire dynamic effect characters on the webpage and display positions of the dynamic effect characters.
As an improvement of the above scheme, the text typesetting style obtaining module is specifically configured to:
acquiring all webpage contents within a preset distance around the display position; the webpage content comprises a webpage picture and a webpage text;
identifying and classifying all the webpage contents to obtain the classification type of each webpage content;
determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the web page contents on the web page; the typesetting mode comprises the display color of the webpage text and the layout style of the webpage picture; the typesetting style comprises the following steps: the display color of the dynamic effect characters corresponding to the display color of the webpage text and the dynamic effect display type corresponding to the layout style of the webpage picture.
In order to achieve the above object, an embodiment of the present invention provides a typesetting apparatus for a dynamic effect text of a web page, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements a typesetting method for the dynamic effect text of the web page according to any one of the above embodiments when executing the computer program.
In order to achieve the above object, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, a device on which the computer-readable storage medium is located is controlled to execute the method for typesetting the dynamic effect text of the web page according to any one of the above embodiments.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the embodiment of the invention provides a method for typesetting dynamic effect characters of a webpage, which comprises the steps of responding to a webpage language switching instruction to obtain the dynamic effect characters on the webpage and the display positions of the dynamic effect characters, and performing language type conversion on the dynamic effect character contents according to the language type needing to be switched at present to obtain the language type converted dynamic effect character contents; determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position; and finally, displaying the language-converted dynamic effect character content on the webpage according to the dynamic effect format file packet, thereby realizing the language conversion of the dynamic effect characters of the webpage and the typesetting of the converted dynamic effect characters. Correspondingly, the embodiment of the invention also provides a typesetting device, equipment and a storage medium for the dynamic effect characters of the webpage.
Drawings
FIG. 1 is a flowchart illustrating a method for typesetting dynamic effect text of a web page according to an embodiment of the present invention;
fig. 2 is a layout block diagram of dynamic effect characters before conversion and web page contents in the method for typesetting dynamic effect characters of a web page according to an embodiment of the present invention;
FIG. 3 is a block diagram illustrating an apparatus for typesetting dynamic effect text of a web page according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating a typesetting apparatus for dynamic effect text of a web page according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, 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. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of a method for typesetting dynamic effect text of a web page according to an embodiment of the present invention is shown.
The text typesetting method of the webpage can be executed through a user side, and the user side can be a computer, a mobile phone, a tablet and other user terminal equipment; the user terminal can be loaded with various application programs including a browser and used for presenting a webpage picture. By way of example, the user terminal may include a display screen and a processor, where the display screen is used to present a web interface, and the web interface is used to present a web picture and interact with a user; the processor is used for acquiring a webpage, generating a webpage interface and controlling the display of the webpage interface on the display screen;
the text typesetting method of the webpage can also be executed by a server, and the server can be an IA architecture server, a RISC architecture server and other different types of servers; the server side has high-speed CPU computing capacity, long-time reliable operation, strong I/O external data throughput capacity and better expansibility, and can provide response service requests, undertaking services and guaranteeing services of webpages for the user side.
Specifically, the method for typesetting the dynamic effect characters of the webpage includes steps S11 to S15:
step S11, responding to a webpage language switching instruction, and acquiring dynamic effect characters on a webpage and display positions of the dynamic effect characters;
step S12, according to the language type which needs to be switched to at present, the language type conversion is carried out on the dynamic effect character content, and the dynamic effect character content after the language type conversion is obtained;
step S13, determining a text typesetting style corresponding to the converted dynamic effect text content according to the web page content within the preset distance around the display position;
step S14, generating a dynamic effect format file packet of dynamic effect character content after language conversion according to the display position and the character typesetting style;
and step S15, displaying the dynamic effect character content after language conversion on the webpage according to the dynamic effect format file packet.
In step S11, for example, a button for language type conversion may be set in the page of the web page, when the user clicks the button for language type conversion, multiple language type tags may be displayed in a pop-up window manner for the user to select, the language type tag selected by the user may be clicked by a mouse, may be input by a keyboard, may be input by a touch screen, and is not limited herein, then the operation for switching the language type of the web page may be a received instruction for selecting the language type tag by the user; alternatively, the region where the client is located may be located, and the universal language of the region may be selected to perform the switching of the language type, which is not limited herein.
In the embodiment of the present invention, the text typesetting style includes a position of a text in a web page, an alignment manner of the text, a color of the text, a font, a space between the fonts, a dynamic effect of the text, and the like. Dynamic effects of text include fading, popping to the left, scrolling, flashing, and so forth.
In the embodiment of the present invention, in step S14, when the text typesetting style is determined, and a dynamic effect format file package of the dynamic effect text content after language conversion is generated, in a specific implementation, the sequence frame pictures of the plain text may be obtained first, and in component configuration, the corresponding position of each sequence frame picture of the plain text is set according to the sequence frame pictures of the corresponding plain text uploaded in each language. When a page is generated, the corresponding dynamic effect sequence frame synthesized by each language is uploaded through the configurations and stored into a picture processing packet of canvas API or nodejs, and then after a language switching instruction is responded, the picture processing packet corresponding to the corresponding dynamic effect sequence frame is read and played according to the converted language type, so that dynamic effect content switching is completed.
In the embodiment of the present invention, in step S14, the dynamic effect format package may also be a gif format package, and after the text layout style and the display position are determined, third-party software is called according to the text layout style to make the gif format package with the corresponding dynamic effect type.
The method for typesetting the dynamic effect characters of the webpage, provided by the embodiment of the invention, comprises the steps of responding to a webpage language switching instruction to obtain the dynamic effect characters on the webpage and the display positions of the dynamic effect characters, and performing language type conversion on the dynamic effect character contents according to the language type needing to be switched at present to obtain the dynamic effect character contents after the language type conversion; determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position; and finally, displaying the language-converted dynamic effect character content on the webpage according to the dynamic effect format file packet, thereby realizing the language conversion of the dynamic effect characters of the webpage and the typesetting of the converted dynamic effect characters.
In an optional implementation manner, the step S11 of "acquiring the dynamic effect text on the web page and the display position of the dynamic effect text" specifically includes:
and comparing and analyzing the obtained screenshots of the webpage captured successively at different moments in a preset time period, and determining the dynamic effect characters on the webpage and the display positions of the dynamic effect characters according to the comparison and analysis result.
In the embodiment of the invention, after the webpage language conversion instruction is received, a screenshot program is automatically started to perform multiple screenshots on the current webpage screenshot in a preset time period, and the pictures of the multiple screenshot webpages are analyzed to obtain a comparative analysis result. Exemplarily, assuming that there are dynamic characters "hello and welcome" which are transformed by zooming in and zooming out in a webpage, in a plurality of captured screenshots of the webpage successively at different times, font reduction of "hello and welcome" in one screenshot of the webpage is detected, font amplification of "hello and welcome" in another screenshot of the webpage can determine that "hello and welcome" dynamic characters on the webpage are present, and then corresponding elements or tags of "hello and welcome" in the webpage can be obtained, and the display positions of the dynamic characters are determined by extracting the CSS styles of the corresponding elements or nodes and the JS file.
In another optional implementation manner, the step S11 of "obtaining the dynamic effect text on the web page and the display position of the dynamic effect text" specifically includes:
and analyzing the configuration information of the source file of the webpage to acquire the dynamic effect characters on the webpage and the display positions of the dynamic effect characters.
In the embodiment of the present invention, a source file of a web page may also be analyzed, where the source file includes, but is not limited to, an HTML file, a CSS file, and a JS file, and a code of the source file is analyzed to extract elements (nodes and tags) corresponding to dynamic effect characters in the web page, and obtain a display position of the dynamic effect characters according to layout configuration information of the elements (nodes and tags) corresponding to the dynamic effect characters.
In an optional implementation manner, the step S13 "determining the text type setting style corresponding to the converted dynamic effect text content according to the web page content within the preset distance around the display position" specifically includes:
acquiring all webpage contents within a preset distance around the display position; the webpage content comprises a webpage picture and a webpage text;
identifying and classifying all the webpage contents to obtain the classification type of each webpage content;
determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the web page contents on the web page; the typesetting mode comprises the display color of the webpage text and the layout style of the webpage picture; the typesetting style comprises the following steps: the display color of the dynamic effect characters corresponding to the display color of the webpage text and the dynamic effect display type corresponding to the layout style of the webpage picture.
In the embodiment of the invention, when all the webpage contents within the preset distance around the display position are obtained, all the webpage node information within the preset distance according with the display position, including the picture node and the text node, is firstly extracted, so that the webpage contents are analyzed according to the picture node and the text node.
In one embodiment, the display color of the dynamic effect characters corresponding to the display color of the web page text can be determined by a preset mapping relationship between the display color of the web page text and the display color of the dynamic effect characters; the dynamic effect display type corresponding to the layout style of the webpage picture can be determined through a preset mapping relation between the layout style of the webpage picture and the dynamic effect display type; therefore, the display color and the dynamic effect display type of the converted dynamic effect characters can be determined according to the one-to-one correspondence between the display color of the webpage text and the display color of the dynamic effect characters and the one-to-one correspondence between the layout style of the webpage picture and the dynamic effect display type. The mapping relation between the preset layout style of the webpage picture and the dynamic effect display type and the mapping relation between the preset webpage text display color and the display color of the dynamic effect characters can be stored locally in advance, can be directly called when needed, can also be stored in a cloud, and can be downloaded from the cloud through a wireless network or a wired network when needed, and the method is not limited herein.
Illustratively, referring to fig. 2, fig. 2 shows a block diagram of a layout of animated characters and web page content before conversion. Assuming that a dynamic effect character 'classic legend' exists in a webpage, and after recognition and classification are carried out at a preset distance around the display position of the dynamic effect character, a magic object figure picture, a character 1 and a character 2 are detected, wherein the character 1 is recognized as figure introduction information about a magic object figure, the character 2 is recognized as a figure introduction navigation bar, the display color of the character 1 is red, the display color of the character 2 is red, the magic object figure picture is aligned in the middle, the color of the dynamic effect character 'classic legend' is set to be red, and the dynamic effect display type of the dynamic effect character 'classic legend' is set to be 'from near to far', or when the magic object figure picture is aligned to the right, the dynamic effect display type of the dynamic effect character 'classic legend' after language type conversion is 'character breaking effect'.
As can be seen from the above analysis, in the embodiment of the present invention, the classification type of each piece of web content is obtained by identifying and classifying all pieces of web content; and determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the webpage content on the webpage, so that the display effect of the converted dynamic effect text content is adapted to the display effect of the surrounding webpage content, the dynamic effect type of the converted dynamic effect text content can better conform to the layout and typesetting of the surrounding webpage content, and the dynamic effect of the converted dynamic effect text content is better.
Referring to fig. 3, a block diagram of a typesetting apparatus for dynamic effect text of a web page according to an embodiment of the invention is shown. The typesetting device 10 for the dynamic effect characters of the webpage provided by the embodiment of the invention comprises:
the dynamic effect character acquisition module 11 is configured to respond to a web page language switching instruction and acquire dynamic effect characters on a web page and display positions of the dynamic effect characters;
the language type conversion module 12 is used for performing language type conversion on the dynamic effect character content according to the language type to be switched to currently, so as to obtain the dynamic effect character content after the language type conversion;
a text typesetting style acquisition module 13, configured to determine a text typesetting style corresponding to the converted dynamic effect text content according to the web page content within a preset distance around the display position;
a dynamic effect format file package obtaining module 14, configured to generate a dynamic effect format file package of dynamic effect text contents after language conversion according to the display position and the text typesetting style;
and the converted dynamic effect character display module 15 is used for displaying the dynamic effect character content after the language conversion on the webpage according to the dynamic effect format file packet.
For example, a button for language type conversion may be set in a page of a web page, when a user clicks the button for language type conversion, a plurality of language type tags are displayed in a pop-up window manner for the user to select, the user may click the selected language type tag through a mouse, may input through a keyboard, may input through a touch screen, and is not limited herein, then the operation of switching the language type of the web page may be a received instruction for selecting the language type tag by the user; alternatively, the region where the client is located may be located, and the universal language of the region may be selected to perform the switching of the language type, which is not limited herein.
In the embodiment of the present invention, the text typesetting style includes a position of a text in a web page, an alignment manner of the text, a color of the text, a font, a space between the fonts, a dynamic effect of the text, and the like. Dynamic effects of text include fading, popping to the left, scrolling, flashing, and so forth.
In the embodiment of the present invention, when the text typesetting style is determined, and the dynamic effect format file package of the dynamic effect text content after language conversion is generated, in the specific implementation, the sequence frame pictures of the plain text can be obtained first, and in the component configuration, the corresponding position of each sequence frame picture of the plain text is set according to the corresponding sequence frame picture of the plain text uploaded in each language. When a page is generated, the corresponding dynamic effect sequence frame synthesized by each language is uploaded through the configurations and stored into a picture processing packet of canvas API or nodejs, and then after a language switching instruction is responded, the picture processing packet corresponding to the corresponding dynamic effect sequence frame is read and played according to the converted language type, so that dynamic effect content switching is completed.
In the embodiment of the invention, the dynamic effect format file package can also be a gif format file package, and after the text typesetting style and the display position are determined, third-party software is called to manufacture the gif format file package with the corresponding dynamic effect type according to the text typesetting style.
The typesetting device 10 for the dynamic effect characters of the web page provided by the embodiment of the invention obtains the display positions of the dynamic effect characters and the dynamic effect characters on the web page by responding to the web page language switching instruction, and performs language type conversion on the dynamic effect character contents according to the language type needing to be switched at present to obtain the dynamic effect character contents after the language type conversion; determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position; and finally, displaying the language-converted dynamic effect character content on the webpage according to the dynamic effect format file packet, thereby realizing the language conversion of the dynamic effect characters of the webpage and the typesetting of the converted dynamic effect characters.
In an optional implementation manner, the dynamic effect text obtaining module 11 is specifically configured to:
responding to a webpage language switching instruction, comparing and analyzing the obtained screenshots of the webpage captured successively at different moments in a preset time period, and determining the display positions of the dynamic effect characters on the webpage and the dynamic effect characters according to the comparison and analysis result.
In the embodiment of the invention, after the webpage language conversion instruction is received, a screenshot program is automatically started to perform multiple screenshots on the current webpage screenshot in a preset time period, and the pictures of the multiple screenshot webpages are analyzed to obtain a comparative analysis result. For example, assuming that there are dynamic effect characters "hello and welcome" that are transformed by zooming in and zooming out in a web page, in a plurality of captured screenshots of the web page at different times, a font reduction of "hello and welcome" in one screenshot of the web page is detected, a font amplification of "hello and welcome" in another screenshot of the web page can be determined, and then, corresponding elements or tags in the web page can be obtained, and the display position of the dynamic effect characters is determined by extracting the CSS style of the corresponding elements or tags.
In another optional implementation manner, the dynamic effect text acquiring module 11 is specifically configured to:
and responding to a webpage language switching instruction, and analyzing configuration information of a source file of the webpage to acquire dynamic effect characters on the webpage and display positions of the dynamic effect characters.
In the embodiment of the present invention, a source file of a web page may also be analyzed, where the source file includes, but is not limited to, an HTML file, a CSS file, and a JS file, and a code of the source file is analyzed to extract elements (nodes and tags) corresponding to dynamic effect characters in the web page, and obtain a display position of the dynamic effect characters according to layout configuration information of the elements (nodes and tags) corresponding to the dynamic effect characters.
In an optional implementation manner, the text layout style obtaining module 13 is specifically configured to:
acquiring all webpage contents within a preset distance around the display position; the webpage content comprises a webpage picture and a webpage text;
identifying and classifying all the webpage contents to obtain the classification type of each webpage content;
determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the web page contents on the web page; the typesetting mode comprises the display color of the webpage text and the layout style of the webpage picture; the typesetting style comprises the following steps: the display color of the dynamic effect characters corresponding to the display color of the webpage text and the dynamic effect display type corresponding to the layout style of the webpage picture.
In the embodiment of the invention, when all the webpage contents within the preset distance around the display position are obtained, all the webpage node information within the preset distance according with the display position, including the picture node and the text node, is firstly extracted, so that the webpage contents are analyzed according to the picture node and the text node.
In an embodiment, the display color of the dynamic effect words corresponding to the display color of the web page text may be determined by a mapping relationship between a preset display color of the web page text and the display color of the dynamic effect words, and the dynamic effect display type corresponding to the layout pattern of the web page picture may be determined by a mapping relationship between the preset layout pattern of the web page picture and the dynamic effect display type, so that the display color and the dynamic effect display type of the converted dynamic effect words may be determined according to a one-to-one correspondence relationship between the display color of the web page text and the display color of the dynamic effect words and a one-to-one correspondence relationship between the layout pattern of the web page picture and the dynamic effect display type. The mapping relation between the preset layout style of the webpage picture and the dynamic effect display type and the mapping relation between the preset webpage text display color and the display color of the dynamic effect characters can be stored locally in advance, can be directly called when needed, can also be stored in a cloud, and can be downloaded from the cloud through a wireless network or a wired network when needed, and the method is not limited herein.
For example, it is assumed that a dynamic effect character "classic legend" exists in a web page, and after a magic character figure picture, characters 1 and 2, are detected after recognition and classification at a preset distance around a display position of the dynamic effect character, wherein the character 1 is recognized as character introduction information about a magic character, the character 2 is recognized as a character introduction navigation bar, and the display color of the character 1 is red, the display color of the character 2 is red, the magic character figure picture is aligned in the middle, the color of the dynamic effect character "classic legend" is set to red, and the dynamic effect display type of the dynamic effect character "classic legend" is set to "from near to far", or when the magic character figure picture is aligned in the right, the dynamic effect display type of the dynamic effect character "classic legend" after language type conversion is set to "character fragmentation effect".
Referring to fig. 4, which is a block diagram illustrating a layout apparatus for a dynamic effect text of a web page according to an embodiment of the present invention, a layout apparatus 20 for a dynamic effect text of a web page according to an embodiment of the present invention includes a processor 21, a memory 22, and a computer program stored in the memory 22 and configured to be executed by the processor 21, where the processor 21 executes the computer program to implement the steps in the above-mentioned method for laying out a dynamic effect text of a web page, for example, the steps S11 to S15 shown in fig. 1; alternatively, the processor 21, when executing the computer program, implements the functions of the modules in the device embodiments, such as the dynamic character acquisition module 11.
Illustratively, the computer program may be divided into one or more modules, which are stored in the memory 22 and executed by the processor 21 to accomplish the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program in the typesetting device 20 of the dynamic effect characters of the webpage. For example, the computer program may be divided into a dynamic effect text acquiring module 11, a language type converting module 12, a text layout style acquiring module 13, a dynamic effect format file package acquiring module 14 and a converted dynamic effect text displaying module 15, and the specific functions of each module are as follows:
the dynamic effect character acquisition module 11 is configured to respond to a web page language switching instruction and acquire dynamic effect characters on a web page and display positions of the dynamic effect characters;
the language type conversion module 12 is used for performing language type conversion on the dynamic effect character content according to the language type to be switched to currently, so as to obtain the dynamic effect character content after the language type conversion;
a text typesetting style acquisition module 13, configured to determine a text typesetting style corresponding to the converted dynamic effect text content according to the web page content within a preset distance around the display position;
a dynamic effect format file package obtaining module 14, configured to generate a dynamic effect format file package of dynamic effect text contents after language conversion according to the display position and the text typesetting style;
and the converted dynamic effect character display module 15 is used for displaying the dynamic effect character content after the language conversion on the webpage according to the dynamic effect format file packet.
The specific working process of each module may refer to the working process of the text composition device 10 of the web page described in the above embodiment, and is not described herein again.
The typesetting device 20 for the dynamic effect characters of the webpage can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The typesetting device 20 for the dynamic effect characters of the webpage can comprise, but is not limited to, a processor 21 and a memory 22. It will be understood by those skilled in the art that the schematic diagram is merely an example of the text composing device of the web page, and does not constitute a limitation to the text composing device 20 of the web page, and may include more or less components than those shown, or combine some components, or different components, for example, the text composing device 20 of the web page may further include an input-output device, a network access device, a bus, etc.
The Processor 21 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general processor may be a microprocessor or the processor may be any conventional processor, etc., and the processor 21 is a control center of the typesetting device 20 for the dynamic effect characters of the web page, and various interfaces and lines are used to connect various parts of the typesetting device 20 for the dynamic effect characters of the whole web page.
The memory 22 may be used to store the computer programs and/or modules, and the processor 21 may implement various functions of the typesetting apparatus 20 for the animated characters of the web page by operating or executing the computer programs and/or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory 22 may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The modules integrated by the typesetting equipment 20 for the dynamic effect characters of the web page can be stored in a computer readable storage medium if the modules are realized in the form of software functional units and sold or used as independent products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-only memory (ROM), a Random Access Memory (RAM), or the like.
Accordingly, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, where, when the computer program runs, a device on which the computer-readable storage medium is controlled to execute the steps in the method for typesetting an avatar text of a web page according to the above embodiment, for example, steps S11 to S15 shown in fig. 1.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A method for typesetting dynamic effect characters of a webpage is characterized by comprising the following steps:
responding to a webpage language switching instruction, and acquiring dynamic effect characters on a webpage and display positions of the dynamic effect characters;
performing language type conversion on the dynamic effect character content according to the language type needing to be switched currently to obtain the dynamic effect character content after the language type conversion;
determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position;
generating a dynamic effect format file packet of dynamic effect character contents after language conversion according to the display position and the character typesetting style;
and displaying the dynamic effect character content after language conversion on the webpage according to the dynamic effect format file packet.
2. The method for typesetting dynamic effect words on a web page as claimed in claim 1, wherein the obtaining of the dynamic effect words on the web page and the display positions of the dynamic effect words specifically comprises:
and comparing and analyzing the obtained screenshots of the webpage captured successively at different moments in a preset time period, and determining the dynamic effect characters on the webpage and the display positions of the dynamic effect characters according to the comparison and analysis result.
3. The method for typesetting dynamic effect words on a web page as claimed in claim 1, wherein the obtaining of the dynamic effect words on the web page and the display positions of the dynamic effect words specifically comprises:
and analyzing the configuration information of the source file of the webpage to acquire the dynamic effect characters on the webpage and the display positions of the dynamic effect characters.
4. The method for typesetting dynamic effect texts on web pages according to claim 1, wherein the determining the text typesetting style corresponding to the converted dynamic effect text content according to the web page content within the preset distance around the display position specifically comprises:
acquiring all webpage contents within a preset distance around the display position; the webpage content comprises a webpage picture and a webpage text;
identifying and classifying all the webpage contents to obtain the classification type of each webpage content;
determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the web page contents on the web page; the typesetting mode comprises the display color of the webpage text and the layout style of the webpage picture; the typesetting style comprises the following steps: the display color of the dynamic effect characters corresponding to the display color of the webpage text and the dynamic effect display type corresponding to the layout style of the webpage picture.
5. A typesetting device for dynamic effect characters of a webpage is characterized by comprising:
the dynamic effect character acquisition module is used for responding to a webpage language switching instruction and acquiring dynamic effect characters on a webpage and display positions of the dynamic effect characters;
the language type conversion module is used for performing language type conversion on the dynamic effect character content according to the language type needing to be switched currently to obtain the dynamic effect character content after the language type conversion;
the text typesetting style acquisition module is used for determining a text typesetting style corresponding to the converted dynamic effect text content according to the webpage content within the preset distance around the display position;
the dynamic effect format file package acquisition module is used for generating a dynamic effect format file package of dynamic effect character contents after language conversion according to the display position and the character typesetting style;
and the converted dynamic effect character display module is used for displaying the dynamic effect character content after language conversion on the webpage according to the dynamic effect format file packet.
6. The apparatus for composing a dynamic effect text of a web page as claimed in claim 5, wherein the dynamic effect text acquiring means is specifically configured to:
responding to a webpage language switching instruction, comparing and analyzing the obtained screenshots of the webpage captured successively at different moments in a preset time period, and determining the display positions of the dynamic effect characters on the webpage and the dynamic effect characters according to the comparison and analysis result.
7. The apparatus for composing a dynamic effect text of a web page as claimed in claim 5, wherein the dynamic effect text acquiring means is specifically configured to:
and responding to a webpage language switching instruction, and analyzing configuration information of a source file of the webpage to acquire dynamic effect characters on the webpage and display positions of the dynamic effect characters.
8. The apparatus for typesetting dynamic effect text for web pages as claimed in claim 5, wherein the text typesetting style obtaining module is specifically configured to:
acquiring all webpage contents within a preset distance around the display position; the webpage content comprises a webpage picture and a webpage text;
identifying and classifying all the webpage contents to obtain the classification type of each webpage content;
determining a text typesetting style corresponding to the converted dynamic effect text content based on the typesetting modes of various types of the web page contents on the web page; the typesetting mode comprises the display color of the webpage text and the layout style of the webpage picture; the typesetting style comprises the following steps: the display color of the dynamic effect characters corresponding to the display color of the webpage text and the dynamic effect display type corresponding to the layout style of the webpage picture.
9. An apparatus for composing a dynamic effect text of a web page, comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the method for composing a dynamic effect text of a web page according to any one of claims 1 to 4.
10. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program runs, the computer-readable storage medium controls a device to execute the method for typesetting the dynamic effect text of the webpage according to any one of claims 1 to 4.
CN202110741782.4A 2021-06-30 2021-06-30 Typesetting of dynamic effect characters of webpage, device, equipment and storage medium Active CN113553801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110741782.4A CN113553801B (en) 2021-06-30 2021-06-30 Typesetting of dynamic effect characters of webpage, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110741782.4A CN113553801B (en) 2021-06-30 2021-06-30 Typesetting of dynamic effect characters of webpage, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113553801A true CN113553801A (en) 2021-10-26
CN113553801B CN113553801B (en) 2022-10-14

Family

ID=78102639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110741782.4A Active CN113553801B (en) 2021-06-30 2021-06-30 Typesetting of dynamic effect characters of webpage, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113553801B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030137522A1 (en) * 2001-05-02 2003-07-24 Kaasila Sampo J. Innovations for the display of web pages
US20040041818A1 (en) * 2002-08-29 2004-03-04 Jvolution Limited Design system for website text graphics
CN101477519A (en) * 2008-12-22 2009-07-08 传神联合(北京)信息技术有限公司 Original document synchronous preview apparatus and method for network translation
CN108664475A (en) * 2018-03-28 2018-10-16 广东欧珀移动通信有限公司 Translate display methods, device, mobile terminal and storage medium
US20200311406A1 (en) * 2017-09-11 2020-10-01 Erre Quadro S.R.L. Method for analysing digital documents
CN112784202A (en) * 2021-02-03 2021-05-11 中国电子科技集团公司第二十八研究所 Method for improving definition of webpage screenshot based on WEB technology

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030137522A1 (en) * 2001-05-02 2003-07-24 Kaasila Sampo J. Innovations for the display of web pages
US20040041818A1 (en) * 2002-08-29 2004-03-04 Jvolution Limited Design system for website text graphics
CN101477519A (en) * 2008-12-22 2009-07-08 传神联合(北京)信息技术有限公司 Original document synchronous preview apparatus and method for network translation
US20200311406A1 (en) * 2017-09-11 2020-10-01 Erre Quadro S.R.L. Method for analysing digital documents
CN108664475A (en) * 2018-03-28 2018-10-16 广东欧珀移动通信有限公司 Translate display methods, device, mobile terminal and storage medium
CN112784202A (en) * 2021-02-03 2021-05-11 中国电子科技集团公司第二十八研究所 Method for improving definition of webpage screenshot based on WEB technology

Also Published As

Publication number Publication date
CN113553801B (en) 2022-10-14

Similar Documents

Publication Publication Date Title
US9921723B2 (en) Method for switching pages, and electronic device and non-transitory computer readable storage medium for performing same
CN107977155B (en) Handwriting recognition method, device, equipment and storage medium
CN113655999B (en) Page control rendering method, device, equipment and storage medium
CN111596848A (en) Interface color taking method, device, equipment and storage medium
CN116954450A (en) Screenshot method and device for front-end webpage, storage medium and terminal
US11341353B2 (en) Preserving styles and ink effects in ink-to-text
CN113313066A (en) Image recognition method, image recognition device, storage medium and terminal
CN113051235A (en) Document loading method and device, terminal and storage medium
CN113553801B (en) Typesetting of dynamic effect characters of webpage, device, equipment and storage medium
CN110708423A (en) Message content display method and device and storage medium
CN115329720A (en) Document display method, device, equipment and storage medium
CN113553802B (en) Typesetting method, device, equipment and storage medium for characters in hidden picture of webpage
CN115268890A (en) Information processing method and device and electronic equipment
CN113672835B (en) Method, device, equipment and storage medium for setting dynamic special effects of web pages
CN113553524B (en) Method, device, equipment and storage medium for typesetting characters of webpage
CN114518859A (en) Display control method, display control device, electronic equipment and storage medium
CN113536169B (en) Method, device, equipment and storage medium for typesetting characters of webpage
CN109254712B (en) Information processing method and electronic equipment
CN112988310A (en) Online experiment method based on multi-split-screen browser
CN113672836B (en) Method, device, equipment and storage medium for setting dynamic special effects of web pages
CN112861504A (en) Text interaction method, device, equipment, storage medium and program product
CN111444452A (en) Conversion method, device and storage medium of webpage
CN113112395B (en) Picture processing method, device and storage medium
CN113350789B (en) Virtual character edge processing method, device, equipment and storage medium
CN115134317B (en) Message display method, device, storage medium and electronic 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