WO2022001408A1 - Character display method, character display apparatus, and terminal device - Google Patents

Character display method, character display apparatus, and terminal device Download PDF

Info

Publication number
WO2022001408A1
WO2022001408A1 PCT/CN2021/093595 CN2021093595W WO2022001408A1 WO 2022001408 A1 WO2022001408 A1 WO 2022001408A1 CN 2021093595 W CN2021093595 W CN 2021093595W WO 2022001408 A1 WO2022001408 A1 WO 2022001408A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
font
information
display
terminal device
Prior art date
Application number
PCT/CN2021/093595
Other languages
French (fr)
Chinese (zh)
Inventor
谢鲁冰
罗义
Original Assignee
荣耀终端有限公司
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 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2022001408A1 publication Critical patent/WO2022001408A1/en

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

Definitions

  • the present application relates to the technical field of terminals, and in particular, to a character display method, a character display device and a terminal device.
  • the operating system of the terminal device usually has its own system font package, such as the Hei font package, the Kai font package, the Song font package, and so on.
  • the terminal device can also install themed font packages according to user instructions, such as the Youyuan font package, the Chinese Xingkai font package, and the Huakang Doll body font package.
  • the system font package includes almost all Chinese characters, but the theme font package is usually made according to the GB2312 standard, which only contains 6763 commonly used Chinese characters. Therefore, when the terminal device uses the theme font to display Chinese characters, when the Chinese character to be displayed is a rare character that is not included in the theme font package, the terminal device will not be able to display the rare character, or can only display the rare character according to the system font. Causes the font to display abnormally.
  • the present application provides a character display method, a character display device and a terminal device, which can solve the problem of abnormal font display in the terminal device to a certain extent.
  • an embodiment of the present application provides a character display method, which is applied to a terminal device, and the method includes:
  • the second outline information of the target character is obtained from the second font package, and the second outline information is used to display in the first font.
  • the second font displays the target character
  • the second outline information identify each character unit in the target character, and the position information of each character unit in the target character;
  • the target character is displayed in the first font according to the sub-outline information of each character unit corresponding to the first font and the position information.
  • the terminal device when the terminal device encounters a character that cannot be displayed in the first font, it can identify each character unit and each character unit included in the character according to the existing second outline information of the character position information within the character. And according to the preset sub-outline information of each character unit corresponding to the first font, and the position information, the character is displayed intelligently in the first font, which avoids the problem of abnormal font display in the terminal device to a certain extent, and improves the user's experience. Text reading experience.
  • displaying the target character in the first font according to the sub-contour information corresponding to the first font for each character unit and the position information includes:
  • the target character is displayed in the first font according to the first outline information.
  • the character display method further includes storing the first outline information in a first font package corresponding to the first font.
  • the first outline information of the target character can be directly called from the first font package, which is beneficial to improve the display efficiency of the terminal device.
  • displaying the target character in the first font according to the sub-contour information corresponding to the first font for each character unit and the position information includes:
  • the position information determine the display position of each character unit in the target character in the display area
  • Each character unit is displayed in the first font at a corresponding display position according to the sub-contour information to display the target character.
  • the sub-contour information is determined according to a plurality of basic characteristic characters in a first font package corresponding to the first font, and the plurality of basic characteristic characters include the target character each character unit in .
  • the method further comprises:
  • the sub-contour information is determined according to the third contour information.
  • this embodiment provides a character display device, which is applied to a terminal device, and the character display device includes:
  • the information acquisition unit in the process of displaying the characters in the first font, if the target character cannot be displayed in the first font, acquires the second outline information of the target character from the second font package, the second outline information for displaying the target character in a second font;
  • an identification unit for identifying each character unit in the target character according to the second outline information, and position information of the each character unit in the target character
  • a display control unit configured to display the target character in the first font according to the sub-outline information of each character unit corresponding to the first font and the position information.
  • this embodiment provides a terminal device, including a display unit, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer
  • the character display method described in the first aspect above is implemented in a program.
  • this embodiment provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the character display method described in the first aspect.
  • an embodiment of the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the character display method described in the first aspect above.
  • an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to achieve the above-mentioned first aspect. character display method described above.
  • the chip system may be a single chip or a chip module composed of multiple chips.
  • FIG. 1 is a schematic structural diagram of a mobile phone to which a character display method provided by an embodiment of the present application is applicable;
  • FIG. 2 is a schematic diagram of a software architecture to which the character display method provided by an embodiment of the present application is applicable;
  • FIG. 3 shows the characters shown in this embodiment A schematic diagram of the contour information
  • FIG. 4 is a schematic diagram 1 of a display interface provided in this embodiment.
  • FIG. 5 is a second schematic diagram of a display interface provided in this embodiment.
  • FIG. 6 is a schematic diagram 3 of a display interface provided in this embodiment.
  • FIG. 7 is a fourth schematic diagram of a display interface provided in this embodiment.
  • FIG. 8 is a flowchart of a method for displaying characters according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of the position of a character unit according to an embodiment of the present application.
  • 10a is a schematic diagram 1 of a display principle of a character provided by an embodiment of the present application.
  • 10b is a second schematic diagram of a display principle of a character provided by an embodiment of the application.
  • FIG. 10c is a schematic diagram 3 of a display principle of a character according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a display interface provided by an embodiment of the present application.
  • FIG. 12 is a flowchart of a method for determining a first character unit set provided by an embodiment of the present application
  • FIG. 13 is a flowchart of a method for determining a second character unit set provided by an embodiment of the present application.
  • FIG. 14 is a schematic block diagram of the structure of a character display device provided by an embodiment of the present application.
  • the character display method provided in the embodiments of the present application can be applied to terminal devices capable of displaying text information, such as mobile phones, tablet computers, e-readers, notebook computers, netbooks, and wearable devices. any restrictions.
  • FIG. 1 shows a block diagram of a partial structure of a mobile phone provided by an embodiment of the present application.
  • the mobile phone includes a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a wireless fidelity (WiFi) module 170, a processor 180, And components such as power supply 190 .
  • RF radio frequency
  • the structure of the mobile phone shown in FIG. 1 does not constitute a limitation on the mobile phone, and may include more or less components than the one shown, or combine some components, or arrange different components.
  • the RF circuit 110 can be used for receiving and sending signals during sending and receiving of information or during a call.
  • the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • RF circuitry 110 may communicate with networks and other devices via wireless communications.
  • the above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division) Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (Short Messaging Service, SMS), etc.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the memory 120 can be used to store text information, software programs and modules, and the processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120 .
  • the memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a character display function), and the like; the storage data area may store files created according to the use of the mobile phone. data (such as text information), etc.
  • memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input unit 130 may be used for receiving inputted numerical or character information, and generating key signal input related to user setting and function control of the mobile phone.
  • the input unit 130 may include a touch panel 131 and other input devices 132 .
  • the touch panel 131 also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable objects or accessories on or near the touch panel 131 ). operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 131 may include two parts, a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller.
  • the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 130 may also include other input devices 132 .
  • Other input devices 132 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 140 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 140 may include a display panel 141.
  • the display panel 141 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), and the like.
  • the touch panel 131 may cover the display panel 141, and when the touch panel 131 detects a touch operation on or near it, it transmits it to the processor 180 to determine the type of the touch event, and then the processor 180 determines the type of the touch event according to the touch event. Type provides corresponding visual output on display panel 141 .
  • the touch panel 131 and the display panel 141 are used as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 131 and the display panel 141 can be integrated to form a Realize the input and output functions of the mobile phone.
  • the cell phone may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and/or when the mobile phone is moved to the ear. or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes), and can detect the magnitude and direction of gravity when it is stationary. games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. Repeat.
  • the audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile phone.
  • the audio circuit 160 can transmit the received audio data converted electrical signal to the speaker 161, and the speaker 161 converts it into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 160 After receiving, it is converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to, for example, another mobile phone through the RF circuit 110, or the audio data is output to the memory 120 for further processing.
  • WiFi is a short-distance wireless transmission technology
  • the mobile phone can help users to send and receive emails, browse web pages and access streaming media through the WiFi module 170, which provides users with wireless broadband Internet access.
  • FIG. 1 shows the WiFi module 170, it can be understood that it is not a necessary component of the mobile phone, and can be completely omitted as required within the scope of not changing the essence of the invention.
  • the processor 180 is the control center of the mobile phone, using various interfaces and lines to connect various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 120, and calling the data stored in the memory 120.
  • the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc. , the modem processor mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 180 .
  • the processing units in the processor 180 include: a text control unit (Text View) 1801, a text drawing unit (Draw Text) 1802, and a graphics drawing engine 1803.
  • the text control unit 1801 is used to determine display information such as the content, font size, and display shape of the text.
  • the text drawing unit 1802 is used to control the typesetting style of the text.
  • the graphics rendering engine (Skia) 1803 is used to finally determine the display image of the text in the display interface according to the display information and typesetting style of the text.
  • the cell phone also includes a power source 190 (eg, a battery) to power the various components.
  • a power source 190 eg, a battery
  • the power supply can be logically connected to the processor 180 through a power management system, so that functions such as managing charging, discharging, and power consumption are implemented through the power management system.
  • the cell phone may also include a camera.
  • the position of the camera on the mobile phone may be front or rear, which is not limited in this embodiment of the present application.
  • the mobile phone may include a single camera, a dual camera, or a triple camera, etc., which is not limited in this embodiment of the present application.
  • a cell phone may include three cameras, one for the main camera, one for the wide-angle camera, and one for the telephoto camera.
  • the mobile phone includes multiple cameras, the multiple cameras may all be front-mounted, or all of the cameras may be rear-mounted, or some of the cameras may be front-mounted and the other may be rear-mounted, which is not limited in this embodiment of the present application.
  • the mobile phone may also include a Bluetooth module, etc., which will not be described in detail here.
  • FIG. 2 is a schematic diagram of a software structure of a mobile phone according to an embodiment of the present application.
  • the Android system is divided into four layers, which are an application layer, an application framework layer (framework, FWK), a system layer, and a hardware abstraction layer. communicate through a software interface.
  • an application layer an application framework layer (framework, FWK)
  • FWK application framework layer
  • system layer a hardware abstraction layer.
  • the application layer can be a series of application packages, and the application package can include applications such as SMS, calendar, camera, video, navigation, gallery, and calling.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer may include some predefined functions, such as functions for receiving events sent by the application framework layer.
  • the application framework layer may include a window manager, a resource manager, a notification manager, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
  • the application framework layer can also include:
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and the like. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide the communication functions of the mobile phone. For example, the management of call status (including connecting, hanging up, etc.).
  • the system layer can include multiple functional modules. For example: sensor service module, physical state recognition module, 3D graphics processing library (eg: OpenGL ES), etc.
  • sensor service module physical state recognition module
  • 3D graphics processing library eg: OpenGL ES
  • the sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer and determine the physical state of the mobile phone;
  • the physical state recognition module is used to analyze and recognize user gestures, faces, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • the system layer can also include:
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the hardware abstraction layer is the layer between hardware and software.
  • the hardware abstraction layer can include display drivers, camera drivers, sensor drivers, etc., which are used to drive the related hardware of the hardware layer, such as display screens, cameras, sensors, and so on.
  • the following embodiments can be implemented on a mobile phone having the above-mentioned hardware structure/software structure.
  • the following embodiments will take a mobile phone as an example to describe the character display method provided by the embodiment of the present application.
  • the terminal device for example, a mobile phone
  • text information is usually composed of multiple characters.
  • characters may include letters (such as “X”, “Y”, “Z”), numbers (such as “1", “2”, “3"), Chinese characters (such as “now”, “ ⁇ ", “of") and symbols (such as ",”, "#", "!), etc., are used to represent specific meanings.
  • the terminal device when the terminal device stores text information, it does not directly store each character in the text information, but stores the unique universal identifier corresponding to these characters according to the arrangement order of each character in the text information, such as Unicode (Unicode). ).
  • the unique universal identifier is used to uniquely indicate the corresponding character.
  • the terminal device stores the text information "the weather is sunny today, there are no clouds in the sky", it actually stores the corresponding Unicode "4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91".
  • the terminal device When displaying text information, the terminal device needs to convert the unique universal identifier corresponding to the text information into corresponding characters according to preset rules for display, so that the user can understand it intuitively.
  • a font package In order to facilitate the conversion of the unique universal identifier into characters for display, a font package is usually provided in the terminal device.
  • a font package usually contains outline information for some characters in one or more languages.
  • the GB2312 standard font package usually includes 6763 specific Chinese characters and outline information of some commonly used non-Chinese characters.
  • the outline information determines the display shape and display position of the outer outline of each component in the character, and the terminal device can display the character according to the outline information.
  • Characters can usually be displayed in a variety of different fonts, and each font corresponds to a font package, for example, font A corresponds to font package A, font B corresponds to font package B, and so on. It can be understood that the corresponding outline information of the same character in different font packages is not the same. Based on the different outline information, the terminal device can display the same character in different fonts. For example, for the character "jin", the terminal device can use the outline information of "jin" in font package A to display "jin” in font A, and use the outline information of "jin” in font package B to display "jin” in the font A. B font display.
  • each character is provided with a unique universal identifier.
  • the unique universal identifier of each character corresponds to the outline information of that character.
  • 4ECA is the Unicode of "Jin”
  • 4ECA corresponds to the outline information of "Jin”
  • the terminal device can call the outline information of "Jin” from the font package through 4ECA.
  • 5929 is the Unicode of "day”.
  • 5929 corresponds to the outline information of "day”
  • the terminal device can call the outline information of "day” from the font package through 5929.
  • a unique universal identifier corresponds to different outline information of a character.
  • 4ECA corresponds to the outline information of the "jin" A font
  • 4ECA corresponds to the outline information of the "jin" B font
  • the terminal device calls the corresponding outline information from the font package to display each character according to the unique universal identifier.
  • Table 1 is a correspondence table of outline information of characters, Unicode and D fonts of characters.
  • the terminal device obtains the corresponding characters "Jin", “ ⁇ "
  • the outline information of the D font corresponding to "Qi”, “Qing”, “Lang”, “,”, “Wan”, “Li”, “Nu”, “Cloud”, and according to these outline information in the order corresponding to Unicode display these characters.
  • the display results of these characters may be as shown in FIG. 4 .
  • the terminal device when the font package currently applied by the terminal device is the E font package, the terminal device displays the text information in the E font, for example, as shown in FIG. 5 .
  • GB2312 stipulates that the font package contains 6763 specific Chinese characters and some commonly used non-Chinese characters.
  • GB18030-2000 stipulates that the font package contains 27533 specific Chinese characters, as well as some commonly used non-Chinese characters.
  • GB18030-2005 stipulates that the font package contains 70244 Chinese characters (including a large number of uncommon characters), as well as some commonly used non-Chinese characters. It can be understood that, when more characters are included in the font package, the production cost of the font package is higher, and the memory occupied by the font package is also larger.
  • a terminal device is usually provided with a system font package, and the system font package includes almost all outline information of Chinese characters.
  • the system font package may be an A font package, a B font package, a C font package, etc., which are used to display characters in A font, B font, and C font, respectively.
  • the terminal device specifies the A font as the display font of the character
  • the terminal device calls the outline information of the character from the A font package, and displays the corresponding character in the A font.
  • the terminal device may also be provided with a font package with a certain font style installed according to the user's instruction (for the convenience of distinguishing it from the system font package, it is hereinafter referred to as the theme font package), such as D font package, E font package , F font package, etc., are used to display characters in theme fonts such as D font, E font, and F font, respectively.
  • the theme font corresponding to the theme font package is different from the system font.
  • the theme font package is usually produced according to the GB2312 standard, which only contains 6763 commonly used Chinese characters and some commonly used non-Chinese characters.
  • the terminal device when the terminal device currently displays characters in the theme font, if the target character is some characters that are not included in the theme font package, such as a rare character, the terminal device will not be able to display the rare character, or display the rare character according to the system font, Causes the font to display abnormally.
  • the terminal device can display it in garbled characters, for example, as shown in Figure 6, and display it as a box with an "X" symbol, resulting in abnormal font display.
  • the terminal device can also retrieve the outline information of " ⁇ " from the system font package according to its unique universal identifier "8621", and display the word " ⁇ " according to the system font (such as A font), such as shown in Figure 7.
  • the system font such as A font
  • this will cause two different fonts, namely A font and F font, to appear on the same display interface, which will also cause the font to display abnormally.
  • the present application provides a character display method, which is applied to a terminal device to improve the problem of abnormal font display when the terminal device displays characters in a first font (eg, a theme font).
  • a first font eg, a theme font
  • the terminal device is installed with a first font package and a second font package, and is provided with a first character unit set corresponding to the first font package and a second character unit set corresponding to the second font package. Also, the terminal device is currently set to display characters in the first font.
  • the first font package includes outline information of characters of the first font
  • the second font package includes outline information of characters of the second font.
  • the first font package may be a theme font package installed by a user.
  • the second font package may be a system font package installed on the terminal device, or other non-system font package different from the first font package, which is not limited in this embodiment.
  • the first character unit set includes sub-contour information of character units of the first font, as shown in Table 2, for example.
  • the second character unit set includes sub-contour information of character units of the second font, as shown in Table 3, for example.
  • these character units include, but are not limited to: “ ⁇ ", “Bei”, “ ⁇ ", “ ⁇ ", “ ⁇ ", “B”, “ ⁇ ”, “ ⁇ ", “ ⁇ ”, “er” ", “Sun", “A”, “Cun”, “Earth”, “Sun”, “Bird”, “Square”, “Wind”, “Father”, “King”, “Fire”, “Wei”, “Insect”, “Yu”, “ ⁇ ", “ ⁇ ”, “ ⁇ ”, etc. constitute the character units commonly used in characters.
  • each character unit is provided with identification information for uniquely indicating the character unit.
  • the same identification information corresponds to the sub-contour information of different fonts of the same character unit.
  • “1" is the identification information of "Fuck”.
  • "1" corresponds to the sub-contour information of the first font of "Fuck”; but in the second character unit set, "1" corresponds to "Fuck”.
  • "Fuck" sub-contour information of the second font is provided with identification information for uniquely indicating the character unit.
  • FIG. 8 is a flowchart of a character display method provided by an embodiment of the present application. Referring to FIG. 8, the character display method includes the following steps S801-S803.
  • S801 During the process of displaying characters in the first font, if the target character cannot be displayed in the first font, the terminal device acquires second outline information of the target character from a second font package, and the second outline information is used to display the characters in the second font.
  • the font displays the target characters.
  • the terminal device calls the first outline information corresponding to the target character in the first font package, and displays the target character according to the first outline information.
  • the first outline information is not included in the first font package, according to the prior art, the first terminal cannot display the character in the first font.
  • the second outline information of the character can be called from the second font package.
  • the terminal device in the process of displaying the character "Zhen ⁇ " in F font, the terminal device appears that the first outline information of " ⁇ " cannot be found in the F font package according to the unique universal identifier "8621" of the uncommon character " ⁇ ". , the first terminal will not be able to display the character in the first font.
  • the terminal device calls the second outline information of " ⁇ " from the second font package (such as the A font package of the system) according to the unique universal identifier "8621".
  • the terminal device identifies each character unit in the target character and position information of each character unit in the target character according to the second outline information.
  • the second outline information includes sub-outline information of each character unit of the corresponding character, and position information of each character unit in the character.
  • the terminal device can identify each character unit in the target character and position information of each character unit in the target character according to the second outline information, as shown in the following.
  • a character is usually composed of one or more strokes.
  • the part connecting the strokes is called a minimum unit.
  • the parts where the strokes of the character “Ming" are connected are “day” and “month”, so its minimum units are "day” and "month”.
  • the outline information of the character includes sub-contour information of the N minimum units, where N ⁇ 1, and N is an integer. Since a sub-contour information is used to describe the outer contour of a smallest unit, these sub-contour information are independent of each other when used to display small units.
  • the terminal device can determine the position of the outer contour of the minimum unit in the character display area according to the sub-contour information of the minimum unit, and the minimum unit can be displayed by filling the outer contour.
  • the character can be displayed by displaying all the smallest units of the character.
  • the terminal device when the terminal device recognizes the target character, it can use the sub-contour information of the smallest unit as the splitting unit to split the second contour information of the target character, and according to the split contour information, Determine the character unit.
  • Step S802 will be described below by taking the character " ⁇ " as an example.
  • the terminal device recognizes the sub-contour information of the smallest unit in the character " ⁇ " according to the second outline information of the character " ⁇ ". Since the minimum unit of the character “ ⁇ ” includes eight parts: “ ⁇ ”, two “mu”, two “ ⁇ ”, two “ ⁇ ” and one "female", the corresponding sub-contour of the minimum unit The information is shown in Table 4.
  • the terminal device can combine the sub-contour information of each minimum unit, and identify the character unit of the target character according to the combination result.
  • the combination mode is a combination mode that satisfies the condition.
  • the terminal device determines the character unit of the target character according to this combination. It can be understood that a character unit may include one or more minimum units.
  • Part1-Part8 of the character “ ⁇ ” can be combined into the following four parts: Part1, Part2-Part4, Part5-Part7, Part8. Since Part1 can match the sub-contour information of "Fuck” in the second character unit set, Part2-Part4 and Part5-Part7 can match the sub-contour information of "Bei” in the second character unit set, and Part8 can match the sub-contour information of "Bei” in the second character unit set. The sub-contour information of "female” is matched in the two-character unit set. Therefore, the combination mode is determined to be a combination mode that satisfies the conditions.
  • the terminal device can recognize that the character units corresponding to " ⁇ " are: “ ⁇ ”, “Bei”, “Bei”, and “ ⁇ ” according to the combination method. In combination with Table 3, it can be determined that among these character units, the identification information of "Fuck” is 1, the identification information of "Bei” is 2, and the identification information of "Female” is 3.
  • the character units " ⁇ ", "” can also be determined according to Part1, Part2-Part4, Part5-Part7, and Part8 respectively.
  • the terminal device may identify, according to the second outline information of the character " ⁇ ", that the character units of “ ⁇ ” include: “ ⁇ ", two “bei” and “female".
  • the terminal device can determine that " ⁇ ” is at the top of the character “ ⁇ ”, “female” is at the bottom of the character “ ⁇ ”, and two “bei” are arranged side by side between “ ⁇ ” and “female”. Location.
  • the terminal device may identify the target character according to the principle of maximizing character units, and reduce the number of character units as much as possible. Specifically, if the sub-contour information of the minimum unit of the target character includes multiple combinations that meet the conditions, the character unit is determined according to the combination with the smallest number of groups.
  • the combination of the sub-contour information of the smallest unit that satisfies the condition includes combination 1 and combination 2.
  • the combination mode 1 is: Part1, Part2-Part4, Part5-Part7, Part8;
  • the combination mode 2 is: Part1, Part2, Part3-Part4, Part5, Part6-Part7, Part8.
  • the terminal device displays the target character in the first font according to the sub-contour information corresponding to each character unit and the first font and the position information.
  • the terminal device may call the sub-outline information of the first font of each character unit from the first character unit set according to the identification information of these character units. For example, the terminal device may determine the sub-contours of "Fuck”, “Bei” and “Female” in the first font from the corresponding first character unit set according to the identification information "1", "2" and "3" respectively. information.
  • the terminal device After determining the sub-contour information of the first font of each character unit in the target character from the first character unit set, the terminal device can display the target character in various ways.
  • the terminal device may generate the first outline information of the target character according to the sub-contour information and position information of the first font of each character unit in the target character. Then, the target character is displayed in the first font according to the generated first outline information.
  • the terminal device may also store the generated first outline information in the first font package. It can be understood that when the terminal device encounters the target character again, it can directly call its first outline information from the first font package to display the target character in the first font, thereby improving the efficiency of character display by the terminal device.
  • the terminal device determines the F fonts of the character units " ⁇ ", "Bei” and “female” included in the character " ⁇ ”. After the sub-contour information of the character unit “ ⁇ ", two “bei” and “female” in the character " ⁇ ", the first outline information of " ⁇ " is generated and stored, and then according to the first outline The information displays the character " ⁇ " in F font.
  • the first outline information of " ⁇ " finally generated by the terminal device also corresponds to the F font.
  • the " ⁇ " finally displayed by the terminal device according to the first outline information is also in F font.
  • the terminal device determines the display area of the target character in the display interface. Then, according to the position information of each character unit in the target character, the display position of each character unit in the display area is determined. Finally, each character unit is displayed in the first font at the corresponding display position according to the sub-contour information of each character unit in the target character, so that the target character is displayed in the first font.
  • the terminal device determines the display area of the character " ⁇ " in the display interface. Then, for example, as shown in FIG. 10b, the terminal device determines the display positions of these character units in the display area according to the position information of the character units " ⁇ ", "Bei" and " ⁇ " in the character " ⁇ ". Wherein, the display position of the character unit " ⁇ " is position 1, the display position of "Bei” is position 2 and position 3, and the display position of "female” is position 4.
  • the terminal device displays "Fuck” at position 1 in F font according to the sub-contour information of "Fuck”, and displays F font at position 2 and position 3 according to the sub-contour information of "Bei” According to the sub-contour information of "female", “female” is displayed at position 4 in F font, so as to display the character " ⁇ " in F font.
  • all "Zhenzhen” can be displayed on the display interface in F font, as shown in FIG. 11 , for example.
  • the character display method provided in this embodiment is adopted, and the memory is occupied.
  • the smaller first font package and the second font package that comes with the terminal device can intelligently display the character in the first font, which avoids the problem of abnormal font display on the terminal device to a certain extent, and improves the user's text reading experience.
  • the first character unit set and the second character unit set may be preset by the terminal device, or may be generated by the terminal device according to a plurality of preset basic characteristic characters. The generation process of the first character unit set and the second character unit set will be described below with reference to FIG. 12 and FIG. 13 respectively.
  • FIG. 12 is a flowchart of a method for determining a first character unit set provided by an embodiment of the present application. Referring to FIG. 12, the method includes the following steps S1201-S1203.
  • the terminal device acquires third outline information of a plurality of preset basic characteristic characters from a first font package.
  • the basic characteristic characters usually include multiple, exemplarily, these basic characteristic characters include but are not limited to: “ten”, “billion”, “grass”, “goods”, “wei”, “nuisance” , “Duck”, “Special”, “Sign”, “De”, “Eight” and so on.
  • These basic characteristic characters include most of the commonly used character units, such as: “ ⁇ ”, “Bei”, “Female”, “Sun”, “Jia”, “Cun”, “Tu”, “ ⁇ ", “ ⁇ ” etc.
  • the unique universal identifier (eg Unicode) of this basic characteristic character can be preset in the terminal device. According to these preset unique universal identifiers, the terminal device can directly call the third outline information of these basic characteristic characters from the first font package. Wherein, the third outline information is used to display the plurality of basic characteristic characters in the first font.
  • the terminal device determines, according to the third outline information, the sub-outline information of the first font of all different character units in the plurality of basic characteristic characters.
  • the terminal device may preset a character unit determination rule for each basic characteristic character, and determine the sub-contour of the character unit according to the rule. information. For example, for the character "Ming”, in the outline information of "Ming", the sub-outline information of the character unit displayed on the left side of "Ming" is determined as the sub-outline information of "Day”; "The sub-contour information of the character unit on the right is determined as the sub-contour information of "month”.
  • the terminal device can determine the required sub-contour information of the first font of the character unit from the third outline information of a plurality of basic characteristic characters according to the character unit determination rule corresponding to each basic characteristic character.
  • the terminal device generates a first set of character units according to the sub-contour information of the first font of all different character units in the plurality of basic characteristic characters.
  • the basic characteristic characters are all different, they may include the same character units. Therefore, when storing the sub-contour information of the character unit in the basic characteristic character, only the sub-contour information of all different character units may be stored.
  • the basic feature character includes both "flower” and "grass”
  • the third outline information of the character “flower” includes the sub-outline information of the character units " ⁇ ", " ⁇ ” and “ ⁇ ”
  • the character " The third contour information of "Grass” includes sub-contour information of the character units "Fuck” and "Zao". For the repeated character unit "Fuck”, only the sub-contour information of one of the "Fuck” can be stored.
  • FIG. 13 is a flowchart of a method for determining a second character unit set provided by an embodiment of the present application. Referring to Fig. 13, the method includes the following steps S1301-S1303.
  • the terminal device acquires fourth outline information of a plurality of preset basic characteristic characters from a second font package.
  • step S1301 are the same as the basic characteristic characters in step S1202, and are not repeated in this implementation.
  • step S1301 according to the preset unique universal identifiers of these basic characteristic characters, the terminal device can directly call the fourth outline information of these basic characteristic characters from the second font package. Wherein, the fourth outline information is used to display the plurality of basic characteristic characters in the second font.
  • the terminal device determines, according to the fourth outline information, the sub-outline information of the second font of all different character units in the plurality of basic characteristic characters.
  • step S1302 according to the character unit determination rule corresponding to each basic characteristic character, the terminal device can determine the required sub-elements of different character units of the basic characteristic character of the second font from the fourth outline information of the plurality of basic characteristic characters profile information. For details, reference may be made to step S1202, which is not repeated in this embodiment.
  • the terminal device generates a second character unit set according to the sub-contour information of the second font of different character units in the plurality of basic characteristic characters.
  • the terminal device stores the sub-contour information of all the different character units of the second font in the basic characteristic characters to form a second character unit set. For details, reference may be made to step S1203, which is not repeated in this embodiment.
  • this embodiment also provides a character display device.
  • the parts related to the embodiments of the present application are shown.
  • the character display device provided by the embodiment of the present application includes an information acquisition unit 1401 , an identification unit 1402 , and a display control unit 1403 .
  • the information acquisition unit 1401 is used to obtain the second outline information of the target character from the second font package if the target character cannot be displayed in the first font during the process of displaying the character in the first font, and the second outline information is used for Displays the target character in the second font.
  • the identifying unit 1402 is configured to identify each character unit in the target character and position information of each character unit in the target character according to the second outline information.
  • the display control unit 1403 is configured to display the target character in the first font according to the sub-contour information corresponding to the first font according to each character unit and the position information.
  • the display control unit 1403 is further configured to determine the first outline information of the target character according to the sub-contour information and position information corresponding to each character unit of the target character and the first font; A font displays the target characters.
  • the display control unit 1403 is further configured to store the first outline information in the first font package corresponding to the first font.
  • the display control unit 1403 is also used to determine the display area of the target character in the display interface; according to the position information, determine the display position of each character unit in the target character in the display area; The display position of each character unit is displayed in the first font to display the target character.
  • the sub-contour information is determined according to a plurality of basic characteristic characters in the first font package corresponding to the first font, and the plurality of basic characteristic characters include each character unit in the target character.
  • the display control unit 1403 is further configured to obtain third outline information of multiple basic characteristic characters from the first font package, and the third outline information is used to display the plurality of basic characteristic characters in the first font; according to The third contour information determines sub-contour information.
  • This embodiment also provides a terminal device, the terminal device includes a memory, a processor, a display unit, and a computer program stored in the memory and running on the processor, and the processor implements the foregoing embodiment when the computer program is executed.
  • Provided character display method See Figure 1 for details.
  • This embodiment also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
  • the computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the character display device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signals telecommunication signals
  • software distribution media For example, U disk, mobile hard disk, disk or CD, etc.
  • computer readable media may not be electrical carrier signals and telecommunications signals.
  • Embodiments of the present application also provide a computer program product including instructions.
  • the computer program product when run on a computer or processor, causes the computer or processor to perform one or more steps of any of the above methods.
  • An embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to realize the character display provided by the above-mentioned embodiments of the present application method.
  • the chip system may be a single chip or a chip module composed of multiple chips.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted over a computer-readable storage medium.
  • the computer instructions can be sent from one website site, computer, server, or data center to another website site, computer, server by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.) or data center for transmission.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random storage memory RAM and other media that can store program codes.

Landscapes

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

Abstract

Provided are a character display method, a character display apparatus, and a terminal device, which relate to the technical field of terminals. The character display method comprises: during the process of a terminal device displaying a character in a first font, if a target character cannot be displayed in the first font, the terminal device acquiring second outline information of the target character from a second font packet, wherein the second outline information is used for displaying the target character in a second font (S801); the terminal device identifying, according to the second outline information, each character unit in the target character, and position information of each character unit in the target character (S802); and the terminal device displaying the target character in the first font according to sub-outline information, corresponding to the first font, of each character unit, and the position information (S803). By means of the provided character display method, a terminal device can avoid abnormal font display to a certain extent.

Description

字符显示方法、字符显示装置及终端设备Character display method, character display device and terminal equipment
本申请要求于2020年06月28日提交国家知识产权局、申请号为202010598200.7、申请名称为“字符显示方法、字符显示装置及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010598200.7 and the application title "Character Display Method, Character Display Device and Terminal Equipment", which was submitted to the State Intellectual Property Office on June 28, 2020, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及终端技术领域,尤其涉及一种字符显示方法、字符显示装置及终端设备。The present application relates to the technical field of terminals, and in particular, to a character display method, a character display device and a terminal device.
背景技术Background technique
终端设备的操作系统通常自带有系统字体包,例如黑体字体包、楷体字体包、宋体字体包等。此外,终端设备也可以根据用户指令安装主题字体包,例如幼圆字体包、华文行楷字体包、华康娃娃体字体包等。The operating system of the terminal device usually has its own system font package, such as the Hei font package, the Kai font package, the Song font package, and so on. In addition, the terminal device can also install themed font packages according to user instructions, such as the Youyuan font package, the Chinese Xingkai font package, and the Huakang Doll body font package.
目前,系统字体包几乎包括了所有的汉字,但是主题字体包通常是根据GB2312标准制作的,其中仅包含6763个常用的汉字。因此,当终端设备在使用主题字体显示汉字时,当待显示的汉字为主题字体包中不包含的生僻字时,终端设备将无法显示该生僻字,或者只能按照系统字体显示该生僻字,导致字体显示异常。At present, the system font package includes almost all Chinese characters, but the theme font package is usually made according to the GB2312 standard, which only contains 6763 commonly used Chinese characters. Therefore, when the terminal device uses the theme font to display Chinese characters, when the Chinese character to be displayed is a rare character that is not included in the theme font package, the terminal device will not be able to display the rare character, or can only display the rare character according to the system font. Causes the font to display abnormally.
发明内容SUMMARY OF THE INVENTION
本申请提供一种字符显示方法、字符显示装置及终端设备,能够在一定程度上解决终端设备出现字体显示异常的问题。The present application provides a character display method, a character display device and a terminal device, which can solve the problem of abnormal font display in the terminal device to a certain extent.
为达到上述目的,本申请采用如下技术方案:To achieve the above object, the application adopts the following technical solutions:
第一方面,本申请实施例提供一种字符显示方法,应用于终端设备,所述方法包括:In a first aspect, an embodiment of the present application provides a character display method, which is applied to a terminal device, and the method includes:
在以第一字体显示字符的过程中,若目标字符不能以所述第一字体显示,则从第二字体包中获取所述目标字符的第二轮廓信息,所述第二轮廓信息用于以第二字体显示所述目标字符;In the process of displaying the characters in the first font, if the target character cannot be displayed in the first font, the second outline information of the target character is obtained from the second font package, and the second outline information is used to display in the first font. The second font displays the target character;
根据所述第二轮廓信息,识别所述目标字符中的每个字符单元,以及所述每个字符单元在所述目标字符中的位置信息;According to the second outline information, identify each character unit in the target character, and the position information of each character unit in the target character;
根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符。The target character is displayed in the first font according to the sub-outline information of each character unit corresponding to the first font and the position information.
采用本实施例提供的字符显示方法,当终端设备遇到无法以第一字体显示的字符时,可以根据该字符已有的第二轮廓信息,识别该字符包括的各个字符单元,以及各个字符单元在该字符中的位置信息。并根据预设的每个字符单元与第一字体对应的子轮廓信息,和该位置信息,以第一字体智能显示该字符,在一定程度上避免终端设备出现字体显示异常的问题,提升用户的文本阅读体验。With the character display method provided in this embodiment, when the terminal device encounters a character that cannot be displayed in the first font, it can identify each character unit and each character unit included in the character according to the existing second outline information of the character position information within the character. And according to the preset sub-outline information of each character unit corresponding to the first font, and the position information, the character is displayed intelligently in the first font, which avoids the problem of abnormal font display in the terminal device to a certain extent, and improves the user's experience. Text reading experience.
在第一方面的一些实施例中,根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符,包括:In some embodiments of the first aspect, displaying the target character in the first font according to the sub-contour information corresponding to the first font for each character unit and the position information, includes:
根据所述子轮廓信息和所述位置信息,确定所述目标字符的第一轮廓信息;According to the sub-contour information and the position information, determine the first contour information of the target character;
根据所述第一轮廓信息,以所述第一字体显示所述目标字符。The target character is displayed in the first font according to the first outline information.
在第一方面的一些实施例中,所述字符显示方法还包括,将所述第一轮廓信息存储到所述第一字体对应的第一字体包中。In some embodiments of the first aspect, the character display method further includes storing the first outline information in a first font package corresponding to the first font.
可以理解,当终端设备再次遇到该目标字符时,可以直接从第一字体包中调用该目标字符的第一轮廓信息,有利于提高终端设备的显示效率。It can be understood that when the terminal device encounters the target character again, the first outline information of the target character can be directly called from the first font package, which is beneficial to improve the display efficiency of the terminal device.
在第一方面的一些实施例中,根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符,包括:In some embodiments of the first aspect, displaying the target character in the first font according to the sub-contour information corresponding to the first font for each character unit and the position information, includes:
确定所述目标字符在显示界面中的显示区域;determining the display area of the target character in the display interface;
根据所述位置信息,确定目标字符中的每个字符单元在所述显示区域中的显示位置;According to the position information, determine the display position of each character unit in the target character in the display area;
根据所述子轮廓信息在对应的显示位置,以所述第一字体显示所述每个字符单元,以显示所述目标字符。Each character unit is displayed in the first font at a corresponding display position according to the sub-contour information to display the target character.
可以理解,通过直接在该字符的显示区域以第一字体显示其包括的各个字符单元,从而显示目标字符,避免了生成轮廓信息的过程,有助于快速显示该目标字符。It can be understood that by directly displaying each character unit included in the character display area in the first font, the target character is displayed, the process of generating outline information is avoided, and the target character can be displayed quickly.
在第一方面的一些实施例中,所述子轮廓信息是根据所述第一字体对应的第一字体包中的多个基本特征字符确定的,所述多个基本特征字符包括所述目标字符中的每个字符单元。In some embodiments of the first aspect, the sub-contour information is determined according to a plurality of basic characteristic characters in a first font package corresponding to the first font, and the plurality of basic characteristic characters include the target character each character unit in .
在第一方面的一些实施例中,所述方法还包括:In some embodiments of the first aspect, the method further comprises:
从所述第一字体包中获取所述多个基本特征字符的第三轮廓信息,所述第三轮廓信息用于以所述第一字体显示所述多个基本特征字符;obtaining third outline information of the plurality of basic characteristic characters from the first font package, where the third outline information is used to display the plurality of basic characteristic characters in the first font;
根据所述第三轮廓信息,确定所述子轮廓信息。The sub-contour information is determined according to the third contour information.
第二方面,本实施例提供一种字符显示装置,应用于终端设备,所述字符显示装置包括:In a second aspect, this embodiment provides a character display device, which is applied to a terminal device, and the character display device includes:
信息获取单元,在以第一字体显示字符的过程中,若目标字符不能以所述第一字体显示,则从第二字体包中获取所述目标字符的第二轮廓信息,所述第二轮廓信息用于以第二字体显示所述目标字符;The information acquisition unit, in the process of displaying the characters in the first font, if the target character cannot be displayed in the first font, acquires the second outline information of the target character from the second font package, the second outline information for displaying the target character in a second font;
识别单元,用于根据所述第二轮廓信息,识别所述目标字符中的每个字符单元,以及所述每个字符单元在所述目标字符中的位置信息;an identification unit for identifying each character unit in the target character according to the second outline information, and position information of the each character unit in the target character;
显示控制单元,用于根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符。A display control unit, configured to display the target character in the first font according to the sub-outline information of each character unit corresponding to the first font and the position information.
第三方面,本实施例提供一种终端设备,包括显示单元、存储器、处理器,以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的字符显示方法。In a third aspect, this embodiment provides a terminal device, including a display unit, a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer The character display method described in the first aspect above is implemented in a program.
第四方面,本实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面所述的字符显示方法。In a fourth aspect, this embodiment provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the character display method described in the first aspect.
第五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面所述的字符显示方法。In a fifth aspect, an embodiment of the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the character display method described in the first aspect above.
第六方面,本申请实施例提供一种芯片系统,所述芯片系统包括处理器,所述处 理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如上述第一方面所述的字符显示方法。在本实施例中,所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。In a sixth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to achieve the above-mentioned first aspect. character display method described above. In this embodiment, the chip system may be a single chip or a chip module composed of multiple chips.
可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the foregoing second aspect to the sixth aspect, reference may be made to the relevant descriptions in the foregoing first aspect, and details are not described herein again.
附图说明Description of drawings
图1为本申请一实施例提供的字符显示方法所适用于的手机的结构示意图;1 is a schematic structural diagram of a mobile phone to which a character display method provided by an embodiment of the present application is applicable;
图2为本申请一实施例提供的字符显示方法所适用于的软件架构示意图;2 is a schematic diagram of a software architecture to which the character display method provided by an embodiment of the present application is applicable;
图3为本实施例示出的字符
Figure PCTCN2021093595-appb-000001
的轮廓信息的示意图;
FIG. 3 shows the characters shown in this embodiment
Figure PCTCN2021093595-appb-000001
A schematic diagram of the contour information;
图4为本实施例提供的一种显示界面示意图一;FIG. 4 is a schematic diagram 1 of a display interface provided in this embodiment;
图5为本实施例提供的一种显示界面示意图二;FIG. 5 is a second schematic diagram of a display interface provided in this embodiment;
图6为本实施例提供的一种显示界面示意图三;FIG. 6 is a schematic diagram 3 of a display interface provided in this embodiment;
图7为本实施例提供的一种显示界面示意图四;FIG. 7 is a fourth schematic diagram of a display interface provided in this embodiment;
图8为本申请实施例提供的一种字符显示方法的流程图;FIG. 8 is a flowchart of a method for displaying characters according to an embodiment of the present application;
图9为本申请实施例提供的一种字符单元的位置示意图;FIG. 9 is a schematic diagram of the position of a character unit according to an embodiment of the present application;
图10a为本申请实施例提供的一种字符的显示原理的示意图一;10a is a schematic diagram 1 of a display principle of a character provided by an embodiment of the present application;
图10b为本申请实施例提供的一种字符的显示原理的示意图二;10b is a second schematic diagram of a display principle of a character provided by an embodiment of the application;
图10c为本申请实施例提供的一种字符的显示原理的示意图三;FIG. 10c is a schematic diagram 3 of a display principle of a character according to an embodiment of the present application;
图11为本申请实施例提供的一种显示界面的示意图;11 is a schematic diagram of a display interface provided by an embodiment of the present application;
图12为本申请实施例提供的第一字符单元集合的确定方法流程图;12 is a flowchart of a method for determining a first character unit set provided by an embodiment of the present application;
图13为本申请实施例提供的第二字符单元集合的确定方法流程图;13 is a flowchart of a method for determining a second character unit set provided by an embodiment of the present application;
图14为本申请实施例提供的字符显示装置的结构示意框图。FIG. 14 is a schematic block diagram of the structure of a character display device provided by an embodiment of the present application.
具体实施方式detailed description
本申请实施例提供的字符显示方法可以应用于手机、平板电脑、电子阅读器、笔记本电脑、上网本、可穿戴设备等能够显示文本信息的终端设备上,本申请实施例对终端设备的具体类型不作任何限制。The character display method provided in the embodiments of the present application can be applied to terminal devices capable of displaying text information, such as mobile phones, tablet computers, e-readers, notebook computers, netbooks, and wearable devices. any restrictions.
应理解,本申请中涉及的第一、第二、第三以及各种数字编号仅为描述方便进行的区分,并不用来限制本申请的范围。It should be understood that the first, second, third and various numeral numbers involved in the present application are only for the convenience of description, and are not used to limit the scope of the present application.
以终端设备为手机为例。图1示出的是本申请实施例提供的手机的部分结构的框图。参见图1,手机包括射频(Radio Frequency,RF)电路110、存储器120、输入单元130、显示单元140、传感器150、音频电路160、无线保真(wireless fidelity,WiFi)模块170、处理器180、以及电源190等部件。本领域技术人员可以理解,图1中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Take the terminal device as a mobile phone as an example. FIG. 1 shows a block diagram of a partial structure of a mobile phone provided by an embodiment of the present application. Referring to FIG. 1 , the mobile phone includes a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a wireless fidelity (WiFi) module 170, a processor 180, And components such as power supply 190 . Those skilled in the art can understand that the structure of the mobile phone shown in FIG. 1 does not constitute a limitation on the mobile phone, and may include more or less components than the one shown, or combine some components, or arrange different components.
下面结合图1对手机的各个构成部件进行具体的介绍:The following describes the various components of the mobile phone in detail with reference to Figure 1:
RF电路110可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器180处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路110还可以通过无线通信与网络 和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 110 can be used for receiving and sending signals during sending and receiving of information or during a call. In particular, after receiving the downlink information of the base station, it is processed by the processor 180; in addition, the designed uplink data is sent to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 110 may communicate with networks and other devices via wireless communications. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division) Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (Short Messaging Service, SMS), etc.
存储器120可用于存储文本信息、软件程序以及模块,处理器180通过运行存储在存储器120的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如字符显示功能)等;存储数据区可存储根据手机的使用所创建的数据(比如文本信息)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 120 can be used to store text information, software programs and modules, and the processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120 . The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a character display function), and the like; the storage data area may store files created according to the use of the mobile phone. data (such as text information), etc. Additionally, memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
输入单元130可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元130可包括触控面板131以及其他输入设备132。触控面板131,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板131上或在触控面板131附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板131可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板131。除了触控面板131,输入单元130还可以包括其他输入设备132。其他输入设备132可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 130 may be used for receiving inputted numerical or character information, and generating key signal input related to user setting and function control of the mobile phone. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132 . The touch panel 131, also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable objects or accessories on or near the touch panel 131 ). operation), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 131 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 180, and can receive the commands sent by the processor 180 and execute them. In addition, the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. Besides the touch panel 131 , the input unit 130 may also include other input devices 132 . Other input devices 132 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
显示单元140可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元140可包括显示面板141,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板141。进一步的,触控面板131可覆盖显示面板141,当触控面板131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图1中,触控面板131与显示面板141是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板131与显示面板141集成而实现手机的输入和输出功能。The display unit 140 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), and the like. Further, the touch panel 131 may cover the display panel 141, and when the touch panel 131 detects a touch operation on or near it, it transmits it to the processor 180 to determine the type of the touch event, and then the processor 180 determines the type of the touch event according to the touch event. Type provides corresponding visual output on display panel 141 . Although in FIG. 1, the touch panel 131 and the display panel 141 are used as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 131 and the display panel 141 can be integrated to form a Realize the input and output functions of the mobile phone.
手机还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在手机移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态 的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The cell phone may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and/or when the mobile phone is moved to the ear. or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes), and can detect the magnitude and direction of gravity when it is stationary. games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. Repeat.
音频电路160、扬声器161,传声器162可提供用户与手机之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,传声器162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一手机,或者将音频数据输出至存储器120以便进一步处理。The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile phone. The audio circuit 160 can transmit the received audio data converted electrical signal to the speaker 161, and the speaker 161 converts it into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 160 After receiving, it is converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to, for example, another mobile phone through the RF circuit 110, or the audio data is output to the memory 120 for further processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块170可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图1示出了WiFi模块170,但是可以理解的是,其并不属于手机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-distance wireless transmission technology, and the mobile phone can help users to send and receive emails, browse web pages and access streaming media through the WiFi module 170, which provides users with wireless broadband Internet access. Although FIG. 1 shows the WiFi module 170, it can be understood that it is not a necessary component of the mobile phone, and can be completely omitted as required within the scope of not changing the essence of the invention.
处理器180是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理单元;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。The processor 180 is the control center of the mobile phone, using various interfaces and lines to connect various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 120, and calling the data stored in the memory 120. Various functions of the mobile phone and processing data, so as to monitor the mobile phone as a whole. Optionally, the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc. , the modem processor mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 180 .
处理器180中的处理单元包括:文本控制单元(Text View)1801、文本绘制单元(Draw Text)1802、图形绘制引擎1803。其中,文本控制单元1801,用于确定文本的内容、字体大小、显示形状等显示信息。文本绘制单元1802,用于控制文本的排版样式。图形绘制引擎(Skia)1803,用于根据文本的显示信息和排版样式,最终确定文本在显示界面中的显示图像。The processing units in the processor 180 include: a text control unit (Text View) 1801, a text drawing unit (Draw Text) 1802, and a graphics drawing engine 1803. Among them, the text control unit 1801 is used to determine display information such as the content, font size, and display shape of the text. The text drawing unit 1802 is used to control the typesetting style of the text. The graphics rendering engine (Skia) 1803 is used to finally determine the display image of the text in the display interface according to the display information and typesetting style of the text.
手机还包括给各个部件供电的电源190(比如电池)。优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The cell phone also includes a power source 190 (eg, a battery) to power the various components. Preferably, the power supply can be logically connected to the processor 180 through a power management system, so that functions such as managing charging, discharging, and power consumption are implemented through the power management system.
尽管未示出,手机还可以包括摄像头。可选地,摄像头在手机的上的位置可以为前置的,也可以为后置的,本申请实施例对此不作限定。Although not shown, the cell phone may also include a camera. Optionally, the position of the camera on the mobile phone may be front or rear, which is not limited in this embodiment of the present application.
可选地,手机可以包括单摄像头、双摄像头或三摄像头等,本申请实施例对此不作限定。例如,手机可以包括三摄像头,其中,一个为主摄像头、一个为广角摄像头、一个为长焦摄像头。当手机包括多个摄像头时,这多个摄像头可以全部前置,或者全部后置,或者一部分前置、另一部分后置,本申请实施例对此不作限定。Optionally, the mobile phone may include a single camera, a dual camera, or a triple camera, etc., which is not limited in this embodiment of the present application. For example, a cell phone may include three cameras, one for the main camera, one for the wide-angle camera, and one for the telephoto camera. When the mobile phone includes multiple cameras, the multiple cameras may all be front-mounted, or all of the cameras may be rear-mounted, or some of the cameras may be front-mounted and the other may be rear-mounted, which is not limited in this embodiment of the present application.
另外,尽管未示出,手机还可以包括蓝牙模块等,在此不再赘述。In addition, although not shown, the mobile phone may also include a Bluetooth module, etc., which will not be described in detail here.
图2是本申请实施例的手机的软件结构示意图。以手机操作系统为Android系统为例,在一些实施例中,将Android系统分为四层,分别为应用程序层、应用程序框架层(framework,FWK)、系统层以及硬件抽象层,层与层之间通过软件接口通信。FIG. 2 is a schematic diagram of a software structure of a mobile phone according to an embodiment of the present application. Taking the mobile phone operating system as the Android system as an example, in some embodiments, the Android system is divided into four layers, which are an application layer, an application framework layer (framework, FWK), a system layer, and a hardware abstraction layer. communicate through a software interface.
如图2所示,应用程序层可以一系列应用程序包,应用程序包可以包括短信息,日历,相机,视频,导航,图库,通话等应用程序。As shown in Figure 2, the application layer can be a series of application packages, and the application package can include applications such as SMS, calendar, camera, video, navigation, gallery, and calling.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层可以包括一些预先定义的函数,例如用于接收应用程序框架层所发送的事件的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer may include some predefined functions, such as functions for receiving events sent by the application framework layer.
如图2所示,应用程序框架层可以包括窗口管理器、资源管理器以及通知管理器等。As shown in FIG. 2, the application framework layer may include a window manager, a resource manager, a notification manager, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc. Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
应用程序框架层还可以包括:The application framework layer can also include:
视图系统,所述视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and the like. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供手机的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication functions of the mobile phone. For example, the management of call status (including connecting, hanging up, etc.).
系统层可以包括多个功能模块。例如:传感器服务模块,物理状态识别模块,三维图形处理库(例如:OpenGL ES)等。The system layer can include multiple functional modules. For example: sensor service module, physical state recognition module, 3D graphics processing library (eg: OpenGL ES), etc.
传感器服务模块,用于对硬件层各类传感器上传的传感器数据进行监测,确定手机的物理状态;The sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer and determine the physical state of the mobile phone;
物理状态识别模块,用于对用户手势、人脸等进行分析和识别;The physical state recognition module is used to analyze and recognize user gestures, faces, etc.;
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
系统层还可以包括:The system layer can also include:
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
硬件抽象层是硬件和软件之间的层。硬件抽象层可以包括显示驱动,摄像头驱动,传感器驱动等,用于驱动硬件层的相关硬件,如显示屏、摄像头、传感器等。The hardware abstraction layer is the layer between hardware and software. The hardware abstraction layer can include display drivers, camera drivers, sensor drivers, etc., which are used to drive the related hardware of the hardware layer, such as display screens, cameras, sensors, and so on.
以下实施例可以在具有上述硬件结构/软件结构的手机上实现。以下实施例将以手机为例,对本申请实施例提供的字符显示方法进行说明。The following embodiments can be implemented on a mobile phone having the above-mentioned hardware structure/software structure. The following embodiments will take a mobile phone as an example to describe the character display method provided by the embodiment of the present application.
本实施例提供的终端设备(例如手机)能够存储并显示文本信息。其中,文本信息通常是由多个字符组成的。示例性的,字符可以包括字母(如“X”、“Y”、“Z”)、数 字(如“1”、“2”、“3”)、汉字(如“今”、“天”、“的”)和符号(如“,”、“#”、“!”)等,用于代表特定的含义。The terminal device (for example, a mobile phone) provided in this embodiment can store and display text information. Among them, text information is usually composed of multiple characters. Exemplarily, characters may include letters (such as "X", "Y", "Z"), numbers (such as "1", "2", "3"), Chinese characters (such as "now", "天", "of") and symbols (such as ",", "#", "!"), etc., are used to represent specific meanings.
需要说明的是,终端设备在存储文本信息时,并不是直接存储文本信息中的各个字符,而是按照文本信息中各个字符的排列顺序,存储这些字符所对应唯一通用标识,例如统一码(Unicode)。该唯一通用标识用于唯一指示对应的字符。示例性的,终端设备在存储文本信息“今天天气晴朗,万里无云”时,实际上存储的是其对应的Unicode“4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91”。It should be noted that when the terminal device stores text information, it does not directly store each character in the text information, but stores the unique universal identifier corresponding to these characters according to the arrangement order of each character in the text information, such as Unicode (Unicode). ). The unique universal identifier is used to uniquely indicate the corresponding character. Exemplarily, when the terminal device stores the text information "the weather is sunny today, there are no clouds in the sky", it actually stores the corresponding Unicode "4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91".
终端设备在显示文本信息时,需要将文本信息对应的唯一通用标识,按照预设的规则转化为对应的字符进行显示,以便用户可以直观地理解。When displaying text information, the terminal device needs to convert the unique universal identifier corresponding to the text information into corresponding characters according to preset rules for display, so that the user can understand it intuitively.
为了便于将唯一通用标识转化为字符进行显示,终端设备中通常设置有字体包。字体包中通常包含一个或多个语言下一些字符的轮廓信息。例如,GB2312标准的字体包中,通常包括了6763个特定的汉字以及一些常用的非汉字符号的轮廓信息。其中,轮廓信息确定了字符中各个组成部分的外轮廓的显示形状和显示位置,终端设备根据轮廓信息即可显示字符。示例性的,对于唯一通用标识为“#369b”的字符
Figure PCTCN2021093595-appb-000002
其轮廓信息可以如图3所示。
In order to facilitate the conversion of the unique universal identifier into characters for display, a font package is usually provided in the terminal device. A font package usually contains outline information for some characters in one or more languages. For example, the GB2312 standard font package usually includes 6763 specific Chinese characters and outline information of some commonly used non-Chinese characters. The outline information determines the display shape and display position of the outer outline of each component in the character, and the terminal device can display the character according to the outline information. Exemplarily, for the character with the unique universal identifier "#369b"
Figure PCTCN2021093595-appb-000002
Its contour information can be shown in Figure 3.
字符通常能够以各种各样不同的字体显示,每一种字体均对应一种字体包,例如A字体对应A字体包、B字体对应B字体包等。可以理解,同一字符在不同的字体包中,对应的轮廓信息不相同,基于不同的轮廓信息,终端设备可以将同一字符显示为不同的字体。例如,对于字符“今”,终端设备可以利用A字体包中“今”的轮廓信息,将“今”以A字体显示,利用B字体包中“今”的轮廓信息,将“今”的以B字体显示。Characters can usually be displayed in a variety of different fonts, and each font corresponds to a font package, for example, font A corresponds to font package A, font B corresponds to font package B, and so on. It can be understood that the corresponding outline information of the same character in different font packages is not the same. Based on the different outline information, the terminal device can display the same character in different fonts. For example, for the character "jin", the terminal device can use the outline information of "jin" in font package A to display "jin" in font A, and use the outline information of "jin" in font package B to display "jin" in the font A. B font display.
此外,需要说明的是,每一个字符都设置有一个唯一通用标识。在一个字体包中,每个字符的唯一通用标识与该字符的轮廓信息对应。例如,4ECA为“今”的Unicode,在字体包中,4ECA与“今”的轮廓信息相对应,那么可终端设备以通过4ECA从字体包中调用“今”的轮廓信息。5929为“天”的Unicode,在字体包中,5929与“天”的轮廓信息相对应,那么终端设备可以通过5929从字体包中调用“天”的轮廓信息。在不同的字体包中,一个唯一通用标识对应一个字符不同的轮廓信息。例如,对于字符“今”的Unicode 4ECA,在A字体包中,4ECA与“今”A字体的轮廓信息相对应,在B字体包中,4ECA与“今”B字体的轮廓信息相对应。In addition, it should be noted that each character is provided with a unique universal identifier. In a font package, the unique universal identifier of each character corresponds to the outline information of that character. For example, 4ECA is the Unicode of "Jin", in the font package, 4ECA corresponds to the outline information of "Jin", then the terminal device can call the outline information of "Jin" from the font package through 4ECA. 5929 is the Unicode of "day". In the font package, 5929 corresponds to the outline information of "day", then the terminal device can call the outline information of "day" from the font package through 5929. In different font packages, a unique universal identifier corresponds to different outline information of a character. For example, for the Unicode 4ECA of the character "jin", in the A font package, 4ECA corresponds to the outline information of the "jin" A font, and in the B font package, 4ECA corresponds to the outline information of the "jin" B font.
终端设备在显示存储的文本信息的过程中,根据唯一通用标识,从字体包中调用对应的轮廓信息显示各个字符。In the process of displaying the stored text information, the terminal device calls the corresponding outline information from the font package to display each character according to the unique universal identifier.
以文本信息是“今天天气晴朗,万里无云”为例,根据终端设备应用的字体包的不同,根据其对应的唯一通用标识“4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91”,可以将该文本信息以不同的字体显示在显示界面上。Taking the text information as "the weather is sunny today, there are no clouds in the sky" as an example, according to the different font packages applied by the terminal device, according to the corresponding unique universal identifier "4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91", the Text information is displayed on the display interface in different fonts.
在一些实施例中,参见表1,表1为字符、Unicode与字符的D字体的轮廓信息的对应关系表。结合表1,终端设备在显示Unicode“4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91”对应的字符的过程中,根据这些Unicode,从D字体包中获取对应的字符“今”、“天”、“气”、“晴”、“朗”、“,”、“万”、“里”、“无”、“云”对应的D字体的轮廓信息,并根据这些轮廓信息按照与Unicode对应的顺序显示这些字符。示例性的,这些字符的显示结果可以如图4所示。In some embodiments, referring to Table 1, Table 1 is a correspondence table of outline information of characters, Unicode and D fonts of characters. Combined with Table 1, in the process of displaying the characters corresponding to Unicode "4ECA 5929 5929 6C14 6674 6717 002C 4E07 91CC 65E0 4E91", the terminal device obtains the corresponding characters "Jin", "天", The outline information of the D font corresponding to "Qi", "Qing", "Lang", ",", "Wan", "Li", "Nu", "Cloud", and according to these outline information in the order corresponding to Unicode display these characters. Exemplarily, the display results of these characters may be as shown in FIG. 4 .
表1对应关系表一Table 1 Correspondence Table 1
字符character UnicodeUnicode D字体的轮廓信息D font outline information
this 4ECA4ECA “今”的轮廓信息"Today" profile information
sky 59295929 “天”的轮廓信息"Sky" profile information
gas 6C146C14 “气”的轮廓信息"Qi" outline information
clear 66746674 “晴”的轮廓信息"Sunny" outline information
Long 67176717 “朗”的轮廓信息"Lang" profile information
ten thousand 4E074E07 “万”的轮廓信息"Wan" outline information
inside 91CC91CC “里”的轮廓信息"Li" outline information
none 65E065E0 “无”的轮廓信息"None" profile information
cloud 4E914E91 “云”的轮廓信息Outline information of "cloud"
, 002C002C “,”的轮廓信息"," outline information
在其它一些实施例中,当终端设备当前应用的字体包为E字体包时,终端设备以E字体显示该文本信息,例如图5所示。In some other embodiments, when the font package currently applied by the terminal device is the E font package, the terminal device displays the text information in the E font, for example, as shown in FIG. 5 .
字体包有不同的国家标准,例如GB2312、GB18030-2000、GB18030-2005等。其中,GB2312规定了字体包中包含6763个特定的汉字以及一些常用的非汉字符号。GB18030-2000规定了字体包中包含27533个特定的汉字,以及一些常用的非汉字符号,相比于GB2312增加了一些不常用的汉字。GB18030-2005规定了字体包中包含70244个汉字(其中包括大量的生僻字),以及一些常用的非汉字符号。可以理解的是,当字体包中包括的字符越多时,字体包的制作成本就越高,字体包的所占内存也就越大。There are different national standards for font packages, such as GB2312, GB18030-2000, GB18030-2005, etc. Among them, GB2312 stipulates that the font package contains 6763 specific Chinese characters and some commonly used non-Chinese characters. GB18030-2000 stipulates that the font package contains 27533 specific Chinese characters, as well as some commonly used non-Chinese characters. Compared with GB2312, some less commonly used Chinese characters are added. GB18030-2005 stipulates that the font package contains 70244 Chinese characters (including a large number of uncommon characters), as well as some commonly used non-Chinese characters. It can be understood that, when more characters are included in the font package, the production cost of the font package is higher, and the memory occupied by the font package is also larger.
目前,终端设备通常设置有系统字体包,系统字体包中几乎包括了所有的汉字的轮廓信息。示例性的,系统字体包可以为A字体包、B字体包、C字体包等,分别用于以A字体、B字体、C字体显示字符。示例性的,当终端设备指定A字体为字符的显示字体时,终端设备从A字体包调用字符的轮廓信息,以A字体显示对应的字符。At present, a terminal device is usually provided with a system font package, and the system font package includes almost all outline information of Chinese characters. Exemplarily, the system font package may be an A font package, a B font package, a C font package, etc., which are used to display characters in A font, B font, and C font, respectively. Exemplarily, when the terminal device specifies the A font as the display font of the character, the terminal device calls the outline information of the character from the A font package, and displays the corresponding character in the A font.
此外,终端设备中也可以设置有根据用户指令安装的具有一定字体风格的字体包(为了便于与系统字体包进行区分,下文中将其称为主题字体包),例如D字体包、E字体包、F字体包等,分别用于以D字体、E字体、F字体等主题字体显示字符。其中,需要说明的是,主题字体包对应的主题字体与系统字体不相同。为了节约成本,以及减少主题字体包对终端设备内存的占用,主题字体包通常是根据GB2312标准制作的,其中仅包含6763个常用的汉字以及一些常用的非汉字符号。In addition, the terminal device may also be provided with a font package with a certain font style installed according to the user's instruction (for the convenience of distinguishing it from the system font package, it is hereinafter referred to as the theme font package), such as D font package, E font package , F font package, etc., are used to display characters in theme fonts such as D font, E font, and F font, respectively. It should be noted that the theme font corresponding to the theme font package is different from the system font. In order to save costs and reduce the memory usage of the theme font package on the terminal device, the theme font package is usually produced according to the GB2312 standard, which only contains 6763 commonly used Chinese characters and some commonly used non-Chinese characters.
因此,当终端设备当前以主题字体显示字符时,如果目标字符为主题字体包中不包含的一些字符,例如生僻字时,终端设备将无法显示该生僻字,或者按照系统字体显示该生僻字,导致字体显示异常。Therefore, when the terminal device currently displays characters in the theme font, if the target character is some characters that are not included in the theme font package, such as a rare character, the terminal device will not be able to display the rare character, or display the rare character according to the system font, Causes the font to display abnormally.
示例性的,下面以终端设备当前应用的主题字体包是F字体包、系统字体包是A字体包为例,对字符“真”、“是”、“蘡”的显示情况进行说明。Exemplarily, the display of the characters "true", "yes", and "嘡" will be described below by taking the theme font package currently applied by the terminal device as F font package and the system font package as A font package.
“真”与“是”是F字体包中包括的常用汉字,因此,终端设备在显示“真”与“是”时,能够根据“真”与“是”的唯一通用标识“771F”与“662F”从F字体包中调用“真”与“是”的轮廓信息,并根据这些轮廓信息,以F字体显示“真”与“是”,具体参见图6或图7。"True" and "Yes" are common Chinese characters included in the F font package. Therefore, when the terminal device displays "True" and "Yes", it can identify "771F" and "771F" and " 662F" calls the outline information of "true" and "yes" from the F font package, and according to these outline information, displays "true" and "yes" in F font, see Figure 6 or Figure 7 for details.
“蘡”为F字体包中不包括的生僻字,即F字体包中不包括“蘡”的轮廓信息。因此,终端设备在显示字符“蘡”时,无法根据其唯一通用标识“8621”,在F字体包中查找到“蘡”的轮廓信息。因此,终端设备无法按照F字体显示字符“蘡”字。"阡" is a rare character not included in the F font package, that is, the outline information of "阡" is not included in the F font package. Therefore, when the terminal device displays the character "阡", it cannot find the outline information of "阡" in the F font package according to its unique universal identifier "8621". Therefore, the terminal device cannot display the character "蘡" according to the F font.
对于无法采用F字体显示的字符“蘡”,终端设备可以将其乱码显示,例如图6所示,将其显示为带有“×”符号的方框,导致字体显示异常。或者,终端设备也可以根据其唯一通用标识“8621”,从系统字体包中调取“蘡”的轮廓信息,并按照系统字体(例如A字体)显示“蘡”字,例如图7所示。但是这会使得同一显示界面出现两种不同的字体,即A字体和F字体,同样会导致字体显示异常。For the character "蘡" that cannot be displayed in F font, the terminal device can display it in garbled characters, for example, as shown in Figure 6, and display it as a box with an "X" symbol, resulting in abnormal font display. Alternatively, the terminal device can also retrieve the outline information of "阡" from the system font package according to its unique universal identifier "8621", and display the word "阡" according to the system font (such as A font), such as shown in Figure 7. However, this will cause two different fonts, namely A font and F font, to appear on the same display interface, which will also cause the font to display abnormally.
为此,本申请提供一种字符显示方法,该方法应用于终端设备,以改善终端设备在以第一字体(例如主题字体)显示字符时,出现字体显示异常的问题。To this end, the present application provides a character display method, which is applied to a terminal device to improve the problem of abnormal font display when the terminal device displays characters in a first font (eg, a theme font).
需要说明的是,该终端设备中安装有第一字体包、第二字体包,设置有与第一字体包对应的第一字符单元集合、与第二字体包对应的第二字符单元集合。并且,终端设备当前被设置为以第一字体显示字符。其中,第一字体包中包括有第一字体字符的轮廓信息,第二字体包中包括第二字体字符的轮廓信息。示例性的,该第一字体包可以为用户安装的主题字体包。该第二字体包可以为终端设备上安装的系统字体包,或者不同于第一字体包的其他非系统字体包,本实施例不进行限制。It should be noted that the terminal device is installed with a first font package and a second font package, and is provided with a first character unit set corresponding to the first font package and a second character unit set corresponding to the second font package. Also, the terminal device is currently set to display characters in the first font. The first font package includes outline information of characters of the first font, and the second font package includes outline information of characters of the second font. Exemplarily, the first font package may be a theme font package installed by a user. The second font package may be a system font package installed on the terminal device, or other non-system font package different from the first font package, which is not limited in this embodiment.
第一字符单元集合包括第一字体的字符单元的子轮廓信息,例如表2所示。第二字符单元集合包括第二字体的字符单元的子轮廓信息,例如表3所示。示例性的,这些字符单元包括但不限于:“艹”、“貝”、“女”、“一”、“丨”、“乙”、“刂”、“匚”、“亻”、“儿”、“日”、“甲”、“寸”、“土”、“日”、“鸟”、“方”、“风”、“父”、“王”、“火”、“韦”、“虫”、“聿”、“扌”、“礻”、“冂”等构成字符常用的字符单元。The first character unit set includes sub-contour information of character units of the first font, as shown in Table 2, for example. The second character unit set includes sub-contour information of character units of the second font, as shown in Table 3, for example. Exemplarily, these character units include, but are not limited to: "艹", "Bei", "女", "一", "丨", "B", "刂", "匚", "庻", "er" ", "Sun", "A", "Cun", "Earth", "Sun", "Bird", "Square", "Wind", "Father", "King", "Fire", "Wei", "Insect", "Yu", "扌", "绻", "冂" etc. constitute the character units commonly used in characters.
表2第一字符单元集合Table 2 The first character unit set
Figure PCTCN2021093595-appb-000003
Figure PCTCN2021093595-appb-000003
表3第二字符单元集合Table 3 The second character unit set
Figure PCTCN2021093595-appb-000004
Figure PCTCN2021093595-appb-000004
Figure PCTCN2021093595-appb-000005
Figure PCTCN2021093595-appb-000005
需要说明的是,每一个字符单元均设置有一个标识信息,用于唯一指示该字符单元。并且在不同的字符单元集合中,同一标识信息对应相同字符单元的不同字体的子轮廓信息。例如,“1”为“艹”的标识信息,在第一字符单元集合中,“1”对应“艹”第一字体的子轮廓信息;但是在第二字符单元集合中,“1”对应“艹”第二字体的子轮廓信息。It should be noted that each character unit is provided with identification information for uniquely indicating the character unit. And in different character unit sets, the same identification information corresponds to the sub-contour information of different fonts of the same character unit. For example, "1" is the identification information of "Fuck". In the first character unit set, "1" corresponds to the sub-contour information of the first font of "Fuck"; but in the second character unit set, "1" corresponds to "Fuck". "Fuck" sub-contour information of the second font.
图8是本申请实施例提供的字符显示方法的流程图。参见图8,该字符显示方法包括如下步骤S801-S803。FIG. 8 is a flowchart of a character display method provided by an embodiment of the present application. Referring to FIG. 8, the character display method includes the following steps S801-S803.
S801,终端设备在以第一字体显示字符的过程中,若目标字符不能以第一字体显示,则从第二字体包中获取目标字符的第二轮廓信息,第二轮廓信息用于以第二字体显示目标字符。S801: During the process of displaying characters in the first font, if the target character cannot be displayed in the first font, the terminal device acquires second outline information of the target character from a second font package, and the second outline information is used to display the characters in the second font. The font displays the target characters.
终端设备在以第一字体显示目标字符的过程中,调用第一字体包中与目标字符对应的第一轮廓信息,并根据该第一轮廓信息显示目标字符。但是,当第一字体包中不包括该第一轮廓信息时,根据现有技术,第一终端将无法以第一字体显示该字符。此时,可以从第二字体包中调用该字符的第二轮廓信息。In the process of displaying the target character in the first font, the terminal device calls the first outline information corresponding to the target character in the first font package, and displays the target character according to the first outline information. However, when the first outline information is not included in the first font package, according to the prior art, the first terminal cannot display the character in the first font. At this time, the second outline information of the character can be called from the second font package.
示例性的,终端设备在以F字体显示字符“真是蘡”的过程中,出现无法根据生僻字“蘡”的唯一通用标识“8621”在F字体包中查找到“蘡”的第一轮廓信息的情况,导致第一终端将无法以第一字体显示该字符。此时,终端设备根据该唯一通用标识“8621”,从第二字体包(如系统的A字体包)中调用“蘡”的第二轮廓信息。Exemplarily, in the process of displaying the character "Zhen 阡" in F font, the terminal device appears that the first outline information of "阡" cannot be found in the F font package according to the unique universal identifier "8621" of the uncommon character "阡". , the first terminal will not be able to display the character in the first font. At this time, the terminal device calls the second outline information of "蘡" from the second font package (such as the A font package of the system) according to the unique universal identifier "8621".
S802,终端设备根据第二轮廓信息,识别目标字符中的每个字符单元,以及每个字符单元在目标字符中的位置信息。S802, the terminal device identifies each character unit in the target character and position information of each character unit in the target character according to the second outline information.
第二轮廓信息中包括对应字符的各个字符单元的子轮廓信息,以及各个字符单元在该字符中的位置信息。终端设备可以根据第二轮廓信息,识别出目标字符中的每个字符单元,以及每个字符单元在目标字符中的位置信息,具体如下所示。The second outline information includes sub-outline information of each character unit of the corresponding character, and position information of each character unit in the character. The terminal device can identify each character unit in the target character and position information of each character unit in the target character according to the second outline information, as shown in the following.
字符通常是由一个或者多个笔画构成,在本实施例中,将笔画相连的部分称为一个最小单元。例如,字符“明”的笔画相连的部分为“日”和“月”,因此其最小单元为“日”和“月”。A character is usually composed of one or more strokes. In this embodiment, the part connecting the strokes is called a minimum unit. For example, the parts where the strokes of the character "Ming" are connected are "day" and "month", so its minimum units are "day" and "month".
对应于字符有N个最小单元,字符的轮廓信息中包括N个最小单元的子轮廓信息,其中,N≥1,且N为整数。由于一个子轮廓信息用于描述一个最小单元的外轮廓,因此这些子轮廓信息在用于显示小单元时是相互独立的。终端设备根据最小单元的子轮廓信息,能够确定出最小单元的外轮廓在字符显示区域中的位置,填充该外轮廓即可显示该最小单元。通过显示字符所有的最小单元,即可显示该字符。There are N minimum units corresponding to a character, and the outline information of the character includes sub-contour information of the N minimum units, where N≧1, and N is an integer. Since a sub-contour information is used to describe the outer contour of a smallest unit, these sub-contour information are independent of each other when used to display small units. The terminal device can determine the position of the outer contour of the minimum unit in the character display area according to the sub-contour information of the minimum unit, and the minimum unit can be displayed by filling the outer contour. The character can be displayed by displaying all the smallest units of the character.
因此,在本实施例中,终端设备在识别目标字符时,能够以最小单元的子轮廓信息为拆分单位,将目标字符的第二轮廓信息进行拆分,并根据拆分后的轮廓信息,确定字符单元。Therefore, in this embodiment, when the terminal device recognizes the target character, it can use the sub-contour information of the smallest unit as the splitting unit to split the second contour information of the target character, and according to the split contour information, Determine the character unit.
下面以字符“蘡”为例,对步骤S802进行说明。Step S802 will be described below by taking the character "嘡" as an example.
首先,终端设备根据字符“蘡”的第二轮廓信息,识别字符“蘡”中最小单元的子轮廓信息。由于字符“蘡”的最小单元包括:“艹”、两个“目”、两个“丿”、两个“乀”和一个“女”等八个部分,因此其对应的最小单元的子轮廓信息如表4所示。First, the terminal device recognizes the sub-contour information of the smallest unit in the character "阡" according to the second outline information of the character "阡". Since the minimum unit of the character "阡" includes eight parts: "艹", two "mu", two "丿", two "乀" and one "female", the corresponding sub-contour of the minimum unit The information is shown in Table 4.
表4子轮廓信息对应关系表Table 4. Correspondence table of sub-contour information
名称name 最小单元的子轮廓信息The sub-contour information of the smallest unit
Part1Part1 “艹”的子轮廓信息"Fuck" sub-profile information
Part2Part2 “目”的子轮廓信息Sub-profile information of "object"
Part3Part3 “丿”的子轮廓信息Sub-profile information of "丿"
Part4Part4 “乀”的子轮廓信息Sub-contour information of "乀"
Part5Part5 “目”的子轮廓信息Sub-profile information of "object"
Part6Part6 “丿”的子轮廓信息Sub-profile information of "丿"
Part7Part7 “乀”的子轮廓信息Sub-contour information of "乀"
Part8Part8 “女”的子轮廓信息Child Profile Information of "Female"
其次,终端设备可以将各个最小单元的子轮廓信息进行组合,根据组合结果识别目标字符的字符单元。Secondly, the terminal device can combine the sub-contour information of each minimum unit, and identify the character unit of the target character according to the combination result.
具体地,如果在一种组合方式下,所有的组合结果均能够在第二字符单元集合匹配到对应的子轮廓信息,则确定该组合方式为满足条件的组合方式。终端设备根据该种组合方式确定目标字符的字符单元。可以理解,一个字符单元中,可以包括一个或者多个最小单元。Specifically, if in a combination mode, all the combination results can match the corresponding sub-contour information in the second character unit set, it is determined that the combination mode is a combination mode that satisfies the condition. The terminal device determines the character unit of the target character according to this combination. It can be understood that a character unit may include one or more minimum units.
例如,可以将字符“蘡”的Part1~Part8组合为如下四部分:Part1、Part2~Part4、Part5~Part7、Part8。由于Part1可以在第二字符单元集合中匹配到“艹”的子轮廓信息,Part2~Part4和Part5~Part7均可以在第二字符单元集合中匹配到“貝”的子轮廓信息,Part8可以在第二字符单元集合中匹配到“女”的子轮廓信息。因此,确定该组合方式为满足条件的组合方式。For example, Part1-Part8 of the character "蘡" can be combined into the following four parts: Part1, Part2-Part4, Part5-Part7, Part8. Since Part1 can match the sub-contour information of "Fuck" in the second character unit set, Part2-Part4 and Part5-Part7 can match the sub-contour information of "Bei" in the second character unit set, and Part8 can match the sub-contour information of "Bei" in the second character unit set. The sub-contour information of "female" is matched in the two-character unit set. Therefore, the combination mode is determined to be a combination mode that satisfies the conditions.
最后,终端设备根据该组合方式可以识别出“蘡”对应的字符单元分别为:“艹”、“貝”、“貝”、“女”。并且结合表3,可以确定出这些字符单元中,“艹”的标识信息为1,“貝”的标识信息为2,“女”的标识信息为3。Finally, the terminal device can recognize that the character units corresponding to "蘡" are: "艹", "Bei", "Bei", and "女" according to the combination method. In combination with Table 3, it can be determined that among these character units, the identification information of "Fuck" is 1, the identification information of "Bei" is 2, and the identification information of "Female" is 3.
此外,由于最小单元的子轮廓信息中包括了其外轮廓在字符显示区域的显示位置,因此,分别根据Part1、Part2~Part4、Part5~Part7、Part8,也能够确定出字符单元“艹”、“貝”、“貝”、“女”的位置信息。In addition, since the sub-contour information of the smallest unit includes the display position of its outer contour in the character display area, the character units "剹", "" can also be determined according to Part1, Part2-Part4, Part5-Part7, and Part8 respectively. The location information of "Bei", "Bei", and "Female".
示例性的,参见图9,终端设备可以根据字符“蘡”的第二轮廓信息,识别出“蘡”的字符单元包括:“艹”、两个“貝”和“女”。并且,终端设备能够确定出“艹”在字符“蘡”的最上方,“女”在字符“蘡”的最下方,以及两个“貝”并排设置在“艹”和“女”之间的位置。Exemplarily, referring to FIG. 9 , the terminal device may identify, according to the second outline information of the character "阡", that the character units of "阡" include: "艹", two "bei" and "female". In addition, the terminal device can determine that "艹" is at the top of the character "蘡", "female" is at the bottom of the character "蘡", and two "bei" are arranged side by side between "艹" and "female". Location.
可选的,终端设备可以根据字符单元最大化原则识别目标字符,尽可能减少字符单元的数量。具体地,如果目标字符最小单元的子轮廓信息包括多种满足条件的组合方式,则根据分组数量最少的一种组合方式确定字符单元。Optionally, the terminal device may identify the target character according to the principle of maximizing character units, and reduce the number of character units as much as possible. Specifically, if the sub-contour information of the minimum unit of the target character includes multiple combinations that meet the conditions, the character unit is determined according to the combination with the smallest number of groups.
例如,对于字符“蘡”,其满足条件的最小单元的子轮廓信息的组合方式包括组合方式1和组合方式2。其中,组合方式1为:Part1、Part2~Part4、Part5~Part7、Part8;组合方式2为:Part1、Part2、Part3~Part4、Part5、Part6~Part7、Part8。按照字符单元最大化原则,终端设备根据组合方式1将“蘡”中的字符单元确定为:“艹”、“貝”、“貝”、 “女”,而不是按照组合方式2,将“蘡”中的字符单元确定为:“艹”、“目”、“八”、“目”、“八”和“女”。For example, for the character "嘡", the combination of the sub-contour information of the smallest unit that satisfies the condition includes combination 1 and combination 2. The combination mode 1 is: Part1, Part2-Part4, Part5-Part7, Part8; the combination mode 2 is: Part1, Part2, Part3-Part4, Part5, Part6-Part7, Part8. According to the principle of maximizing character units, the terminal device determines the character units in "蘡" according to combination method 1 as: "艹", "Bei", "Bei", and "female", instead of combining "蘡" according to combination method 2. The character units in " are determined to be: "艹", "目", "eight", "mu", "eight" and "female".
S803,终端设备根据所述每个字符单元与第一字体对应的子轮廓信息,和所述位置信息,以第一字体显示目标字符。S803, the terminal device displays the target character in the first font according to the sub-contour information corresponding to each character unit and the first font and the position information.
在识别出目标字符的字符单元之后,终端设备可以根据这些字符单元的标识信息从第一字符单元集合调用所述每个字符单元第一字体的子轮廓信息。例如,终端设备可以分别根据标识信息“1”、“2”和“3”,从对应的第一字符单元集合中确定出第一字体的“艹”、“貝”和“女”的子轮廓信息。After identifying the character units of the target character, the terminal device may call the sub-outline information of the first font of each character unit from the first character unit set according to the identification information of these character units. For example, the terminal device may determine the sub-contours of "Fuck", "Bei" and "Female" in the first font from the corresponding first character unit set according to the identification information "1", "2" and "3" respectively. information.
终端设备在从第一字符单元集合中,确定出目标字符中各个字符单元第一字体的子轮廓信息之后,可以采用多种方式显示该目标字符。After determining the sub-contour information of the first font of each character unit in the target character from the first character unit set, the terminal device can display the target character in various ways.
在一种可能的实现方式中,终端设备可以根据目标字符中各个字符单元的第一字体的子轮廓信息和位置信息,生成目标字符的第一轮廓信息。随后,根据生成的第一轮廓信息以第一字体显示目标字符。此外,终端设备还可以将生成的第一轮廓信息存储到第一字体包中。可以理解,当终端设备再次遇到该目标字符时,可以直接从第一字体包中调用其第一轮廓信息,以第一字体显示目标字符,提高终端设备显示字符的效率。In a possible implementation manner, the terminal device may generate the first outline information of the target character according to the sub-contour information and position information of the first font of each character unit in the target character. Then, the target character is displayed in the first font according to the generated first outline information. In addition, the terminal device may also store the generated first outline information in the first font package. It can be understood that when the terminal device encounters the target character again, it can directly call its first outline information from the first font package to display the target character in the first font, thereby improving the efficiency of character display by the terminal device.
示例性的,以第一字体包是F字体包,待显示字符是“蘡”为例,终端设备在确定字符“蘡”包括的字符单元“艹”、“貝”和“女”的F字体的子轮廓信息,以及字符单元“艹”、两个“貝”和“女”在字符“蘡”中的位置信息之后,生成并存储“蘡”的第一轮廓信息,随后根据该第一轮廓信息以F字体显示字符“蘡”。Exemplarily, taking the first font package as the F font package and the character to be displayed as "嘡" as an example, the terminal device determines the F fonts of the character units "剹", "Bei" and "female" included in the character "嘡". After the sub-contour information of the character unit "艹", two "bei" and "female" in the character "蘡", the first outline information of "蘡" is generated and stored, and then according to the first outline The information displays the character "阡" in F font.
需要说明的是,由于“蘡”字的各个字符单元的子轮廓信息与F字体对应,因此,终端设备最终生成“蘡”的第一轮廓信息也与F字体对应。并且,终端设备最终根据该第一轮廓信息显示的“蘡”也为F字体。It should be noted that, since the sub-contour information of each character unit of the word "蘡" corresponds to the F font, the first outline information of "蘡" finally generated by the terminal device also corresponds to the F font. In addition, the "蘡" finally displayed by the terminal device according to the first outline information is also in F font.
在另一种可能的实现方式中,首先,终端设备确定目标字符在显示界面中的显示区域。随后,根据目标字符中的每个字符单元的位置信息,确定所述每个字符单元在该显示区域中的显示位置。最后,根据目标字符中的每个字符单元的子轮廓信息在对应的显示位置,以第一字体显示每个字符单元,从而以第一字体显示目标字符。In another possible implementation manner, first, the terminal device determines the display area of the target character in the display interface. Then, according to the position information of each character unit in the target character, the display position of each character unit in the display area is determined. Finally, each character unit is displayed in the first font at the corresponding display position according to the sub-contour information of each character unit in the target character, so that the target character is displayed in the first font.
示例性的,以第一字体包是F字体包为例,对以F字体显示字符“蘡”的方法进行说明。首先,例如图10a所示,终端设备确定字符“蘡”在显示界面中的显示区域。随后,例如图10b所示,终端设备根据字符单元“艹”、“貝”和“女”在字符“蘡”中的位置信息,确定这些字符单元在所述显示区域中的显示位置。其中,字符单元“艹”的显示位置为位置①,“貝”的显示位置为位置②和位置③,“女”的显示位置为位置④。最后,例如图10c所示,终端设备根据“艹”的子轮廓信息,将“艹”以F字体显示在位置①处,根据“貝”的子轮廓信息,以F字体在位置②和位置③处分别显示“貝”;根据“女”的子轮廓信息,将“女”以F字体显示在位置④处,从而以F字体显示字符“蘡”。Exemplarily, taking an example that the first font package is the F font package, the method for displaying the character "嘡" in the F font will be described. First, for example, as shown in FIG. 10a, the terminal device determines the display area of the character "嘡" in the display interface. Then, for example, as shown in FIG. 10b, the terminal device determines the display positions of these character units in the display area according to the position information of the character units "艹", "Bei" and "女" in the character "嘡". Wherein, the display position of the character unit "艹" is position ①, the display position of "Bei" is position ② and position ③, and the display position of "female" is position ④. Finally, for example, as shown in Figure 10c, the terminal device displays "Fuck" at position ① in F font according to the sub-contour information of "Fuck", and displays F font at position ② and position ③ according to the sub-contour information of "Bei" According to the sub-contour information of "female", "female" is displayed at position ④ in F font, so as to display the character "蘡" in F font.
采用上述本实施例提供的字符显示方法,可以将“真是蘡”全部以F字体显示在显示界面中,例如图11所示。By using the character display method provided by the above-mentioned present embodiment, all "Zhenzhen" can be displayed on the display interface in F font, as shown in FIG. 11 , for example.
综上所述,终端设备在以第一字体显示字符的过程中,当遇到第一字体包中不包括的字符(例如生僻字)时,采用本实施例提供的字符显示方法,采用占用内存较小 的第一字体包和终端设备自带的第二字体包,就可以智能以第一字体显示该字符,在一定程度上避免终端设备字体显示异常的问题,提升用户的文本阅读体验。To sum up, in the process of displaying characters in the first font, when the terminal device encounters characters (such as rare characters) that are not included in the first font package, the character display method provided in this embodiment is adopted, and the memory is occupied. The smaller first font package and the second font package that comes with the terminal device can intelligently display the character in the first font, which avoids the problem of abnormal font display on the terminal device to a certain extent, and improves the user's text reading experience.
此外,在本实施例中,第一字符单元集合和第二字符单元集合可以是终端设备预先设置的,也可以是终端设备根据预设的多个基本特征字符生成的。下面分别结合图12和图13对第一字符单元集合和第二字符单元集合的生成过程进行说明。In addition, in this embodiment, the first character unit set and the second character unit set may be preset by the terminal device, or may be generated by the terminal device according to a plurality of preset basic characteristic characters. The generation process of the first character unit set and the second character unit set will be described below with reference to FIG. 12 and FIG. 13 respectively.
图12为本申请实施例提供的第一字符单元集合的确定方法的流程图。参见图12,该方法包括如下步骤S1201-S1203。FIG. 12 is a flowchart of a method for determining a first character unit set provided by an embodiment of the present application. Referring to FIG. 12, the method includes the following steps S1201-S1203.
S1201,终端设备从第一字体包中获取预设的多个基本特征字符的第三轮廓信息。S1201, the terminal device acquires third outline information of a plurality of preset basic characteristic characters from a first font package.
在本实施例中,基本特征字符通常包括多个,示例性的,这些基本特征字符包括但不限于:“十”、“亿”、“草”、“货”、“炜”、“妨”、“鸭”、“特”、“征”、“的”、“八”等。这些基本特征字符包括了大部分常用的字符单元,例如:“艹”、“貝”、“女”、“日”、“甲”、“寸”、“土”、“丿”、“乀”等等。In this embodiment, the basic characteristic characters usually include multiple, exemplarily, these basic characteristic characters include but are not limited to: "ten", "billion", "grass", "goods", "wei", "nuisance" , "Duck", "Special", "Sign", "De", "Eight" and so on. These basic characteristic characters include most of the commonly used character units, such as: "艹", "Bei", "Female", "Sun", "Jia", "Cun", "Tu", "丿", "乀" etc.
由于每一个字符都具有一个唯一通用标识,因此,可以将这个基本特征字符的唯一通用标识(例如Unicode)预先设置在终端设备中。根据这些预设的唯一通用标识,终端设备可以直接从第一字体包中调用这些基本特征字符的第三轮廓信息。其中,第三轮廓信息用于以第一字体显示所述多个基本特征字符。Since each character has a unique universal identifier, the unique universal identifier (eg Unicode) of this basic characteristic character can be preset in the terminal device. According to these preset unique universal identifiers, the terminal device can directly call the third outline information of these basic characteristic characters from the first font package. Wherein, the third outline information is used to display the plurality of basic characteristic characters in the first font.
S1202,终端设备根据第三轮廓信息,确定多个基本特征字符中所有不同字符单元第一字体的子轮廓信息。S1202: The terminal device determines, according to the third outline information, the sub-outline information of the first font of all different character units in the plurality of basic characteristic characters.
在一种可能的实现方式中,由于基本特征字符是预设的,因此对于每一个基本特征字符,终端设备可以预先设置有一个字符单元确定规则,并根据该规则确定其中的字符单元的子轮廓信息。例如,对于字符“明”,将“明”的轮廓信息中,用于显示在“明”左边的字符单元的子轮廓信息,确定为“日”的子轮廓信息;将用于显示在“明”右边的字符单元的子轮廓信息,确定为“月”的子轮廓信息。In a possible implementation manner, since the basic characteristic characters are preset, the terminal device may preset a character unit determination rule for each basic characteristic character, and determine the sub-contour of the character unit according to the rule. information. For example, for the character "Ming", in the outline information of "Ming", the sub-outline information of the character unit displayed on the left side of "Ming" is determined as the sub-outline information of "Day"; "The sub-contour information of the character unit on the right is determined as the sub-contour information of "month".
终端设备根据各个基本特征字符对应的字符单元确定规则,就可以从多个基本特征字符的第三轮廓信息中,确定出所需的字符单元第一字体的子轮廓信息。The terminal device can determine the required sub-contour information of the first font of the character unit from the third outline information of a plurality of basic characteristic characters according to the character unit determination rule corresponding to each basic characteristic character.
S1203,终端设备根据多个基本特征字符中的所有不同字符单元第一字体的子轮廓信息,生成第一字符单元集合。S1203: The terminal device generates a first set of character units according to the sub-contour information of the first font of all different character units in the plurality of basic characteristic characters.
尽管基本特征字符都是不相同的,但其中可能包括相同的字符单元。因此,在存储基本特征字符中的字符单元的子轮廓信息时,只存储所有不相同的字符单元的子轮廓信息即可。例如,当基本特征字符中同时包括“花”和“草”时,字符“花”的第三轮廓信息中包括了字符单元“艹”、“亻”和“七”的子轮廓信息,字符“草”的第三轮廓信息中包括了字符单元“艹”和“早”的子轮廓信息。对于重复的字符单元“艹”,仅存储其中一个“艹”的子轮廓信息即可。Although the basic characteristic characters are all different, they may include the same character units. Therefore, when storing the sub-contour information of the character unit in the basic characteristic character, only the sub-contour information of all different character units may be stored. For example, when the basic feature character includes both "flower" and "grass", the third outline information of the character "flower" includes the sub-outline information of the character units "艹", "庻" and "七", the character " The third contour information of "Grass" includes sub-contour information of the character units "Fuck" and "Zao". For the repeated character unit "Fuck", only the sub-contour information of one of the "Fuck" can be stored.
图13为本申请实施例提供的第二字符单元集合的确定方法的流程图。参见图13,该方法包括如下步骤S1301-S1303。FIG. 13 is a flowchart of a method for determining a second character unit set provided by an embodiment of the present application. Referring to Fig. 13, the method includes the following steps S1301-S1303.
S1301,终端设备从第二字体包中获取预设的多个基本特征字符的第四轮廓信息。S1301: The terminal device acquires fourth outline information of a plurality of preset basic characteristic characters from a second font package.
步骤S1301中的基本特征字符,与步骤S1202中的基本特征字符相同,本实施在此不进行赘述。参见步骤S1201,在步骤S1301中,根据这些基本特征字符预设的唯一通用标识,终端设备可以直接从第二字体包中调用这些基本特征字符的第四轮廓信 息。其中,第四轮廓信息用于以第二字体显示所述多个基本特征字符。The basic characteristic characters in step S1301 are the same as the basic characteristic characters in step S1202, and are not repeated in this implementation. Referring to step S1201, in step S1301, according to the preset unique universal identifiers of these basic characteristic characters, the terminal device can directly call the fourth outline information of these basic characteristic characters from the second font package. Wherein, the fourth outline information is used to display the plurality of basic characteristic characters in the second font.
S1302,终端设备根据第四轮廓信息,确定多个基本特征字符中所有不同字符单元第二字体的子轮廓信息。S1302: The terminal device determines, according to the fourth outline information, the sub-outline information of the second font of all different character units in the plurality of basic characteristic characters.
在步骤S1302中,终端设备根据各个基本特征字符对应的字符单元确定规则,便可以从多个基本特征字符的第四轮廓信息中确定出所需的第二字体基本特征字符的不同字符单元的子轮廓信息。具体可参见步骤S1202,本实施例不进行赘述。In step S1302, according to the character unit determination rule corresponding to each basic characteristic character, the terminal device can determine the required sub-elements of different character units of the basic characteristic character of the second font from the fourth outline information of the plurality of basic characteristic characters profile information. For details, reference may be made to step S1202, which is not repeated in this embodiment.
S1303,终端设备根据多个基本特征字符中的不同字符单元第二字体的子轮廓信息,生成第二字符单元集合。S1303, the terminal device generates a second character unit set according to the sub-contour information of the second font of different character units in the plurality of basic characteristic characters.
终端设备存储基本特征字符中所有第二字体的不相同字符单元的子轮廓信息,形成第二字符单元集合。具体可参见步骤S1203,本实施例不进行赘述。The terminal device stores the sub-contour information of all the different character units of the second font in the basic characteristic characters to form a second character unit set. For details, reference may be made to step S1203, which is not repeated in this embodiment.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
对应于上文实施例示出的字符显示方法,本实施例还提供过一种字符显示装置。为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the character display methods shown in the above embodiments, this embodiment also provides a character display device. For the convenience of description, only the parts related to the embodiments of the present application are shown.
参见图14,本申请实施例提供的字符显示装置包括信息获取单元1401、识别单元1402和显示控制单元1403。Referring to FIG. 14 , the character display device provided by the embodiment of the present application includes an information acquisition unit 1401 , an identification unit 1402 , and a display control unit 1403 .
信息获取单元1401,用于在以第一字体显示字符的过程中,若目标字符不能以第一字体显示,则从第二字体包中获取目标字符的第二轮廓信息,第二轮廓信息用于以第二字体显示目标字符。The information acquisition unit 1401 is used to obtain the second outline information of the target character from the second font package if the target character cannot be displayed in the first font during the process of displaying the character in the first font, and the second outline information is used for Displays the target character in the second font.
识别单元1402,用于根据第二轮廓信息,识别目标字符中的每个字符单元,以及所述每个字符单元在目标字符中的位置信息。The identifying unit 1402 is configured to identify each character unit in the target character and position information of each character unit in the target character according to the second outline information.
显示控制单元1403,用于根据根据每个字符单元与第一字体对应的子轮廓信息,和所述位置信息,以第一字体显示目标字符。The display control unit 1403 is configured to display the target character in the first font according to the sub-contour information corresponding to the first font according to each character unit and the position information.
可选的,显示控制单元1403,还用于根据目标字符的每个字符单元与第一字体对应的子轮廓信息和位置信息,确定目标字符的第一轮廓信息;根据第一轮廓信息,以第一字体显示目标字符。Optionally, the display control unit 1403 is further configured to determine the first outline information of the target character according to the sub-contour information and position information corresponding to each character unit of the target character and the first font; A font displays the target characters.
可选的,显示控制单元1403,还用于将第一轮廓信息存储到第一字体对应的第一字体包中。Optionally, the display control unit 1403 is further configured to store the first outline information in the first font package corresponding to the first font.
可选的,显示控制单元1403,还用于确定目标字符在显示界面中的显示区域;根据位置信息,确定目标字符中的每个字符单元在显示区域中的显示位置;根据子轮廓信息在对应的显示位置,以第一字体显示所述每个字符单元,以显示目标字符。Optionally, the display control unit 1403 is also used to determine the display area of the target character in the display interface; according to the position information, determine the display position of each character unit in the target character in the display area; The display position of each character unit is displayed in the first font to display the target character.
可选的,子轮廓信息是根据第一字体对应的第一字体包中的多个基本特征字符确定的,多个基本特征字符包括目标字符中的每个字符单元。Optionally, the sub-contour information is determined according to a plurality of basic characteristic characters in the first font package corresponding to the first font, and the plurality of basic characteristic characters include each character unit in the target character.
可选的,显示控制单元1403,还用于从第一字体包中获取多个基本特征字符的第三轮廓信息,第三轮廓信息用于以第一字体显示所述多个基本特征字符;根据第三轮廓信息,确定子轮廓信息。Optionally, the display control unit 1403 is further configured to obtain third outline information of multiple basic characteristic characters from the first font package, and the third outline information is used to display the plurality of basic characteristic characters in the first font; according to The third contour information determines sub-contour information.
本实施例还提供了一种终端设备,该终端设备包括存储器、处理器、显示单元以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行该计算机程序时实 现上述本实施例提供的字符显示方法。具体可参见图1所示。This embodiment also provides a terminal device, the terminal device includes a memory, a processor, a display unit, and a computer program stored in the memory and running on the processor, and the processor implements the foregoing embodiment when the computer program is executed. Provided character display method. See Figure 1 for details.
本实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。This embodiment also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
该计算机可读介质至少可以包括:能够将计算机程序代码携带到字符显示装置的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the character display device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media. For example, U disk, mobile hard disk, disk or CD, etc. In some jurisdictions, under legislation and patent practice, computer readable media may not be electrical carrier signals and telecommunications signals.
本申请实施例还提供了一种包含指令的计算机程序产品。当该计算机程序产品在计算机或处理器上运行时,使得计算机或处理器执行上述任一个方法中的一个或多个步骤。Embodiments of the present application also provide a computer program product including instructions. The computer program product, when run on a computer or processor, causes the computer or processor to perform one or more steps of any of the above methods.
本申请实施例提供一种芯片系统,所述芯片系统包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如上述本申请实施例提供的字符显示方法。在本实施例中,所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。An embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to realize the character display provided by the above-mentioned embodiments of the present application method. In this embodiment, the chip system may be a single chip or a chip module composed of multiple chips.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者通过该计算机可读存储介质进行传输。该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions can be sent from one website site, computer, server, or data center to another website site, computer, server by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.) or data center for transmission. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented. The process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed , which may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random storage memory RAM and other media that can store program codes.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。Finally, it should be noted that: the above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or replacements within the technical scope disclosed in the present application should be covered by the present application. within the scope of protection of the application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (10)

  1. 一种字符显示方法,应用于终端设备,其特征在于,所述方法包括:A character display method, applied to a terminal device, characterized in that the method comprises:
    在以第一字体显示字符的过程中,若目标字符不能以所述第一字体显示,则从第二字体包中获取所述目标字符的第二轮廓信息,所述第二轮廓信息用于以第二字体显示所述目标字符;In the process of displaying the characters in the first font, if the target character cannot be displayed in the first font, the second outline information of the target character is obtained from the second font package, and the second outline information is used to display in the first font. The second font displays the target character;
    根据所述第二轮廓信息,识别所述目标字符中的每个字符单元,以及所述每个字符单元在所述目标字符中的位置信息;According to the second outline information, identify each character unit in the target character, and the position information of each character unit in the target character;
    根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符。The target character is displayed in the first font according to the sub-outline information of each character unit corresponding to the first font and the position information.
  2. 根据权利要求1所述的方法,其特征在于,根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符,包括:The method according to claim 1, wherein the target character is displayed in the first font according to the sub-contour information corresponding to the first font of each character unit and the position information, include:
    根据所述子轮廓信息和所述位置信息,确定所述目标字符的第一轮廓信息;According to the sub-contour information and the position information, determine the first contour information of the target character;
    根据所述第一轮廓信息,以所述第一字体显示所述目标字符。The target character is displayed in the first font according to the first outline information.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括,将所述第一轮廓信息存储到所述第一字体对应的第一字体包中。The method according to claim 2, wherein the method further comprises: storing the first outline information in a first font package corresponding to the first font.
  4. 根据权利要求1所述的方法,其特征在于,根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符,包括:The method according to claim 1, wherein the target character is displayed in the first font according to the sub-contour information corresponding to the first font of each character unit and the position information, include:
    确定所述目标字符在显示界面中的显示区域;determining the display area of the target character in the display interface;
    根据所述位置信息,确定所述目标字符中的每个字符单元在所述显示区域中的显示位置;According to the position information, determine the display position of each character unit in the target character in the display area;
    根据所述子轮廓信息在对应的显示位置,以所述第一字体显示所述每个字符单元,以显示所述目标字符。Each character unit is displayed in the first font at a corresponding display position according to the sub-contour information to display the target character.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述子轮廓信息是根据所述第一字体对应的第一字体包中的多个基本特征字符确定的,所述多个基本特征字符包括所述目标字符中的每个字符单元。The method according to any one of claims 1-4, wherein the sub-contour information is determined according to a plurality of basic characteristic characters in a first font package corresponding to the first font, the plurality of The basic feature character includes each character unit in the target character.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    从所述第一字体包中获取所述多个基本特征字符的第三轮廓信息,所述第三轮廓信息用于以所述第一字体显示所述多个基本特征字符;obtaining third outline information of the plurality of basic characteristic characters from the first font package, where the third outline information is used to display the plurality of basic characteristic characters in the first font;
    根据所述第三轮廓信息,确定所述子轮廓信息。The sub-contour information is determined according to the third contour information.
  7. 一种字符显示装置,应用于终端设备,其特征在于,所述字符显示装置包括:A character display device, applied to terminal equipment, characterized in that the character display device comprises:
    信息获取单元,在以第一字体显示字符的过程中,若目标字符不能以所述第一字体显示,则从第二字体包中获取所述目标字符的第二轮廓信息,所述第二轮廓信息用于以第二字体显示所述目标字符;The information acquisition unit, in the process of displaying the characters in the first font, if the target character cannot be displayed in the first font, acquires the second outline information of the target character from the second font package, the second outline information for displaying the target character in a second font;
    识别单元,用于根据所述第二轮廓信息,识别所述目标字符中的每个字符单元,以及所述每个字符单元在所述目标字符中的位置信息;an identification unit for identifying each character unit in the target character according to the second outline information, and position information of the each character unit in the target character;
    显示控制单元,用于根据所述每个字符单元与所述第一字体对应的子轮廓信息,和所述位置信息,以所述第一字体显示所述目标字符。A display control unit, configured to display the target character in the first font according to the sub-outline information of each character unit corresponding to the first font and the position information.
  8. 一种终端设备,其特征在于,包括显示单元、存储器、处理器,以及存储在所 述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至6任一项所述的方法。A terminal device, comprising a display unit, a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that the processor executes the computer The method according to any one of claims 1 to 6 is implemented in the program.
  9. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述的方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
  10. 一种计算机程序产品,其特征在于,当所述计算机程序产品在终端设备上运行时,使得所述终端设备执行如权利要求1至6任一项所述的字符显示方法。A computer program product, characterized in that, when the computer program product runs on a terminal device, the terminal device is caused to execute the character display method according to any one of claims 1 to 6.
PCT/CN2021/093595 2020-06-28 2021-05-13 Character display method, character display apparatus, and terminal device WO2022001408A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010598200.7A CN113850050B (en) 2020-06-28 2020-06-28 Character display method, character display device and terminal equipment
CN202010598200.7 2020-06-28

Publications (1)

Publication Number Publication Date
WO2022001408A1 true WO2022001408A1 (en) 2022-01-06

Family

ID=78972029

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/093595 WO2022001408A1 (en) 2020-06-28 2021-05-13 Character display method, character display apparatus, and terminal device

Country Status (2)

Country Link
CN (1) CN113850050B (en)
WO (1) WO2022001408A1 (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645063A (en) * 2008-08-05 2010-02-10 北大方正集团有限公司 Method and device for combining characters
CN102681978A (en) * 2012-05-15 2012-09-19 深圳市万兴软件有限公司 Method and system for displaying text in PDF (portable document format) document
CN103577186A (en) * 2012-08-03 2014-02-12 塞拉特姆股份有限公司 Method, computer readable media, and apparatuses for enabling non-system fonts
CN104216869A (en) * 2013-05-31 2014-12-17 北京米时科技股份有限公司 System and method for acquiring and displaying fonts which are not supported in intelligent device yet
CN104317663A (en) * 2014-09-29 2015-01-28 广东欧珀移动通信有限公司 Automatic character testing method and device
US20170147535A1 (en) * 2015-11-24 2017-05-25 International Business Machines Corporation Identifying fonts using custom ligatures
CN107679022A (en) * 2017-09-07 2018-02-09 北京京东尚科信息技术有限公司 Uncommon word processing method and its system
WO2018235326A1 (en) * 2017-06-23 2018-12-27 大日本印刷株式会社 Computer program, font switching device, and font switching method
CN111046631A (en) * 2019-10-16 2020-04-21 平安科技(深圳)有限公司 Name storage method and device based on character conversion and computer equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281601B (en) * 2013-07-05 2018-09-25 北大方正集团有限公司 Build method and device, character display method and the device of super large character library
CN103902513A (en) * 2014-03-21 2014-07-02 北京百度网讯科技有限公司 Method and device for displaying fonts in terminal device
CN110795258B (en) * 2018-07-17 2023-03-24 珠海金山办公软件有限公司 Font library matching method, device and equipment
CN110728111B (en) * 2018-07-17 2024-06-25 珠海金山办公软件有限公司 Document content messy code repairing method and device, terminal equipment and server

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645063A (en) * 2008-08-05 2010-02-10 北大方正集团有限公司 Method and device for combining characters
CN102681978A (en) * 2012-05-15 2012-09-19 深圳市万兴软件有限公司 Method and system for displaying text in PDF (portable document format) document
CN103577186A (en) * 2012-08-03 2014-02-12 塞拉特姆股份有限公司 Method, computer readable media, and apparatuses for enabling non-system fonts
CN104216869A (en) * 2013-05-31 2014-12-17 北京米时科技股份有限公司 System and method for acquiring and displaying fonts which are not supported in intelligent device yet
CN104317663A (en) * 2014-09-29 2015-01-28 广东欧珀移动通信有限公司 Automatic character testing method and device
US20170147535A1 (en) * 2015-11-24 2017-05-25 International Business Machines Corporation Identifying fonts using custom ligatures
WO2018235326A1 (en) * 2017-06-23 2018-12-27 大日本印刷株式会社 Computer program, font switching device, and font switching method
CN107679022A (en) * 2017-09-07 2018-02-09 北京京东尚科信息技术有限公司 Uncommon word processing method and its system
CN111046631A (en) * 2019-10-16 2020-04-21 平安科技(深圳)有限公司 Name storage method and device based on character conversion and computer equipment

Also Published As

Publication number Publication date
CN113850050A (en) 2021-12-28
CN113850050B (en) 2022-09-23

Similar Documents

Publication Publication Date Title
US10187872B2 (en) Electronic device and method of providing notification by electronic device
CN106557330B (en) Method and device for processing notification information of notification bar of mobile terminal system and mobile terminal
CN106775637B (en) Page display method and device for application program
US20170235435A1 (en) Electronic device and method of application data display therefor
US20160154686A1 (en) Method and apparatus for presenting clipboard contents on a mobile terminal
CN108549519B (en) Split screen processing method and device, storage medium and electronic equipment
EP4130951A1 (en) Content sharing method and electronic device
EP4160371A1 (en) Unread message display method and apparatus, and electronic device
TW201519073A (en) Rapid response operation method of terminal device and terminal device
US20150301991A1 (en) Webapp startup method and device
KR101600999B1 (en) Method, apparatus and terminal device, program and storage medium for selecting character
US20170064352A1 (en) Method and system for collecting statistics on streaming media data, and related apparatus
WO2021114928A1 (en) Error correction word sorting method and apparatus, terminal device and storage medium
CN104516886A (en) Method, mobile terminal and server for displaying data analysis result
CN105094809A (en) Combined picture layout modification method and device and terminal equipment
WO2020192322A1 (en) Display method and terminal device
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
US10101894B2 (en) Information input user interface
WO2020168882A1 (en) Interface display method and terminal device
CN105653112B (en) Method and device for displaying floating layer
CN107122177A (en) Method for showing interface and device
CN108009274A (en) Piece file mergence method and mobile terminal
US20160283047A1 (en) Login interface displaying method and apparatus
WO2022001408A1 (en) Character display method, character display apparatus, and terminal device
CN114398016B (en) Interface display method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21834312

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21834312

Country of ref document: EP

Kind code of ref document: A1