Emoticon generation method and device and computer readable storage medium
By generating emoji image collection fonts and determining and rendering emoji pictures based on the text data entered by the user, the problem of poor emoji generation effect in the on-board entertainment system is solved, and the generation and efficient rendering of diverse emojis are achieved.
Patent Information
- Application Number
- CN202411562001.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art is difficult to generate diverse emojis according to user needs, resulting in poor generation effect of emojis in on-board entertainment systems.
By combining multiple emoji pictures into one integrated emoji picture, and combining emoji attribute data to generate emoji picture fonts, determine the corresponding emoji picture based on the text data entered by the user, and render it to generate emoji.
It realizes the generation of diverse emojis according to user needs, improves the generation effect of emojis, and quickly locates the image of emojis to be rendered through font index tags, improving the generation efficiency.
Smart Images

Figure CN119691204A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of vehicle technology, and in particular to an emoticon generation method, device and computer-readable storage medium. Background Art
[0002] With the continuous advancement of science and technology and the rapid development of society, the in-vehicle entertainment system (car computer), as an important part of modern cars, is no longer limited to traditional functional requirements, but has gradually evolved into a multifunctional, interconnected and intelligent platform. This change is not only reflected in users' expectations for basic functions such as music, navigation and communication, but also in the pursuit of personalization and user experience, including the widespread use and demand for emojis.
[0003] As a cross-cultural, graphic expression method, Emoji has been deeply integrated into people's daily communication. However, it is not easy to fully support Emoji in the car system.
[0004] Existing emoticon generation methods are limited by the hardware performance and software capabilities of the in-vehicle entertainment system, making it difficult to generate diverse emoticons according to user needs, resulting in poor emoticon generation effects. Summary of the invention
[0005] In view of the above problems, the embodiments of the present invention provide an emoticon generation method, device and computer-readable storage medium, which are used to solve the technical problem in the prior art that it is difficult to generate diversified emoticons according to user needs due to the limitations of the hardware performance and software capabilities of the in-vehicle entertainment system, resulting in poor emoticon generation effect.
[0006] According to one aspect of an embodiment of the present invention, a method for generating an emoticon is provided, which is applicable to an in-vehicle system and includes:
[0007] Determine, according to the text data input by the user, a font index tag of the corresponding emoticon in the emoticon atlas font; wherein the emoticon atlas font is generated according to an integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture;
[0008] According to the font index tag, an emoticon image to be rendered is determined in the emoticon atlas font, and the emoticon image to be rendered is rendered to generate an emoticon corresponding to the text data.
[0009] According to another aspect of an embodiment of the present invention, there is provided an emoticon generating device applicable to a vehicle-mounted system, comprising:
[0010] A font index label confirmation module, used to determine the font index label of the corresponding emoticon in the emoticon atlas font according to the text data input by the user; wherein the emoticon atlas font is generated according to the integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture;
[0011] The emoticon generation module is used to determine the emoticon image to be rendered in the emoticon atlas font according to the font index tag, and render the emoticon image to be rendered to generate the emoticon corresponding to the text data.
[0012] In an optional manner, the font index tag confirmation module further includes:
[0013] An emoticon code determination unit, used for traversing each character of the text data, and determining the emoticon code formed by the characters in the text data according to the Unicode code and the surrogate pair of the characters in the text data;
[0014] The font index label confirmation unit is used to determine the font index label corresponding to the emoticon in the emoticon atlas font according to the emoticon code.
[0015] In an optional manner, the surrogate pair includes a high surrogate interval and a low surrogate interval, and the emoticon code determination unit is further used to:
[0016] When the Unicode code of the current character is in the high surrogate interval and the Unicode code of the next character is in the low surrogate interval, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0017] In an optional manner, the emoticon code determination unit is further used for:
[0018] When the Unicode code of the current character is not in the high surrogate interval and the next character is a selection modifier or a connector, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0019] In an optional manner, the font index tag confirmation unit is further used for:
[0020] Determine the emoji corresponding to the emoji code in the emoji atlas font, and obtain the index of the emoji;
[0021] A font index tag for the emoji is generated based on the index.
[0022] In an optional manner, the emoticon generating device further includes an atlas font updating module, which is used to:
[0023] The emoji atlas font is updated according to the acquired backup atlas font.
[0024] In an optional manner, the emoticon generation module is further configured to:
[0025] Determine the position information of the emoticon image corresponding to the font index tag in the emoticon atlas font;
[0026] The emoticon image corresponding to the position information is determined as the emoticon image to be rendered.
[0027] According to another aspect of an embodiment of the present invention, there is provided an emoticon generating device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0028] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the emoticon generation method as described above.
[0029] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction, and when the executable instruction is executed on an emoticon generating device / apparatus, the emoticon generating device / apparatus performs the operation of the emoticon generating method as described above.
[0030] The embodiment of the present invention combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and can determine the corresponding emoticon image in the atlas font according to a variety of different text data input by the user, and generate emoticons through rendering, so as to generate diversified emoticons according to user needs, effectively improving the generation effect of emoticons.
[0031] Furthermore, the embodiment of the present invention updates the emoticon atlas font through the backup atlas font, thereby ensuring that text contents in different languages can be displayed normally, further improving the generation effect of emoticons.
[0032] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0034] Figure 1 A schematic diagram showing a flow chart of a method for generating emoticons provided by an embodiment of the present invention is shown;
[0035] Figure 2 A schematic diagram of input text data provided by an embodiment of the present invention is shown;
[0036] Figure 3 An example diagram of a font index label provided by an embodiment of the present invention is shown;
[0037] Figure 4 An example diagram of displaying emoticons provided by an embodiment of the present invention is shown;
[0038] Figure 5 Another schematic diagram of the process of generating an emoticon provided by an embodiment of the present invention is shown;
[0039] Figure 6 A schematic diagram of a text character processing flow provided by an embodiment of the present invention is shown;
[0040] Figure 7 A schematic diagram of a process for generating an atlas font file provided by an embodiment of the present invention is shown;
[0041] Figure 8 A schematic diagram showing the structure of an emoticon generating device provided by an embodiment of the present invention is shown;
[0042] Fig. 9 A schematic diagram of the structure of an emoticon generating device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0043] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0044] Figure 1 FIG. 1 is a flow chart showing a first embodiment of a method for generating emoticons according to the present invention, wherein the method is executed by an emoticon generating device. Figure 1As shown, the method comprises the following steps:
[0045] Step 110: Determine the font index tag of the corresponding emoticon in the emoticon atlas font based on the text data input by the user; wherein the emoticon atlas font is generated based on an integrated emoticon image and emoticon attribute data, the integrated emoticon image is obtained by merging multiple emoticon images, and the emoticon attribute data is generated based on the position information of each emoticon image in the integrated emoticon image.
[0046] Among them, text data includes strings and text fields, etc. In an embodiment of the present invention, an emoticon database can be imported to obtain multiple emoticon images in the emoticon database. The emoticon images in the emoticon database almost include all emoticons. Special emoticon images can be obtained and imported separately to improve the comprehensiveness of the integrated emoticon images, so that the emoticon collection fully includes the emoticons that may be used. In an embodiment of the present invention, a python tool script can be used to convert the imported emoticon images into a preset size, such as a 32X32 image, and import it into a Unity project.
[0047] In an embodiment of the present invention, the emoji attribute data includes the position information of each emoji image in the integrated emoji image, and the unique emoji code corresponding to the emoji in each emoji image. The size of the integrated emoji image ensures that all emoji images can be merged, and its size can be obtained by taking the power of 2 as the image size through the calculation result of the number of emoji images * EmojiSize * EmojiSize. The emoji attribute data is Texture_Emoji_JsonArray data, that is, json data, and the data result of json data can be defined according to the code of the sprite import tool of Unity's built-in text rendering component TextMesh Pro.
[0048] In the embodiment of the present invention, the emoticon atlas font may be generated in the following manner:
[0049] Prepare the sprite import tool of the text rendering component TextMesh Pro, put in the integrated emoticon image (Texture image) and emoticon attribute data (json data), and click Export sprite font to generate the corresponding emoticon atlas font file (Emoji sprite font).
[0050] In the embodiment of the present invention, the emoticon corresponding to the text data may be determined according to the text data input by the user, and then the font index label of the emoticon in the emoticon atlas font may be further determined.
[0051] Step 120: Determine an emoticon image to be rendered in the emoticon atlas font according to the font index tag, render the emoticon image to be rendered, and generate an emoticon corresponding to the text data.
[0052] Among them, the text rendering component TextMeshPro in Unity can be used to render the emoticon image to be rendered to generate the corresponding emoticon.
[0053] In an embodiment of the present invention, after determining the font index tag, the position of the emoticon image to be rendered in the emoticon atlas font can be determined according to the font index tag, so that the text rendering component can accurately render the emoticon and generate the emoticon corresponding to the text data.
[0054] In an alternative approach, Figure 2 An example diagram showing text data input by a user, Figure 3 Shown according to Figure 2 Example of font index label determined by user input text data, Figure 4 Shown according to Figure 3 An example of the emoji display that is finally rendered in the font index label.
[0055] The implementation of the embodiments of the present invention has the following beneficial effects:
[0056] The embodiment of the present application combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and is able to determine the corresponding emoticon image in the atlas font based on a variety of different text data input by the user, and generate emoticons through rendering, so that diversified emoticons can be generated according to user needs, effectively improving the generation effect of emoticons.
[0057] Figure 5 FIG. 2 is a flow chart showing another embodiment of the emoticon generation method of the present invention, wherein the method is executed by an emoticon generation device. Figure 5 As shown, the method comprises the following steps:
[0058] Step 510: traverse each character of the text data, and determine the emoticon code formed by the characters in the text data according to the Unicode code and the surrogate pair of the characters in the text data.
[0059] In an embodiment of the present invention, the text data may include multiple characters, and usually the Unicode encoding of two characters constitutes an emoticon encoding (emoji encoding). In Unicode encoding, a surrogate pair is composed of a high-order surrogate interval and a low-order surrogate interval, which are used to represent characters that cannot be represented by 16-bit Unicode, wherein the high-order surrogate interval is [0xD800, 0xDBFF] and the low-order surrogate interval is [0xDC00, 0xDFFF]. The embodiment of the present invention can determine the emoticon encoding constituted by the characters in the text data by judging the relationship between the Unicode encoding of the characters in the text data and the surrogate pair.
[0060] Step 520: Determine the font index tag corresponding to the emoticon in the emoticon atlas font according to the emoticon code, wherein the emoticon atlas font is generated according to an integrated emoticon image and emoticon attribute data, wherein the integrated emoticon image is obtained by merging multiple emoticon images, and the emoticon attribute data is generated based on the position information of each emoticon image in the integrated emoticon image.
[0061] In an embodiment of the present invention, text data includes strings and text fields, etc. In an embodiment of the present invention, an emoticon database can be imported to obtain multiple emoticon images in the emoticon database. The emoticon images in the emoticon database almost include all emoticons. Special emoticon images can be obtained and imported separately to improve the comprehensiveness of the integrated emoticon images, so that the emoticon collection fully includes emoticons that may be used. In an embodiment of the present invention, a python tool script can be used to convert the imported emoticon images into a preset size, such as a 32X32 image, and import it into a Unity project.
[0062] In an embodiment of the present invention, the emoji attribute data includes the position information of each emoji image in the integrated emoji image, and the unique emoji code corresponding to the emoji in each emoji image. The size of the integrated emoji image ensures that all emoji images can be merged, and its size can be obtained by taking the power of 2 as the image size through the calculation result of the number of emoji images * EmojiSize * EmojiSize. The emoji attribute data is Texture_Emoji_JsonArray data, that is, json data, and the data result of json data can be defined according to the code of the sprite import tool of Unity's built-in text rendering component TextMesh Pro.
[0063] In the embodiment of the present invention, the emoticon atlas font may be generated in the following manner:
[0064] Prepare the sprite import tool of the text rendering component TextMesh Pro, put in the integrated emoticon image (Texture image) and emoticon attribute data (json data), and click Export sprite font to generate the corresponding emoticon atlas font file (Emoji sprite font).
[0065] In the embodiment of the present invention, the emoticon corresponding to the text data may be determined according to the text data input by the user, and then the font index label of the emoticon in the emoticon atlas font may be further determined.
[0066] Step 530: Determine an emoticon image to be rendered in the emoticon atlas font according to the font index tag, render the emoticon image to be rendered, and generate an emoticon corresponding to the text data.
[0067] Among them, the text rendering component TextMeshPro in Unity can be used to render the emoticon image to be rendered to generate the corresponding emoticon.
[0068] In an embodiment of the present invention, after determining the font index tag, the position of the emoticon image to be rendered in the emoticon atlas font can be determined according to the font index tag, so that the text rendering component can accurately render the emoticon and generate the emoticon corresponding to the text data.
[0069] The embodiment of the present invention combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and can determine the corresponding emoticon image in the atlas font according to a variety of different text data input by the user, so as to generate diversified emoticons according to user needs, effectively improving the generation effect of emoticons; and through the font index tag, the emoticon image to be rendered can be quickly located, without the need to search and render each character separately, effectively improving the generation efficiency of emoticons.
[0070] In an optional manner, the surrogate pair includes a high surrogate interval and a low surrogate interval, and determining the emoticon encoding of the characters in the text data according to the Unicode encoding of the characters in the text data and the surrogate pair includes:
[0071] When the Unicode code of the current character is in the high surrogate interval and the Unicode code of the next character is in the low surrogate interval, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0072] In the embodiment of the present invention, the high-order surrogate interval is [0xD800, 0xDBFF], and the low-order surrogate interval is [0xDC00, 0xDFFF].
[0073] In an optional manner, the surrogate pair includes a high surrogate interval and a low surrogate interval, and determining the emoticon encoding of the characters in the text data according to the Unicode encoding of the characters in the text data and the surrogate pair further includes:
[0074] When the Unicode code of the current character is not in the high surrogate interval and the next character is a selection modifier or a connector, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0075] In the embodiment of the present invention, the modifier is selected as 0xfeof and the connector is selected as 0x200D. The embodiment of the present invention traverses the character string in the text data and compares each character with the surrogate pair and the special symbol code to determine all emoticon codes formed by the characters in the text data. All emoji codes in the text data may be single-encoding form emoji codes or multi-encoding form emoji codes. For example, a text data includes 6 character strings, the first character and the second character constitute the first emoji code, the third character and the fourth character constitute the second emoji code, and the fifth character and the sixth character constitute the third emoji code, wherein the first emoji code and other emoji codes cannot be combined into a multi-encoding form emoji code, that is, the first emoji code is a single-encoding form emoji code; the second emoji code and the third emoji code constitute a multi-encoding form emoji code, that is, the text data contains a single-encoding form emoji code and a multi-encoding form emoji code, and the integrated emoji image also includes emoji codes corresponding to single-encoding form emojis and multi-encoding form emojis. By determining all emoji codes in the text data, the font index label of the corresponding emoji in the emoji atlas font can be accurately determined according to the emoji codes.
[0076] In an optional manner, the determining, according to the emoji code, a font index tag corresponding to the emoji in the emoji atlas font further includes:
[0077] Determine the emoji corresponding to the emoji code in the emoji atlas font, and obtain the index of the emoji;
[0078] A font index tag for the emoji is generated based on the index.
[0079] In an embodiment of the present invention, the emoji atlas font includes emoji attribute data, wherein the emoji attribute data includes an emoji code corresponding to each emoji, and the emoji code of the text data is searched in the emoji atlas font to determine whether it exists. If so, the index index of the emoji code is obtained and converted into a font index tag.<sprite=index> , so that the text rendering component TextMeshPro can search for the corresponding emoji image in the emoji atlas according to the font index tag when rendering, so that the emoji can be rendered according to the correlation between the emoji code and the emoji atlas.
[0080] The embodiment of the present invention determines the emoticon corresponding to the emoticon encoding in the emoticon atlas font and obtains the index of the emoticon to generate a font index tag. It can quickly find the emoticon based on the font index tag, and can quickly and accurately generate the corresponding emoticon according to the text data input by the user, effectively improving the generation effect of the emoticon.
[0081] In an optional manner, after generating the emoji atlas font, the method further includes:
[0082] The emoji atlas font is updated according to the acquired backup atlas font.
[0083] In an embodiment of the present invention, the backup atlas font can be a fallback font, and the emoji atlas sub-image can be an Emoji sprite font. In an embodiment of the present invention, the dynamically added backup atlas font can be added to the emoji atlas font. When the text data entered by the user cannot be displayed due to some reasons (such as the font file failed to load, the font does not support certain characters, etc.), the fallback font can ensure that the text content can still be read; the fallback font can specify different fonts for different character sets to ensure that all texts can be displayed correctly, thereby ensuring that text content in different languages can be displayed normally. When the user enters text data, TextMeshPro will automatically search for text data that conforms to the encoding in the updated emoji atlas font.
[0084] In an optional manner, determining the emoji image to be rendered in the emoji atlas font according to the font index tag includes:
[0085] Determine the position information of the emoticon image corresponding to the font index tag in the emoticon atlas font;
[0086] The emoticon image corresponding to the position information is determined as the emoticon image to be rendered.
[0087] In the embodiment of the present invention, by determining the accurate position information of the emoticon image, it can be ensured that the required emoticon can be found quickly and accurately during the rendering process, which can effectively improve the efficiency and accuracy of the rendering.
[0088] In an optional manner, during the emoji generation process, asynchronous loading and caching technology is used to effectively reduce the time for loading emojis and related image resources, thereby effectively improving the response time for generating emojis, and further effectively improving the efficiency of emoji generation.
[0089] In an alternative approach, Figure 6 FIG. 2 shows a flow chart of a text character processing process according to an embodiment of the present invention. Figure 6 As shown, after inputting text data, the text data is decoded into Unicode characters, and the emoji atlas font is queried based on the decoded characters to see whether there is a corresponding emoji. If so, it is added as a sprite tag, and the text data is continued to be decoded into Unicode characters; if not, the current character is added as ordinary text, so that the final displayed content can include emojis and / or ordinary text.
[0090] In the embodiment of the present invention, for text data in a specific encoding format, the decoding speed and decoding accuracy can be improved by optimizing the encoder. For example, for text data encoded in UTF-8, a more efficient decoding algorithm can be used.
[0091] In an optional approach, a third-party library may be used to process the mixing of images and text and to render emojis, so as to solve common performance and compatibility issues and improve the reliability of emoji generation.
[0092] In an alternative approach, Figure 7 A schematic diagram of a process for generating an atlas font file is shown in FIG. Figure 7 As shown, the process of generating atlas font files includes:
[0093] Step 710: Obtain multiple emoji images from the emoji-data image library;
[0094] Step 720: using a python tool to convert multiple emoticon images into images of uniform resolution;
[0095] Step 730: Import the uniform resolution image into Unity, and generate the intermediate atlas and atlas information record file required by TextMeshPro through a custom tool;
[0096] In the embodiment of the present invention, TextMeshPro is a text rendering component in Unity. Among them, the intermediate atlas and the atlas information record file are both json files, and the intermediate atlas and the atlas information record file work together to optimize the storage and rendering of sprites. The intermediate atlas can be an integrated picture obtained by integrating multiple emoticon pictures of uniform resolution. The atlas information record file includes the attribute information of the emoticon picture, including the position information of the emoticon in the intermediate atlas, and the emoticon code corresponding to each emoticon.
[0097] Step 740: Use the Sprite lmport tool to import the intermediate atlas into the TMP Sprite Asset; wherein, TMP Sprite Asset is a core component in the Unity TextMesh Pro plug-in, which is used to manage and reference sprites resources.
[0098] Step 750: Generate atlas font files.
[0099] The implementation of the embodiments of the present invention has the following beneficial effects:
[0100] The embodiment of the present invention combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and can determine the corresponding emoticon image in the atlas font according to text data input by the user, so as to generate diversified emoticons according to user needs, effectively improving the generation effect of emoticons; and through the font index tag, the emoticon image to be rendered can be quickly located, without the need to search and render each character separately, effectively improving the generation efficiency of emoticons.
[0101] Furthermore, the embodiment of the present invention updates the emoticon atlas font through the backup atlas font, thereby ensuring that text contents in different languages can be displayed normally, further improving the generation effect of emoticons.
[0102] Figure 8 FIG. 2 is a schematic diagram showing the structure of an embodiment of an emoticon generating device of the present invention. Figure 8As shown, the device 800 includes: a font index tag confirmation module 810 and an emoticon generation module 820.
[0103] The font index label confirmation module 810 is used to determine the font index label of the corresponding emoticon in the emoticon atlas font according to the text data input by the user; wherein the emoticon atlas font is generated according to the integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture;
[0104] The emoticon generation module 820 is used to determine the emoticon image to be rendered in the emoticon atlas font according to the font index tag, and render the emoticon image to be rendered to generate the emoticon corresponding to the text data.
[0105] In an optional manner, the font index tag confirmation module 810 further includes:
[0106] An emoticon code determination unit, used for traversing each character of the text data, and determining the emoticon code formed by the characters in the text data according to the Unicode code and the surrogate pair of the characters in the text data;
[0107] The font index label confirmation unit is used to determine the font index label corresponding to the emoticon in the emoticon atlas font according to the emoticon code.
[0108] In an optional manner, the surrogate pair includes a high surrogate interval and a low surrogate interval, and the emoticon code determination unit is further used to:
[0109] When the Unicode code of the current character is in the high surrogate interval and the Unicode code of the next character is in the low surrogate interval, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0110] In an optional manner, the emoticon code determination unit is further used for:
[0111] When the Unicode code of the current character is not in the high surrogate interval and the next character is a selection modifier or a connector, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0112] In an optional manner, the font index tag confirmation unit is further used for:
[0113] Determine the emoji corresponding to the emoji code in the emoji atlas font, and obtain the index of the emoji;
[0114] A font index tag for the emoji is generated based on the index.
[0115] In an optional manner, the emoticon generating device further includes an atlas font updating module, which is used to:
[0116] The emoji atlas font is updated according to the acquired backup atlas font.
[0117] In an optional manner, the emoticon generation module 820 is further used for:
[0118] Determine the position information of the emoticon image corresponding to the font index tag in the emoticon atlas font;
[0119] The emoticon image corresponding to the position information is determined as the emoticon image to be rendered.
[0120] The embodiment of the present invention combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and can determine the corresponding emoticon image in the atlas font according to text data input by the user, so as to generate diversified emoticons according to user needs, effectively improving the generation effect of emoticons; and through the font index tag, the emoticon image to be rendered can be quickly located, without the need to search and render each character separately, effectively improving the generation efficiency of emoticons.
[0121] Furthermore, the embodiment of the present invention updates the emoticon atlas font through the backup atlas font, thereby ensuring that text contents in different languages can be displayed normally, further improving the generation effect of emoticons.
[0122] Fig. 9 The schematic diagram of the structure of an embodiment of the emoticon generating device of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the emoticon generating device.
[0123] like Fig. 9 As shown, the emoticon generating device may include: a processor (processor) 902 , a communication interface (Communications Interface) 904 , a memory (memory) 906 , and a communication bus 908 .
[0124] The processor 902, the communication interface 904, and the memory 906 communicate with each other via a communication bus 908. The communication interface 904 is used to communicate with other devices such as a client or other server network elements. The processor 902 is used to execute a program 910, which can specifically execute the relevant steps in the above-mentioned embodiment of the method for generating emoticons.
[0125] Specifically, the program 910 may include program code, which includes computer-executable instructions.
[0126] The processor 902 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the emoticon generating device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0127] The memory 906 is used to store the program 910. The memory 906 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0128] Program 910 may be specifically called by processor 902 to enable the emoticon generating device to perform the following operations:
[0129] Determine, according to the text data input by the user, a font index tag of the corresponding emoticon in the emoticon atlas font; wherein the emoticon atlas font is generated according to an integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture;
[0130] According to the font index tag, an emoticon image to be rendered is determined in the emoticon atlas font, and the emoticon image to be rendered is rendered to generate an emoticon corresponding to the text data.
[0131] In an optional manner, the program 910 is called by the processor 902 to enable the emoticon generating device to perform the following operations:
[0132] Traversing each character of the text data, and determining the emoticon code formed by the characters in the text data according to the Unicode code and the surrogate pair of the characters in the text data;
[0133] Determine a font index tag corresponding to the emoji in the emoji atlas font according to the emoji code.
[0134] In an optional manner, the program 910 is called by the processor 902 to enable the emoticon generating device to perform the following operations:
[0135] When the Unicode code of the current character is in the high surrogate interval and the Unicode code of the next character is in the low surrogate interval, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0136] In an optional manner, the program 910 is called by the processor 902 to enable the emoticon generating device to perform the following operations:
[0137] When the Unicode code of the current character is not in the high surrogate interval and the next character is a selection modifier or a connector, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0138] In an optional manner, the program 910 is called by the processor 902 to enable the emoticon generating device to perform the following operations:
[0139] Determine the emoji corresponding to the emoji code in the emoji atlas font, and obtain the index of the emoji;
[0140] A font index tag for the emoji is generated based on the index.
[0141] In an optional manner, the program 910 is called by the processor 902 to enable the emoticon generating device to perform the following operations:
[0142] The emoji atlas font is updated according to the acquired backup atlas font.
[0143] In an optional manner, the program 910 is called by the processor 902 to enable the emoticon generating device to perform the following operations:
[0144] Determine the position information of the emoticon image corresponding to the font index tag in the emoticon atlas font;
[0145] The emoticon image corresponding to the position information is determined as the emoticon image to be rendered.
[0146] The embodiment of the present invention combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and can determine the corresponding emoticon image in the atlas font according to text data input by the user, so as to generate diversified emoticons according to user needs, effectively improving the generation effect of emoticons; and through the font index tag, the emoticon image to be rendered can be quickly located, without the need to search and render each character separately, effectively improving the generation efficiency of emoticons.
[0147] Furthermore, the embodiment of the present invention updates the emoticon atlas font through the backup atlas font, thereby ensuring that text contents in different languages can be displayed normally, further improving the generation effect of emoticons.
[0148] An embodiment of the present invention provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on an emoticon generating device / apparatus, the emoticon generating device / apparatus executes the emoticon generating method in any of the above method embodiments.
[0149] The executable instructions may be specifically used to enable the emoticon generating device / apparatus to perform the following operations:
[0150] Determine, according to the text data input by the user, a font index tag of the corresponding emoticon in the emoticon atlas font; wherein the emoticon atlas font is generated according to an integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture;
[0151] According to the font index tag, an emoticon image to be rendered is determined in the emoticon atlas font, and the emoticon image to be rendered is rendered to generate an emoticon corresponding to the text data.
[0152] In an optional manner, the executable instruction enables the emoticon generating device / apparatus to perform the following operations:
[0153] Traversing each character of the text data, and determining the emoticon code formed by the characters in the text data according to the Unicode code and the surrogate pair of the characters in the text data;
[0154] Determine a font index tag corresponding to the emoji in the emoji atlas font according to the emoji code.
[0155] In an optional manner, the executable instruction enables the emoticon generating device / apparatus to perform the following operations:
[0156] When the Unicode code of the current character is in the high surrogate interval and the Unicode code of the next character is in the low surrogate interval, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0157] In an optional manner, the executable instruction enables the emoticon generating device / apparatus to perform the following operations:
[0158] When the Unicode code of the current character is not in the high surrogate interval and the next character is a selection modifier or a connector, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
[0159] In an optional manner, the executable instruction enables the emoticon generating device / apparatus to perform the following operations:
[0160] Determine the emoji corresponding to the emoji code in the emoji atlas font, and obtain the index of the emoji;
[0161] A font index tag for the emoji is generated based on the index.
[0162] In an optional manner, the executable instruction enables the emoticon generating device / apparatus to perform the following operations:
[0163] The emoji atlas font is updated according to the acquired backup atlas font.
[0164] In an optional manner, the executable instruction enables the emoticon generating device / apparatus to perform the following operations:
[0165] Determine the position information of the emoticon image corresponding to the font index tag in the emoticon atlas font;
[0166] The emoticon image corresponding to the position information is determined as the emoticon image to be rendered.
[0167] The embodiment of the present invention combines multiple emoticon images into an integrated emoticon image, and generates an emoticon atlas font in combination with emoticon attribute data, so that the emoticon atlas contains comprehensive emoticons, and can determine the corresponding emoticon image in the atlas font according to text data input by the user, so as to generate diversified emoticons according to user needs, effectively improving the generation effect of emoticons; and through the font index tag, the emoticon image to be rendered can be quickly located, without the need to search and render each character separately, effectively improving the generation efficiency of emoticons.
[0168] Furthermore, the embodiment of the present invention updates the emoticon atlas font through the backup atlas font, thereby ensuring that text contents in different languages can be displayed normally, further improving the generation effect of emoticons.
[0169] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.
[0170] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.
[0171] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0172] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A method for generating emoticons, characterized in that: Suitable for in-vehicle systems, including: Determine, according to the text data input by the user, a font index tag of the corresponding emoticon in the emoticon atlas font; wherein the emoticon atlas font is generated according to an integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture; According to the font index tag, an emoticon image to be rendered is determined in the emoticon atlas font, and the emoticon image to be rendered is rendered to generate an emoticon corresponding to the text data.
2. The emoticon generation method according to claim 1, characterized in that: The step of determining the font index label of the corresponding emoticon in the emoticon atlas font according to the text data input by the user includes: Traversing each character of the text data, and determining the emoticon code formed by the characters in the text data according to the Unicode code and the surrogate pair of the characters in the text data; Determine a font index tag corresponding to the emoji in the emoji atlas font according to the emoji code.
3. The emoticon generation method according to claim 2, characterized in that: The surrogate pair includes a high surrogate interval and a low surrogate interval, and determining the emoticon encoding of the characters in the text data according to the Unicode encoding of the characters in the text data and the surrogate pair includes: When the Unicode code of the current character is in the high surrogate interval and the Unicode code of the next character is in the low surrogate interval, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
4. The emoticon generation method according to claim 2, characterized in that: The surrogate pair includes a high surrogate interval and a low surrogate interval, and the determining the emoticon encoding of the characters in the text data according to the Unicode encoding of the characters in the text data and the surrogate pair also includes: When the Unicode code of the current character is not in the high surrogate interval and the next character is a selection modifier or a connector, the Unicode code of the current character and the Unicode code of the next character are determined as an emoticon code until all emoticon codes in the text data are determined.
5. The emoticon generation method according to claim 2, characterized in that: The step of determining the font index tag corresponding to the emoji in the emoji atlas font according to the emoji code also includes: Determine the emoji corresponding to the emoji code in the emoji atlas font, and obtain the index of the emoji; A font index tag for the emoji is generated based on the index.
6. The emoticon generation method according to claim 1, characterized in that: After generating the emoji atlas font, it also includes: The emoji atlas font is updated according to the acquired backup atlas font.
7. The method for generating emoticons according to any one of claims 1 to 6, characterized in that: The step of determining the emoji image to be rendered in the emoji atlas font according to the font index tag includes: Determine the position information of the emoticon image corresponding to the font index tag in the emoticon atlas font; The emoticon image corresponding to the position information is determined as the emoticon image to be rendered.
8. An emoticon generating device, characterized in that: Suitable for in-vehicle systems, including: A font index label confirmation module, used to determine the font index label of the corresponding emoticon in the emoticon atlas font according to the text data input by the user; wherein the emoticon atlas font is generated according to the integrated emoticon picture and emoticon attribute data, the integrated emoticon picture is obtained by merging multiple emoticon pictures, and the emoticon attribute data is generated based on the position information of each emoticon picture in the integrated emoticon picture; The emoticon generation module is used to determine the emoticon image to be rendered in the emoticon atlas font according to the font index tag, and render the emoticon image to be rendered to generate the emoticon corresponding to the text data.
9. An emoticon generating device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the emoticon generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction, and when the executable instruction is executed on the emoticon generating device / apparatus, the emoticon generating device / apparatus performs the operation of the emoticon generating method as described in any one of claims 1-7.