WO2020124454A1 - 字体切换方法及相关产品 - Google Patents

字体切换方法及相关产品 Download PDF

Info

Publication number
WO2020124454A1
WO2020124454A1 PCT/CN2018/122150 CN2018122150W WO2020124454A1 WO 2020124454 A1 WO2020124454 A1 WO 2020124454A1 CN 2018122150 W CN2018122150 W CN 2018122150W WO 2020124454 A1 WO2020124454 A1 WO 2020124454A1
Authority
WO
WIPO (PCT)
Prior art keywords
font
user
text
handwriting
text information
Prior art date
Application number
PCT/CN2018/122150
Other languages
English (en)
French (fr)
Inventor
陈岩
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201880098629.0A priority Critical patent/CN112840305B/zh
Priority to PCT/CN2018/122150 priority patent/WO2020124454A1/zh
Publication of WO2020124454A1 publication Critical patent/WO2020124454A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of electronic technology, in particular to a font switching method and related products.
  • the text information in different display interfaces is generally displayed in the default font.
  • the font can be set, but the fonts that can be selected are all applications.
  • users may want to have their own handwriting font resource library, switch the font of the display interface to the user's handwriting font, making the font switching more in line with the user's reading habits.
  • Embodiments of the present application provide a font switching method and related products, which are beneficial to make font switching more personalized and improve user experience.
  • an embodiment of the present application provides a font switching method, which is applied to an electronic device, and the method includes:
  • a pre-stored user handwriting font resource library is obtained, the user handwriting font resource library is generated through a pre-trained artificial intelligence AI font model The set of characters matching the user's handwriting habits, the AI font model is obtained after training through the handwriting font data input by the user;
  • an embodiment of the present application provides a font switching device, which is applied to an electronic device.
  • the font switching device includes a processing unit and a communication unit, wherein,
  • the processing unit is configured to determine the font and display density of the text information when detecting that the currently displayed application interface displays text information; and to detect that the font is the default font and the display density
  • a pre-stored user handwriting font resource library is obtained through the communication unit, and the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches the user's handwriting habits,
  • the AI font model is obtained after training through handwriting font data input by the user; and for switching the font of the text information to the user handwriting font through the user handwriting font resource library.
  • an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be processed by the above
  • the above program includes instructions for performing the steps in any method of the first aspect of the embodiments of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the first embodiment of the present application.
  • the computer program causes the computer to execute the first embodiment of the present application.
  • an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium that stores the computer program, and the computer program is operable to cause the computer to execute as implemented in the present application Examples of some or all of the steps described in any method of the first aspect.
  • the computer program product may be a software installation package.
  • the electronic device first determines the font and display density of the text information when it detects that the currently displayed application interface displays text information, and secondly, detects that the font is the default font , And when the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits The AI font model is obtained after training through handwriting font data input by the user, and finally, the font of the text information is switched to the user handwriting font through the user handwriting font resource library.
  • the electronic device can determine the font and display density of the text in the information according to the text information of the currently displayed application interface, so that when the font of the text information is detected as the default font and the display density is less than the preset density threshold, the pre-stored User handwriting font resource library, so that the font of text information is switched to user handwriting font through the user handwriting font resource library.
  • the font settings are more personalized, which is beneficial to improve The user's reading experience.
  • FIG. 1A is a schematic diagram of a program running space of a smart phone
  • Figure 1B is a system architecture diagram of an Android system
  • FIG. 2 is a schematic flowchart of a font switching method provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of another font switching method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another font switching method provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 6 is a block diagram of functional units of a font switching device provided by an embodiment of the present application.
  • electronic devices such as smart phones are generally provided with a program running space
  • the program running space includes a user space and an operating system space, where the user space runs one or more application programs, and the one or more applications
  • the program is a third-party application program installed by the electronic device.
  • the software algorithm corresponding to the resource download method described in the embodiment of the present application runs in the user space, and the operating system space runs the operating system of the electronic device.
  • the electronic device can specifically run the Android Android system, the mobile operating system iOS developed by Apple, etc., which is not limited here.
  • the corresponding user space includes the application layer (Applications) in the Android system
  • the operating system space may include the application framework layer (Application) in the Android system Framework), system runtime library layer (including system runtime library layer Libraries and Android runtime Android Runtime), Linux kernel layer (Linux Kernel).
  • the application layer includes various application programs that directly interact with the user, or service programs written in the Java language and running in the background.
  • the application framework layer provides a series of class libraries required for the development of Android applications, which can be used to reuse components, and can also be personalized through inheritance.
  • the system runtime layer is the support of the application framework and provides services for various components in the Android system.
  • the system runtime library layer is composed of the system class library and the Android runtime.
  • the Android runtime contains two parts: the core library and the Dalvik virtual machine.
  • the Linux kernel layer is used to implement core functions such as hardware device drivers, process and memory management, network protocol stack, power management, and wireless communication.
  • the electronic devices involved in the embodiments of the present application may be electronic devices with domain name resolution capabilities, and the electronic devices may include various handheld devices with wireless communication functions, in-vehicle devices, wearable devices, computing devices, or those connected to a wireless modem Other processing equipment, as well as various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal equipment (terminal), etc.
  • UE User Equipment
  • MS Mobile Station
  • terminal terminal
  • FIG. 2 is a schematic flowchart of a font switching method provided by an embodiment of the present application, which is applied to an electronic device.
  • This font switching method includes:
  • the electronic device determines the font and display density of the text information.
  • the electronic device displays different text information when using an application interface that is not in use.
  • the text information may include the font, font size, display area, display area size, and display content of the displayed text.
  • the text information is displayed using the default font.
  • the default font may be the default font configured by the electronic device or the default font configured by the application.
  • the font and display density of the text information can be determined according to the text information, so as to determine whether to execute the font switching method provided by the embodiment of the present application, but when the number of displayed text is small, or the font size is small, or the display area of the text is relatively small Remote (screen corner area), or when the display area is small, the font may not be clearly noticed by the user when switching the font, so the text information can be further set.
  • the text information meets certain preset conditions, determine the text Information font and display density.
  • the electronic device when the electronic device detects that the font is a default font and the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is pre-trained A set of characters generated by the artificial intelligence AI font model that matches the handwriting habits of the user.
  • the AI font model is obtained after training through handwritten font data input by the user.
  • the electronic device when the electronic device detects that the font of the text information is the default font and the display density of the text information is less than the target preset density threshold, it may determine to switch the font of the text information at this time.
  • a pre-stored user handwriting font resource library is obtained, and each type font corresponds to a font resource library, and the font resource library includes a specific text image corresponding to each text, that is, a text collection including the font of the type.
  • User handwriting fonts are collections of characters that can be obtained from Artificial Intelligence (AI) models and generated by pre-trained artificial intelligence AI font models to match user handwriting habits, that is, user handwriting font resource library, so that when switching fonts , You can get the corresponding text from the user's handwriting font resource library to switch the font for the text.
  • AI Artificial Intelligence
  • the AI font model can be obtained by training the handwritten font data input by the user.
  • the handwritten font data entered by the user includes some user-written text.
  • the AI model can be based on some user-written text.
  • the rules of the user's handwritten text are obtained, thereby obtaining other texts handwritten by the user, and then generating a user handwritten font resource library.
  • the electronic device switches the font of the text information to the user handwriting font through the user handwriting font resource library.
  • the font of the text information may be switched to the user's handwriting font according to the user's handwriting font resource library and text information.
  • the electronic device first determines the font and display density of the text information when it detects that the currently displayed application interface displays text information, and secondly, detects that the font is the default font , And when the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits The AI font model is obtained after training through handwriting font data input by the user, and finally, the font of the text information is switched to the user handwriting font through the user handwriting font resource library.
  • the electronic device can determine the font and display density of the text in the information according to the text information of the currently displayed application interface, so that when the font of the text information is detected as the default font and the display density is less than the preset density threshold, the pre-stored User handwriting font resource library, so that the font of text information is switched to user handwriting font through the user handwriting font resource library.
  • the font settings are more personalized, which is beneficial to improve The user's reading experience.
  • the determining the display density of the text information includes: determining a first display area and a number of first text corresponding to the text information in the application interface; obtaining a pre-stored user handwriting font template Text, and select the target user handwriting font template text whose display area is the first display area from the user handwriting font template text, wherein the font of the user handwriting font template text is the user handwriting font; The number of second characters corresponding to the target user's handwritten font template characters; and determining the display density according to the ratio of the number of the first characters and the number of the second characters.
  • the first display area and the number of first characters of the text information displayed on the application interface are determined, where the first display area may be the display area of all text information, then the number of first characters corresponds to the number of all characters displayed,
  • the first display area may also be the display area of the text information of a selected area, and the number of the first text corresponds to the number of text in the display area.
  • the pre-stored user handwriting font template text is obtained, and the text font in the user handwriting font template text is the user handwriting font, and the text font size is the same as the text in the text information.
  • Select the target user handwriting font template text whose display area is the first display area from the handwriting font template text determine the number of second text corresponding to the user handwriting font template text, and determine the text in the text information according to the number of first text and the number of second text Display density.
  • the text information with the display area being the first display area contains 300 characters
  • the target user handwriting font template text with the display area being the first display area has only 200 characters visible.
  • Text is used as a standard, and the display density of the text information is detected to be 1.5 times the user's handwriting font template. The more text displayed in the text information, the greater the display density of the text information.
  • the user's handwriting font template is used as the standard, because the text font size in the user handwriting font template is the same as the text font size in the text information, and the spacing between the text is set by the user or the system to be suitable for the user to read Based on the number of characters in the text information of the same display area and the number of characters in the user’s handwritten font template, to determine the ratio between the two to determine the display density of the text information, which is helpful to determine the current Whether the text information on the display interface meets the conditions for font switching.
  • the determining the display density of the text information includes: determining a first spacing between the text displayed on the application interface; and determining the display density of the text information according to the first spacing.
  • the display density of the text information is determined according to the size of the first spacing.
  • the larger the spacing the smaller the text density and the smaller the spacing .
  • the greater the text density it is determined by the pitch whether the display density of the text information meets the conditions for font switching, which is beneficial to improve the processing efficiency.
  • the determining the display density of the text information according to the first distance includes: obtaining pre-stored text of the user handwriting font template, and determining between text in the user handwriting font template text The second pitch; determining the display density according to the ratio between the second pitch and the first pitch.
  • the user handwriting font template text is stored in the electronic device.
  • the user handwriting font template text includes the user handwriting font template font, the user handwriting font template text of the same font size, and the spacing between the texts can be calculated by the system based on big data The use of reading by users can reduce the spacing of reading fatigue.
  • the pre-stored user handwriting font template text is obtained, and the font size is the same as the font size of the text information, and the second spacing between the text in the user handwriting font template text is determined, according to the ratio between the first spacing and the second spacing, Determine the display density.
  • the first spacing and the second spacing may be the left and right spacing between the characters, or the top and bottom spacing.
  • the ratio between the second spacing and the first spacing is determined according to the second spacing between the text in the standard user handwriting font template text and the first spacing between the text information displayed on the current application interface ,
  • the larger the ratio the greater the display density of the explanatory text information, and the smaller the ratio, the smaller the display density of the explanatory text information.
  • the switching of the font of the text information to a handwritten font through the user handwriting font resource library includes: determining to switch the font of the text information from the default font to the user handwriting After the font, the second display area corresponding to the text information; when it is detected that the difference between the second display area and the first display area is greater than a first preset threshold, The text information is adjusted so that the difference between the adjusted display area of the text information and the first display area is less than the first preset threshold.
  • the adjusted text information may be adjusted so that the difference between the display area of the adjusted text information and the first display area is less than the first preset threshold.
  • the adjustment method may be scaling the font information after switching, and scaling the display area from the second display area to the first display area, which is not limited herein.
  • the second display area corresponding to the text information is detected, and the second display area before the font is switched and the first display area is detected.
  • the difference between them is greater than the first preset threshold, by adjusting the text information, the display of the text information does not affect the user's visual experience.
  • the switching of the font of the text information to a handwritten font through the user handwriting font resource library includes: obtaining historical usage records of application scenarios corresponding to the application interface; according to the historical usage The record determines the number of times the font switching instruction is received in the application scenario; when it is detected that the number of times is greater than the second preset threshold, the font of the text information is switched to the user handwriting font.
  • the electronic device can also obtain the historical usage record of the application scene corresponding to the current application interface, and determine the number of font switching instructions received in the application scene based on the historical usage record, when the detected number of times is greater than the second preset threshold At this time, you can directly switch the font of the text information to the user's handwriting font, so that the user does not need to perform the operation of switching the font.
  • the method further includes: when detecting that the current application is a preset application, determining a first preset density threshold set corresponding to the application; determining the application according to the application interface of the application Application scenarios; find the mapping relationship between the preset application scenarios and the preset density thresholds, and determine the target preset density threshold corresponding to the application scenarios in the first preset density threshold set.
  • the text information displayed by the preset application in multiple application scenarios can be obtained, so that the text information is trained through the AI font model according to the displayed text information to obtain the preset density threshold of the preset application Set, each preset density threshold in the preset density threshold set corresponds to an application scenario.
  • the preset density threshold corresponding to each application scenario is different, and the first preset density threshold set corresponding to the current application is determined, thereby determining that the application scenario corresponding to the current interface is in the first
  • a target preset density threshold in a set of preset density thresholds by determining whether the display density of the text information is less than the target preset density threshold, is beneficial to determine whether a font switching operation is required.
  • the method further includes: acquiring the handwritten text of the user when it is detected that the electronic device enables the handwriting input method; and performing the handwritten text of the user through the pre-trained artificial intelligence AI font model Training to obtain the user handwriting font.
  • the pre-trained artificial intelligence AI font model can determine the user's handwriting font resource library based on the handwriting font data input by the user. For example, when it is detected that the electronic device enables the handwriting input method, the user's handwritten text can be obtained. The image of handwritten text is trained by the AI model to the handwritten text of the user, and according to the partial text handwritten by the user, the user's handwritten font resource library is obtained.
  • the method further includes: taking a target picture through a camera, the target picture being a picture containing the text of the user's handwriting font; extracting the text of the user's handwriting font from the target picture, passing The pre-trained artificial intelligence AI font model trains the text of the user handwriting font to determine the user handwriting font resource library.
  • the user's handwriting font data for example, taking a target picture including the user's handwriting font text, extracting the user's handwriting font text from the target picture, and pre-training the artificial intelligence AI font model to the user
  • the text of handwriting fonts can be trained to obtain the user's handwriting font resource library.
  • FIG. 3 is a schematic flowchart of a font switching method provided by an embodiment of the present application, which is applied to an electronic device. As shown in the figure, the font switching method includes:
  • the electronic device determines the font and display density of the text information.
  • the electronic device when detecting that the font is a default font and the display density is less than a target preset density threshold, the electronic device obtains a pre-stored user handwriting font resource library, which is pre-trained A set of characters generated by the artificial intelligence AI font model that matches the handwriting habits of the user.
  • the AI font model is obtained after training through handwritten font data input by the user.
  • the electronic device When detecting that the difference between the second display area and the first display area is greater than a first preset threshold, the electronic device adjusts the text information of the user's handwriting font so that the adjusted The difference between the display area of the text information and the first display area is less than the first preset threshold.
  • the electronic device first determines the font and display density of the text information when it detects that the currently displayed application interface displays text information, and secondly, detects that the font is the default font , And when the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits The AI font model is obtained after training through handwriting font data input by the user, and finally, the font of the text information is switched to the user handwriting font through the user handwriting font resource library.
  • the electronic device can determine the font and display density of the text in the information according to the text information of the currently displayed application interface, so that when the font of the text information is detected as the default font and the display density is less than the preset density threshold, the pre-stored User handwriting font resource library, so that the font of text information is switched to user handwriting font through the user handwriting font resource library.
  • the font settings are more personalized, which is beneficial to improve The user's reading experience.
  • the second display area corresponding to the text information is detected, and the difference between the second display area and the first display area before the font switching is detected When it is greater than the first preset threshold, by adjusting the text information, the display of the text information does not affect the user's visual experience.
  • FIG. 4 is a schematic flowchart of a font switching method provided by an embodiment of the present application. The method is applied to an electronic device. Wireless communication link. As shown in the figure, the font switching method includes:
  • the electronic device determines the font and display density of the text information.
  • the electronic device when the electronic device detects that the font is the default font and the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is pre-trained A set of characters generated by the artificial intelligence AI font model that matches the handwriting habits of the user.
  • the AI font model is obtained after training through handwritten font data input by the user.
  • the electronic device obtains historical usage records of application scenarios corresponding to the application interface.
  • the electronic device determines, according to the historical usage record, the number of times a font switching instruction is received in the application scenario.
  • the electronic device When detecting that the number of times is greater than a second preset threshold, the electronic device switches the font of the text information to the user handwriting font.
  • the electronic device first determines the font and display density of the text information when it detects that the currently displayed application interface displays text information, and secondly, detects that the font is the default font , And when the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits The AI font model is obtained after training through handwriting font data input by the user, and finally, the font of the text information is switched to the user handwriting font through the user handwriting font resource library.
  • the electronic device can determine the font and display density of the text in the information according to the text information of the currently displayed application interface, so that when the font of the text information is detected as the default font and the display density is less than the preset density threshold, the pre-stored User handwriting font resource library, so that the font of text information is switched to user handwriting font through the user handwriting font resource library.
  • the font settings are more personalized, which is beneficial to improve The user's reading experience.
  • the font switching instruction is received in the application scene corresponding to the application interface, when the number of times exceeds the second preset threshold, it indicates that the user in this application scene prefers to use the user's handwritten font to display text information , So that when the electronic device enters the application scenario, the font of the text information is directly switched to the user's handwriting font, eliminating the need for the user to manually switch the font.
  • FIG. 5 is a schematic structural diagram of an electronic device 500 provided by an embodiment of the present application.
  • the electronic device 500 operates with one or Multiple application programs and operating systems, as shown, the electronic device 500 includes a processor 510, a memory 520, a communication interface 530, and one or more programs 521, wherein the one or more programs 521 are stored in all In the memory 520, and configured to be executed by the processor 510, the one or more programs 521 include instructions for performing the following steps;
  • a pre-stored user handwriting font resource library is obtained, the user handwriting font resource library is generated through a pre-trained artificial intelligence AI font model The set of characters matching the user's handwriting habits, the AI font model is obtained after training through the handwriting font data input by the user;
  • the electronic device first determines the font and display density of the text information when it detects that the currently displayed application interface displays text information, and secondly, detects that the font is the default font , And when the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits The AI font model is obtained after training through handwriting font data input by the user, and finally, the font of the text information is switched to the user handwriting font through the user handwriting font resource library.
  • the electronic device can determine the font and display density of the text in the information according to the text information of the currently displayed application interface, so that when the font of the text information is detected as the default font and the display density is less than the preset density threshold, the pre-stored User handwriting font resource library, thus switching the font of text information to user handwriting font through the user handwriting font resource library, and switching the font of text information from the default font to the user's handwriting font, making the font settings more personalized and beneficial to improve The user's reading experience.
  • the instructions in the program are specifically used to perform the following operations: determine the first display area corresponding to the text information in the application interface And the number of the first text; acquiring the pre-stored user handwriting font template text, and selecting the target user handwriting font template text whose display area is the first display area from the user handwriting font template text, wherein the user handwriting font
  • the font of the template text is the user's handwriting font
  • the number of the second text corresponding to the target user's handwriting font template text is determined
  • the display density is determined according to the ratio of the number of the first text and the number of the second text.
  • the instructions in the program are specifically used to perform the following operations: determine the first spacing between the text displayed on the application interface; The first pitch determines the display density of the text information.
  • the instructions in the program are specifically used to perform the following operations: obtain the pre-stored user handwritten font template text, And determine the second spacing between the characters in the user handwritten font template text; determine the display density according to the ratio between the second spacing and the first spacing.
  • the instructions in the program are specifically used to perform the following operations: determine to convert the text information After the font is switched from the default font to the user's handwriting font, the second display area corresponding to the text information; when it is detected that the difference between the second display area and the first display area is greater than At a preset threshold, the text information of the user's handwriting font is adjusted so that the difference between the adjusted display area of the text information and the first display area is less than the first preset threshold.
  • the instructions in the program are specifically used to perform the following operations: obtain the application interface correspondence The historical usage record of the application scenario of the application; determining the number of times the font switching instruction is received in the application scenario based on the historical usage record; when it is detected that the number of times is greater than the second preset threshold, the text information The font is switched to the user handwriting font.
  • the instructions in the program are specifically used to perform the following operations: when it is detected that the current application is a preset application, determine the first preset density threshold set corresponding to the application; according to the application Application interface to determine the application scenario of the application; find the mapping relationship between the preset application scenario and the preset density threshold, and determine the target preset density threshold corresponding to the application scenario in the first preset density threshold set .
  • the instructions in the program are specifically used to perform the following operations: when it is detected that the electronic device enables the handwriting input method, obtain the handwritten text of the user; through the pre-trained artificial intelligence AI font model To train the user's handwritten text to obtain the user's handwritten font resource library.
  • the instructions in the program are specifically used to perform the following operations: capture a target picture through a camera, the target picture is a captured picture containing text in a user's handwritten font; extract the user from the target picture For the text of the handwritten font, the text of the user's handwritten font is trained through the pre-trained artificial intelligence AI font model to determine the user's handwritten font resource library.
  • the electronic device includes a hardware structure and/or a software module corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driven hardware depends on the specific application of the technical solution and design constraints. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiments of the present application may divide the functional unit of the electronic device according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the integrated unit may be implemented in the form of hardware or a software functional unit. It should be noted that the division of the units in the embodiments of the present application is schematic, and is only a division of logical functions, and there may be other division manners in actual implementation.
  • FIG. 6 is a block diagram of the functional units of the font switching device 600 involved in the embodiment of the present application.
  • the font switching device 600 is applied to electronic equipment, including a processing unit 601 and a communication unit 602, where,
  • the processing unit 601 is configured to determine the font and display density of the text information when it is detected that the currently displayed application interface displays text information; and to detect that the font is the default font and the display
  • a pre-stored user handwriting font resource library is obtained through the communication unit 602, and the user handwriting font resource library is text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits Collection, the AI font model is obtained after training through handwriting font data input by the user; and for switching the font of the text information to the user handwriting font through the user handwriting font resource library.
  • the font switching device 600 may further include a storage unit 603 for storing program codes and data of electronic devices.
  • the processing unit 601 may be a processor
  • the communication unit 602 may be a touch screen or a transceiver
  • the storage unit 603 may be a memory.
  • the electronic device first determines the font and display density of the text information when it detects that the currently displayed application interface displays text information, and secondly, detects that the font is the default font , And when the display density is less than the target preset density threshold, obtain a pre-stored user handwriting font resource library, the user handwriting font resource library is a collection of text generated by a pre-trained artificial intelligence AI font model that matches user handwriting habits The AI font model is obtained after training through handwriting font data input by the user, and finally, the font of the text information is switched to the user handwriting font through the user handwriting font resource library.
  • the electronic device can determine the font and display density of the text in the information according to the text information of the currently displayed application interface, so that when the font of the text information is detected as the default font and the display density is less than the preset density threshold, the pre-stored User handwriting font resource library, thus switching the font of text information to user handwriting font through the user handwriting font resource library, and switching the font of text information from the default font to the user's handwriting font, making the font settings more personalized and beneficial to improve The user's reading experience.
  • the processing unit 601 is specifically configured to: determine the first display area and the first text number corresponding to the text information in the application interface Item; and used to obtain pre-stored user handwriting font template text, and select the target user handwriting font template text whose display area is the first display area from the user handwriting font template text, wherein the user handwriting font template
  • the font of the text is the user's handwriting font; and the number of the second text corresponding to the target user's handwriting font template text; and the number of the second text is used to determine the The display density.
  • the processing unit 601 is specifically configured to: determine a first spacing between text displayed on the application interface; and The first pitch determines the display density of the text information.
  • the processing unit 601 is specifically configured to: obtain the pre-stored user handwriting font template text, and determine the user handwriting font template text in Chinese A second pitch between words; and for determining the display density based on the ratio between the second pitch and the first pitch.
  • the processing unit 601 is specifically configured to: determine the font of the text information by After the default font is switched to the user handwriting font, the second display area corresponding to the text information; and for detecting that the difference between the second display area and the first display area is greater than the first
  • the threshold is preset
  • the text information of the user's handwriting font is adjusted so that the difference between the adjusted display area of the text information and the first display area is less than the first preset threshold.
  • the processing unit 601 is specifically configured to: obtain the application scene corresponding to the application interface Historical usage records; and for determining the number of times the font switching instruction is received in the application scenario based on the historical usage records; and for detecting the text when the number of times is detected to be greater than a second preset threshold The font of the information is switched to the user handwriting font.
  • the processing unit 601 is further configured to determine a first preset density threshold set corresponding to the application when the current application is detected as a preset application; and an application interface used according to the application To determine the application scenario of the application; and to find a mapping relationship between a preset application scenario and a preset density threshold, and determine a target preset density corresponding to the application scenario in the first preset density threshold set Threshold.
  • the processing unit 601 is further specifically configured to acquire text handwritten by the user when it is detected that the electronic device enables the handwriting input method; and used to pass the pre-trained artificial intelligence AI font model, Training the user's handwritten text to obtain the user's handwritten font resource library.
  • the processing unit 601 is further configured to capture a target picture through a camera, the target picture being a captured picture containing text in a handwritten font of the user; And for extracting the text of the user's handwriting font from the target picture, training the text of the user's handwriting font through the pre-trained artificial intelligence AI font model, and determining the user's handwriting font resource library.
  • An embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes the computer to perform part or all of the steps of any method described in the foregoing method embodiments ,
  • the above computer includes electronic equipment.
  • Embodiments of the present application also provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium that stores the computer program, and the computer program is operable to cause the computer to perform any of the methods described in the foregoing method embodiments Some or all steps of the method.
  • the computer program product may be a software installation package, and the computer includes an electronic device.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the above-mentioned units is only a division of logical functions.
  • there may be other division methods for example, multiple units or components may be combined or integrated To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present application may essentially be a part that contributes to the prior art or all or part of the technical solution may be embodied in the form of a software product, and the computer software product is stored in a memory,
  • Several instructions are included to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the aforementioned memory includes: U disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
  • the program may be stored in a computer-readable memory, and the memory may include: a flash disk , Read-Only Memory (English: Read-Only Memory, abbreviation: ROM), Random Access Device (English: Random Access Memory, abbreviation: RAM), magnetic disk or optical disk, etc.
  • ROM Read-Only Memory
  • RAM Random Access Device
  • magnetic disk or optical disk etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种字体切换方法及相关产品,应用于电子设备,所述方法包括:在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度(S201);在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到(S202);通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体(S203)。该方法有利于使字体切换更加个性化。

Description

字体切换方法及相关产品 技术领域
本申请涉及电子技术领域,尤其涉及一种字体切换方法及相关产品。
背景技术
现有技术中,用户在使用电子设备时,在不同的显示界面中的文字信息一般都是用默认字体进行显示的,在使用某些应用时,可以设置字体,但是可以选择的字体都是应用自带的常规字体,在某些场景下,用户可能更想有专属于自己的手写字体资源库,将显示界面的字体切换为用户手写字体,使得字体切换更符合用户阅读习惯。
发明内容
本申请实施例提供一种字体切换方法及相关产品,有利于使字体切换更加个性化,提高用户体验。
第一方面,本申请实施例提供一种字体切换方法,应用于电子设备,所述方法包括:
在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度;
在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到;
通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
第二方面,本申请实施例提供一种字体切换装置,应用于电子设备,所述字体切换装置包括处理单元和通信单元,其中,
所述处理单元,用于在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度;以及用于在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,通过所述通信单元获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到;以及用于通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
第三方面,本申请实施例提供一种电子设备,包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面任一方法中的步骤的指令。
第四方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,上述计算机程序使得计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤。
第五方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面任一方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
可以看出,在本申请实施例中,电子设备首先在检测到当前显示的应用界面显示有文 字信息时,确定所述文字信息的字体和显示密度,其次,在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到,最后,通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。由于电子设备可以根据当前显示的应用界面的文字信息,确定信息中文字的字体和显示密度,从而可以在检测到文字信息的字体为默认字体,且显示密度小于预设密度阈值时,获取预存的用户手写字体资源库,从而通过用户手写字体资源库将文字信息的字体切换为用户手写字体,通过将文字信息的字体由默认字体切换为用户的手写字体,使得字体设置更加个性化,有利于提高用户的阅读体验。
附图说明
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。
图1A是一种智能手机的程序运行空间的示意图;
图1B是一种安卓系统的系统架构图;
图2是本申请实施例提供的一种字体切换方法的流程示意图;
图3是本申请实施例提供的另一种字体切换方法的流程示意图;
图4是本申请实施例提供的另一种字体切换方法的流程示意图;
图5是本申请实施例提供的一种电子设备的结构示意图;
图6是本申请实施例提供的一种字体切换装置的功能单元组成框图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
以下分别进行详细说明。
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
如图1A所示,目前智能手机等电子设备一般设置有程序运行空间,该程序运行空间包括用户空间和操作系统空间,其中,用户空间运行有一个或多个应用程序,该一个或多个应用程序为电子设备安装的第三方应用程序,本申请实施例所描述的资源下载方法对应的软件算法运行在用户空间,操作系统空间运行有电子设备的操作系统。
该电子设备具体可以运行安卓Android系统、苹果公司开发的移动操作系统iOS等,此处不做唯一限定。如图1B所示,以所述电子设备运行有Android系统为例,对应的用户 空间包括该Android系统中的应用层(Applications),操作系统空间可以包括该Android系统中的应用程序框架层(Application Framework)、系统运行库层(包括系统运行库层Libraries和Android运行时Android Runtime)、Linux内核层(Linux Kernel)。其中,应用层上包括各类与用户直接交互的应用程序,或由Java语言编写的运行于后台的服务程序。例如,智能手机上实现的常见基本功能的程序,诸如短消息业务(Short Messaging Service,SMS)短信,电话拨号,图片浏览器,日历,游戏,地图,万维网(World Wide Web,Web)浏览器等程序,以及开发人员开发的其他应用程序。应用程序框架层提供开发Android应用程序所需的一系列类库,能够用于重用组件,也可以通过继承实现个性化的扩展。系统运行库层是应用程序框架的支撑,为Android系统中的各个组件提供服务。系统运行库层由系统类库和Android运行时构成。Android运行时包含核心库和Dalvik虚拟机两部分。Linux内核层用于实现硬件设备驱动,进程和内存管理,网络协议栈,电源管理,无线通信等核心功能。
本申请实施例所涉及到的电子设备可以是具备域名解析能力的电子设备,该电子设备可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。
下面对本申请实施例进行详细介绍。
请参阅图2,图2是本申请实施例提供了一种字体切换方法的流程示意图,应用于电子设备。本字体切换方法包括:
S201,所述电子设备在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度。
其中,电子设备在使用不用的应用界面时,显示有不同的文字信息,文字信息可以包括显示的文字的字体,字体大小,显示区域,显示面积大小,显示内容等。一般,文字信息都是使用默认字体进行显示,默认字体可能是电子设备配置的默认字体,也可能是应用配置的默认字体。
其中,根据文字信息可以确定文字信息的字体和显示密度,从而确定是否执行本申请实施例提供的字体切换方法,但是当显示的文字数目较少,或者字体大小较小,或者文字的显示区域较偏僻(屏幕边角区域),或者显示面积较小时,对字体进行切换可能用户不能明显感受到切换了字体,因此可进一步对文字信息进行设定,当文字信息满足一定预设条件时,确定文字信息的字体和显示密度。
S202,所述电子设备在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到。
其中,电子设备在检测到文字信息的字体为默认字体,且文字信息的显示密度小于目标预设密度阈值时,此时可确定对文字信息的字体进行字体切换。
其中,获取预存的用户手写字体资源库,每类字体都对应一个字体资源库,字体资源库包括每个文字对应的特定文字图像,即包括该类字体的文字集合。用户手写字体为可以由人工智能(Artificial Intelligence,AI)模型得到,通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,即用户手写字体资源库,从而在进行字体切换时,可以从用户手写字体资源库中获取对应的文字,从而为文字进行字体切换。
其中,AI字体模型可以通过对用户输入的手写字体数据进行训练后得到,用户输入的手写字体数据包括一些用户手写的文字,通过对AI模型进行训练,使得AI模型可以根据 一些用户手写的文字,得到用户手写文字的规律,从而获取的用户手写的其他文字,进而生成用户手写字体资源库。
S203,所述电子设备通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
其中,当检测到用户的字体切换操作时,或者在用户设定的需要进行字体切换的预设场景下,可根据用户手写字体资源库和文字信息,将文字信息的字体切换为用户手写字体。
可以看出,在本申请实施例中,电子设备首先在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度,其次,在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到,最后,通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。由于电子设备可以根据当前显示的应用界面的文字信息,确定信息中文字的字体和显示密度,从而可以在检测到文字信息的字体为默认字体,且显示密度小于预设密度阈值时,获取预存的用户手写字体资源库,从而通过用户手写字体资源库将文字信息的字体切换为用户手写字体,通过将文字信息的字体由默认字体切换为用户的手写字体,使得字体设置更加个性化,有利于提高用户的阅读体验。
在一个可能的示例中,所述确定所述文字信息的显示密度,包括:确定所述文字信息在所述应用界面中对应的第一显示面积和第一文字数目;获取预存的用户手写字体模板文字,并从所述用户手写字体模板文字中选取显示面积为所述第一显示面积的目标用户手写字体模板文字,其中,所述用户手写字体模板文字的字体为所述用户手写字体;确定所述目标用户手写字体模板文字对应的第二文字数目;根据所述第一文字数目和所述第二文字数目的比值,确定所述显示密度。
其中,确定所述应用界面显示的文字信息的第一显示面积和第一文字数目,其中,第一显示面积可以是所有文字信息的显示面积,则第一文字数目对应显示的所有文字的数目,第一显示面积也可以是选取的某个区域的文字信息的显示面积,则第一文字数目对应该显示区域的文字数目。
其中,获取预存的用户手写字体模板文字,用户手写字体模板文字中的文字字体为用户手写字体,且文字字体大小和文字信息中的文字一样。从手写字体模板文字中选取显示面积为第一显示面积的目标用户手写字体模板文字,确定用户手写字体模板文字对应的第二文字数目,根据第一文字数目和第二文字数目确定文字信息中文字的显示密度。
举例说明,显示面积为第一显示面积的文字信息中,包含300个文字,而显示面积也为第一显示面积的目标用户手写字体模板文字中,只有200个文字,可见,以用户手写字体模板文字作为标准,检测到文字信息的显示密度为用户手写字体模板的1.5倍数,文字信息中显示的文字越多,文字信息的显示密度越大。
可见,本示例中,以用户手写字体模板作为标准,由于用户手写字体模板中的文字字体大小和文字信息中的文字字体大小相同,且文字之间的间距为用户或者系统设定的适合用户阅读的标准间距,从而根据相同显示面积的文字信息中的文字数目和用户手写字体模板的文字数目,确定两者之间的比值进而确定文字信息的显示密度,有利于根据显示密度的大小,确定当前显示界面的文字信息是否满足字体切换的条件。
在一个可能的示例中,所述确定所述文字信息的显示密度,包括:确定所述应用界面显示的文字之间的第一间距;根据所述第一间距确定所述文字信息的显示密度。
可见,本示例中,通过确定应用界面显示的文字之间的第一间距,根据第一间距的大 小,确定文字信息的显示密度,一般情况下,间距越大,文字密度越小,间距越小,文字密度越大,通过间距判断文字信息的显示密度是否满足字体切换的条件,有利于提高处理效率。
在一个可能的示例中,所述根据所述第一间距确定所述文字信息的显示密度,包括:获取预存的所述用户手写字体模板文字,并确定所述用户手写字体模板文字中文字之间的第二间距;根据所述第二间距和所述第一间距之间的比值,确定所述显示密度。
其中,电子设备中存有用户手写字体模板文字,用户手写字体模板文字包括字体为用户手写字体,相同字体大小的用户手写字体模板文字,且文字之间的间距可以为由系统根据大数据统计出来的使用用户阅读,可以减轻阅读疲劳的间距。
其中,获取预存的用户手写字体模板文字,其字体大小和文字信息的字体大小相同,确定用户手写字体模板文字中文字之间的第二间距,根据第一间距和第二间距之间的比值,确定显示密度。第一间距和第二间距可以是文字之间的左右间距,或者上下间距。
可见,本示例中,根据标准的用户手写字体模板文字中文字之间的第二间距,以及当前应用界面显示的文字信息之间的第一间距,确定第二间距和第一间距之间的比值,比值越大时,说明文字信息的显示密度越大,比值越小时,说明文字信息的显示密度越小。
在一个可能的示例中,所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体,包括:确定将所述文字信息的字体由所述默认字体切换到所述用户手写字体后,所述文字信息对应的第二显示面积;在检测到所述第二显示面积和所述第一显示面积之间的差值大于第一预设阈值时,对所述用户手写字体的文字信息进行调整,使得调整后的所述文字信息的显示面积和所述第一显示面积之间的差值小于所述第一预设阈值。
其中,由于每个用户的手写字体都不同,有的用户手写字体的文字可能偏长,有的用户手写字体的文字可能偏宽,但是将文字信息中的文字由默认字体切换为用户手写字体之后,文字之间的左右间距和上下间距是不会变的,因为可能会导致切换字体后的文字信息对应有第二显示面积,在检测到第二显示面积和第一显示面积之间的差值大于第一预设阈值时,可以对调整后的文字信息进行调整,从而使得调整后的文字信息的显示面积和第一显示面积之间的差值小于第一预设阈值。
其中,调整方式可以是对切换后的字体信息进行缩放,将显示面积由第二显示面积缩放到第一显示面积,此处不作任何限定。
可见,本示例中,在将文字信息的字体由默认字体切换到用户手写字体后,会检测文字信息对应的第二显示面积,在检测到第二显示面积和切换字体之前的第一显示面积之间的差值大于第一预设阈值时,通过对文字信息的进行调整,使得文字信息的显示不影响用户的视觉体验。
在一个可能的示例中,所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体,包括:获取所述应用界面对应的应用场景的历史使用记录;根据所述历史使用记录确定在所述应用场景下,接收到字体切换指令的次数;在检测到所述次数大于第二预设阈值时,将所述文字信息的字体切换为所述用户手写字体。
其中,电子设备还可以获取当前应用界面对应的应用场景的历史使用记录,根据历史使用记录,确定在该应用场景下,接收到的字体切换指令的次数,在检测到次数大于第二预设阈值时,可以直接将文字信息的字体切换为用户手写字体,从而不需要用户执行切换字体的操作。
可见,本示例中,通过对应用界面对应的应用场景下,接收到字体切换指令的次数进行判断,在次数超过第二预设阈值时,表明用户在此应用场景下,更希望使用用户手写字体来显示文字信息,从而在电子设备进入该应用场景时,直接将文字信息的字体切换为用 户手写字体,省去了用户手动切换字体。
在一个可能的示例中,所述方法还包括:在检测到当前应用为预设应用时,确定所述应用对应的第一预设密度阈值集合;根据所述应用的应用界面,确定所述应用的应用场景;查找预设的应用场景和预设密度阈值之间的映射关系,确定所述第一预设密度阈值集合中所述应用场景对应的目标预设密度阈值。
其中,可以获取预设应用在多个应用场景下显示的文字信息,从而根据所述显示的文字信息,通过AI字体模型对所述文字信息进行训练,得到所述预设应用的预设密度阈值集合,所述预设密度阈值集合中的每个预设密度阈值对应一个应用场景。
可见,本示例中,在同一应用的不同应用场景下,每个应用场景对应的预设密度阈值不同,确定当前应用对应的第一预设密度阈值集合,从而确定当前界面对应的应用场景在第一预设密度阈值集合中的目标预设密度阈值,通过判断文字信息的显示密度是否小于目标预设密度阈值,有利于确定是否需要进行字体切换操作。
在一个可能的示例中,所述方法还包括:在检测到所述电子设备启用手写输入法时,获取用户手写的文字;通过所述预训练的人工智能AI字体模型,对用户手写的文字进行训练,得到所述用户手写字体。
可见,本示例中,预训练的人工智能AI字体模型可以根据用户输入的手写字体数据确定用户手写字体资源库,例如,在检测到电子设备启用手写输入法时,获取用户手写的文字,可以获取手写文字的图像,通过AI模型对用户手写的文字进行训练,根据用户手写的部分文字,得到用户手写字体资源库。
在一个可能的示例中,所述方法还包括:通过摄像头拍摄目标图片,所述目标图片为拍摄的包含用户手写字体的文字的图片;从所述目标图片中提取用户手写字体的文字,通过所述预训练的人工智能AI字体模型对所述用户手写字体的文字进行训练,确定所述用户手写字体资源库。
可见,本示例中,通过获取用户的手写字体数据,例如,拍摄包括用户手写字体的文字的目标图片,从目标图片中提取出用户手写字体的文字,通过预训练的人工智能AI字体模型对用户手写字体的文字进行训练,可以得到用户手写字体资源库。
与所述图2所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种字体切换方法的流程示意图,应用于电子设备。如图所示,本字体切换方法包括:
S301,所述电子设备在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度。
S302,所述电子设备在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到。
S303,所述电子设备确定将所述文字信息的字体由所述默认字体切换到所述用户手写字体后,所述文字信息对应的第二显示面积。
S304,所述电子设备在检测到所述第二显示面积和所述第一显示面积之间的差值大于第一预设阈值时,对所述用户手写字体的文字信息进行调整,使得调整后的所述文字信息的显示面积和所述第一显示面积之间的差值小于所述第一预设阈值。
可以看出,在本申请实施例中,电子设备首先在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度,其次,在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手 写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到,最后,通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。由于电子设备可以根据当前显示的应用界面的文字信息,确定信息中文字的字体和显示密度,从而可以在检测到文字信息的字体为默认字体,且显示密度小于预设密度阈值时,获取预存的用户手写字体资源库,从而通过用户手写字体资源库将文字信息的字体切换为用户手写字体,通过将文字信息的字体由默认字体切换为用户的手写字体,使得字体设置更加个性化,有利于提高用户的阅读体验。
此外,在将文字信息的字体由默认字体切换到用户手写字体后,会检测文字信息对应的第二显示面积,在检测到第二显示面积和切换字体之前的第一显示面积之间的差值大于第一预设阈值时,通过对文字信息的进行调整,使得文字信息的显示不影响用户的视觉体验。
与所述图2、图3所示的实施例一致的,请参阅图4,图4是本申请实施例提供的一种字体切换方法的流程示意图,应用于电子设备,所述电子设备启用多个无线通信链路。如图所示,本字体切换方法包括:
S401,所述电子设备在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度。
S402,所述电子设备在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到。
S403,所述电子设备获取所述应用界面对应的应用场景的历史使用记录。
S404,所述电子设备根据所述历史使用记录确定在所述应用场景下,接收到字体切换指令的次数。
S405,所述电子设备在检测到所述次数大于第二预设阈值时,将所述文字信息的字体切换为所述用户手写字体。
可以看出,在本申请实施例中,电子设备首先在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度,其次,在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到,最后,通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。由于电子设备可以根据当前显示的应用界面的文字信息,确定信息中文字的字体和显示密度,从而可以在检测到文字信息的字体为默认字体,且显示密度小于预设密度阈值时,获取预存的用户手写字体资源库,从而通过用户手写字体资源库将文字信息的字体切换为用户手写字体,通过将文字信息的字体由默认字体切换为用户的手写字体,使得字体设置更加个性化,有利于提高用户的阅读体验。
此外,通过对应用界面对应的应用场景下,接收到字体切换指令的次数进行判断,在次数超过第二预设阈值时,表明用户在此应用场景下,更希望使用用户手写字体来显示文字信息,从而在电子设备进入该应用场景时,直接将文字信息的字体切换为用户手写字体,省去了用户手动切换字体。
与所述图2、图3、图4所示的实施例一致的,请参阅图5,图5是本申请实施例提供的一种电子设备500的结构示意图,该电子设备500运行有一个或多个应用程序和操作系统,如图所示,该电子设备500包括处理器510、存储器520、通信接口530以及一个或多个程序521,其中,所述一个或多个程序521被存储在所述存储器520中,并且被配置由所述处理器510执行,所述一个或多个程序521包括用于执行以下步骤的指令;
在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度;
在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到;
通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
可以看出,在本申请实施例中,电子设备首先在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度,其次,在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到,最后,通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。由于电子设备可以根据当前显示的应用界面的文字信息,确定信息中文字的字体和显示密度,从而可以在检测到文字信息的字体为默认字体,且显示密度小于预设密度阈值时,获取预存的用户手写字体资源库,从而通过用户手写字体资源库将文字信息的字体切换为用户手写字体,通过将文字信息的字体由默认字体切换为用户的手写字体,使得字体设置更加个性化,有利于提高用户的阅读体验。
在一个可能的示例中,在所述确定所述文字信息的显示密度方面,所述程序中的指令具体用于执行以下操作:确定所述文字信息在所述应用界面中对应的第一显示面积和第一文字数目;获取预存的用户手写字体模板文字,并从所述用户手写字体模板文字中选取显示面积为所述第一显示面积的目标用户手写字体模板文字,其中,所述用户手写字体模板文字的字体为所述用户手写字体;确定所述目标用户手写字体模板文字对应的第二文字数目;根据所述第一文字数目和所述第二文字数目的比值,确定所述显示密度。
在一个可能的示例中,在所述确定所述文字信息的显示密度方面,所述程序中的指令具体用于执行以下操作:确定所述应用界面显示的文字之间的第一间距;根据所述第一间距确定所述文字信息的显示密度。
在一个可能的示例中,在所述根据所述第一间距确定所述文字信息的显示密度方面,所述程序中的指令具体用于执行以下操作:获取预存的所述用户手写字体模板文字,并确定所述用户手写字体模板文字中文字之间的第二间距;根据所述第二间距和所述第一间距之间的比值,确定所述显示密度。
在一个可能的示例中,在所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体方面,所述程序中的指令具体用于执行以下操作:确定将所述文字信息的字体由所述默认字体切换到所述用户手写字体后,所述文字信息对应的第二显示面积;在检测到所述第二显示面积和所述第一显示面积之间的差值大于第一预设阈值时,对所述用户手写字体的文字信息进行调整,使得调整后的所述文字信息的显示面积和所述第一显示面积之间的差值小于所述第一预设阈值。
在一个可能的示例中,在所述通过所述用户手写字体资源库将所述文字信息的字体切 换为手写字体方面,所述程序中的指令具体用于执行以下操作:获取所述应用界面对应的应用场景的历史使用记录;根据所述历史使用记录确定在所述应用场景下,接收到字体切换指令的次数;在检测到所述次数大于第二预设阈值时,将所述文字信息的字体切换为所述用户手写字体。
在一个可能的示例中,所述程序中的指令具体用于执行以下操作:在检测到当前应用为预设应用时,确定所述应用对应的第一预设密度阈值集合;根据所述应用的应用界面,确定所述应用的应用场景;查找预设的应用场景和预设密度阈值之间的映射关系,确定所述第一预设密度阈值集合中所述应用场景对应的目标预设密度阈值。
在一个可能的示例中,所述程序中的指令具体用于执行以下操作:在检测到所述电子设备启用手写输入法时,获取用户手写的文字;通过所述预训练的人工智能AI字体模型,对用户手写的文字进行训练,得到所述用户手写字体资源库。
在一个可能的示例中,所述程序中的指令具体用于执行以下操作:通过摄像头拍摄目标图片,所述目标图片为拍摄的包含用户手写字体的文字的图片;从所述目标图片中提取用户手写字体的文字,通过所述预训练的人工智能AI字体模型对所述用户手写字体的文字进行训练,确定所述用户手写字体资源库。
上述实施例主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据所述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。所述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
图6是本申请实施例中所涉及的字体切换装置600的功能单元组成框图。该字体切换装置600应用于电子设备,包括处理单元601和通信单元602,其中,
所述处理单元601,用于在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度;以及用于在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,通过所述通信单元602获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到;以及用于通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
其中,所述字体切换装置600还可以包括存储单元603,用于存储电子设备的程序代码和数据。所述处理单元601可以是处理器,所述通信单元602可以是触控显示屏或者收发器,存储单元603可以是存储器。
可以看出,在本申请实施例中,电子设备首先在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度,其次,在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到,最后,通过所述用 户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。由于电子设备可以根据当前显示的应用界面的文字信息,确定信息中文字的字体和显示密度,从而可以在检测到文字信息的字体为默认字体,且显示密度小于预设密度阈值时,获取预存的用户手写字体资源库,从而通过用户手写字体资源库将文字信息的字体切换为用户手写字体,通过将文字信息的字体由默认字体切换为用户的手写字体,使得字体设置更加个性化,有利于提高用户的阅读体验。
在一个可能的示例中,在所述确定所述文字信息的显示密度方面,所述处理单元601具体用于:确定所述文字信息在所述应用界面中对应的第一显示面积和第一文字数目;以及用于获取预存的用户手写字体模板文字,并从所述用户手写字体模板文字中选取显示面积为所述第一显示面积的目标用户手写字体模板文字,其中,所述用户手写字体模板文字的字体为所述用户手写字体;以及用于确定所述目标用户手写字体模板文字对应的第二文字数目;以及用于根据所述第一文字数目和所述第二文字数目的比值,确定所述显示密度。
在一个可能的示例中,在所述确定所述文字信息的显示密度方面,所述处理单元601具体用于:确定所述应用界面显示的文字之间的第一间距;以及用于根据所述第一间距确定所述文字信息的显示密度。
在一个可能的示例中,在所述确定所述文字信息的显示密度方面,所述处理单元601具体用于:获取预存的所述用户手写字体模板文字,并确定所述用户手写字体模板文字中文字之间的第二间距;以及用于根据所述第二间距和所述第一间距之间的比值,确定所述显示密度。
在一个可能的示例中,在所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体方面,所述处理单元601具体用于:确定将所述文字信息的字体由所述默认字体切换到所述用户手写字体后,所述文字信息对应的第二显示面积;以及用于在检测到所述第二显示面积和所述第一显示面积之间的差值大于第一预设阈值时,对所述用户手写字体的文字信息进行调整,使得调整后的所述文字信息的显示面积和所述第一显示面积之间的差值小于所述第一预设阈值。
在一个可能的示例中,在所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体方面,所述处理单元601具体用于:获取所述应用界面对应的应用场景的历史使用记录;以及用于根据所述历史使用记录确定在所述应用场景下,接收到字体切换指令的次数;以及用于在检测到所述次数大于第二预设阈值时,将所述文字信息的字体切换为所述用户手写字体。
在一个可能的示例中,所述处理单元601还用于在检测到当前应用为预设应用时,确定所述应用对应的第一预设密度阈值集合;以及用于根据所述应用的应用界面,确定所述应用的应用场景;以及用于查找预设的应用场景和预设密度阈值之间的映射关系,确定所述第一预设密度阈值集合中所述应用场景对应的目标预设密度阈值。
在一个可能的示例中,所述处理单元601具体还用于在检测到所述电子设备启用手写输入法时,获取用户手写的文字;以及用于通过所述预训练的人工智能AI字体模型,对用户手写的文字进行训练,得到所述用户手写字体资源库。
在一个可能的示例中,在所述确定所述文字信息的显示密度方面,所述处理单元601还用于通过摄像头拍摄目标图片,所述目标图片为拍摄的包含用户手写字体的文字的图片;以及用于从所述目标图片中提取用户手写字体的文字,通过所述预训练的人工智能AI字体模型对所述用户手写字体的文字进行训练,确定所述用户手写字体资源库。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法 的部分或全部步骤,上述计算机包括电子设备。
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括电子设备。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种字体切换方法,其特征在于,应用于电子设备,所述方法包括:
    在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度;
    在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到;
    通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述文字信息的显示密度,包括:
    确定所述文字信息在所述应用界面中对应的第一显示面积和第一文字数目;
    获取预存的用户手写字体模板文字,并从所述用户手写字体模板文字中选取显示面积为所述第一显示面积的目标用户手写字体模板文字,其中,所述用户手写字体模板文字的字体为所述用户手写字体;
    确定所述目标用户手写字体模板文字对应的第二文字数目;
    根据所述第一文字数目和所述第二文字数目的比值,确定所述显示密度。
  3. 根据权利要求1所述的方法,其特征在于,所述确定所述文字信息的显示密度,包括:
    确定所述应用界面显示的文字之间的第一间距;
    根据所述第一间距确定所述文字信息的显示密度。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述第一间距确定所述文字信息的显示密度,包括:
    获取预存的所述用户手写字体模板文字,并确定所述用户手写字体模板文字中文字之间的第二间距;
    根据所述第二间距和所述第一间距之间的比值,确定所述显示密度。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体,包括:
    确定将所述文字信息的字体由所述默认字体切换到所述用户手写字体后,所述文字信息对应的第二显示面积;
    在检测到所述第二显示面积和所述第一显示面积之间的差值大于第一预设阈值时,对所述用户手写字体的文字信息进行调整,使得调整后的所述文字信息的显示面积和所述第一显示面积之间的差值小于所述第一预设阈值。
  6. 根据权利要求1-4任一项所述的方法,其特征在于,所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体,包括:
    获取所述应用界面对应的应用场景的历史使用记录;
    根据所述历史使用记录确定在所述应用场景下,接收到字体切换指令的次数;
    在检测到所述次数大于第二预设阈值时,将所述文字信息的字体切换为所述用户手写字体。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述方法还包括:
    在检测到当前应用为预设应用时,确定所述应用对应的第一预设密度阈值集合;
    根据所述应用的应用界面,确定所述应用的应用场景;
    查找预设的应用场景和预设密度阈值之间的映射关系,确定所述第一预设密度阈值集 合中所述应用场景对应的目标预设密度阈值。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:
    在检测到所述电子设备启用手写输入法时,获取用户手写的文字;
    通过所述预训练的人工智能AI字体模型,对用户手写的文字进行训练,得到所述用户手写字体资源库。
  9. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:
    通过摄像头拍摄目标图片,所述目标图片为拍摄的包含用户手写字体的文字的图片;
    从所述目标图片中提取用户手写字体的文字,通过所述预训练的人工智能AI字体模型对所述用户手写字体的文字进行训练,确定所述用户手写字体资源库。
  10. 一种字体切换装置,其特征在于,应用于电子设备,所述字体切换装置包括处理单元和通信单元,其中,
    所述处理单元,用于在检测到当前显示的应用界面显示有文字信息时,确定所述文字信息的字体和显示密度;以及用于在检测到所述字体为默认字体,且所述显示密度小于目标预设密度阈值时,通过所述通信单元获取预存的用户手写字体资源库,所述用户手写字体资源库为通过预训练的人工智能AI字体模型生成的匹配用户手写习惯的文字的集合,所述AI字体模型是通过用户输入的手写字体数据进行训练后得到;以及用于通过所述用户手写字体资源库将所述文字信息的字体切换为所述用户手写字体。
  11. 根据权利要求10所述的字体切换装置,其特征在于,在所述确定所述文字信息的显示密度方面,所述处理单元具体用于:确定所述文字信息在所述应用界面中对应的第一显示面积和第一文字数目;以及用于获取预存的用户手写字体模板文字,并从所述用户手写字体模板文字中选取显示面积为所述第一显示面积的目标用户手写字体模板文字,其中,所述用户手写字体模板文字的字体为所述用户手写字体;以及用于确定所述目标用户手写字体模板文字对应的第二文字数目;以及用于根据所述第一文字数目和所述第二文字数目的比值,确定所述显示密度。
  12. 根据权利要求10所述的字体切换装置,其特征在于,在所述确定所述文字信息的显示密度方面,所述处理单元具体用于:确定所述应用界面显示的文字之间的第一间距;以及用于根据所述第一间距确定所述文字信息的显示密度。
  13. 根据权利要求12所述的字体切换装置,其特征在于,在所述确定所述文字信息的显示密度方面,所述处理单元具体用于:获取预存的所述用户手写字体模板文字,并确定所述用户手写字体模板文字中文字之间的第二间距;以及用于根据所述第二间距和所述第一间距之间的比值,确定所述显示密度。
  14. 根据权利要求10-13任一项所述的字体切换装置,其特征在于,在所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体方面,所述处理单元具体用于:确定将所述文字信息的字体由所述默认字体切换到所述用户手写字体后,所述文字信息对应的第二显示面积;以及用于在检测到所述第二显示面积和所述第一显示面积之间的差值大于第一预设阈值时,对所述用户手写字体的文字信息进行调整,使得调整后的所述文字信息的显示面积和所述第一显示面积之间的差值小于所述第一预设阈值。
  15. 根据权利要求10-13任一项所述的字体切换装置,其特征在于,在所述通过所述用户手写字体资源库将所述文字信息的字体切换为手写字体方面,所述处理单元具体用于:获取所述应用界面对应的应用场景的历史使用记录;以及用于根据所述历史使用记录确定在所述应用场景下,接收到字体切换指令的次数;以及用于在检测到所述次数大于第二预设阈值时,将所述文字信息的字体切换为所述用户手写字体。
  16. 根据权利要求10-15任一项所述的字体切换装置,其特征在于,所述处理单元还用于在检测到当前应用为预设应用时,确定所述应用对应的第一预设密度阈值集合;以及用于根据所述应用的应用界面,确定所述应用的应用场景;以及用于查找预设的应用场景和预设密度阈值之间的映射关系,确定所述第一预设密度阈值集合中所述应用场景对应的目标预设密度阈值。
  17. 根据权利要求10-16任一项所述的字体切换装置,其特征在于,所述处理单元具体还用于在检测到所述电子设备启用手写输入法时,获取用户手写的文字;以及用于通过所述预训练的人工智能AI字体模型,对用户手写的文字进行训练,得到所述用户手写字体资源库。
  18. 根据权利要求10-16任一项所述的字体切换装置,其特征在于,在所述确定所述文字信息的显示密度方面,所述处理单元还用于通过摄像头拍摄目标图片,所述目标图片为拍摄的包含用户手写字体的文字的图片;以及用于从所述目标图片中提取用户手写字体的文字,通过所述预训练的人工智能AI字体模型对所述用户手写字体的文字进行训练,确定所述用户手写字体资源库。
  19. 一种电子设备,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-9任一项所述的方法中的步骤的指令。
  20. 一种计算机可读存储介质,其特征在于,存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-9任一项所述的方法。
PCT/CN2018/122150 2018-12-19 2018-12-19 字体切换方法及相关产品 WO2020124454A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880098629.0A CN112840305B (zh) 2018-12-19 2018-12-19 字体切换方法及相关产品
PCT/CN2018/122150 WO2020124454A1 (zh) 2018-12-19 2018-12-19 字体切换方法及相关产品

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/122150 WO2020124454A1 (zh) 2018-12-19 2018-12-19 字体切换方法及相关产品

Publications (1)

Publication Number Publication Date
WO2020124454A1 true WO2020124454A1 (zh) 2020-06-25

Family

ID=71102559

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/122150 WO2020124454A1 (zh) 2018-12-19 2018-12-19 字体切换方法及相关产品

Country Status (2)

Country Link
CN (1) CN112840305B (zh)
WO (1) WO2020124454A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833688A (zh) * 2020-07-30 2020-10-27 上海松鼠课堂人工智能科技有限公司 基于生成对抗网络的练字系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048363B (zh) * 2023-04-03 2023-08-25 数孪模型科技(北京)有限责任公司 基于人工智能的软件界面的显示方法、系统、设备和介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002229974A (ja) * 2001-02-02 2002-08-16 Seiko Epson Corp 表示フォント切換装置、表示フォント切換方法、印刷フォント切換装置、印刷フォント切換方法、これらのためのプログラムおよび記録媒体
CN103207755A (zh) * 2012-01-13 2013-07-17 宇龙计算机通信科技(深圳)有限公司 终端和更改字体的方法
JP2013228856A (ja) * 2012-04-25 2013-11-07 Kyocera Document Solutions Inc 表示入力装置及びこれを備えた画像形成装置
CN105630511A (zh) * 2016-02-18 2016-06-01 青岛海信移动通信技术股份有限公司 字体切换方法及终端设备
CN106250020A (zh) * 2016-07-28 2016-12-21 维沃移动通信有限公司 一种字体的输入和显示方法及移动终端
CN107229470A (zh) * 2017-05-24 2017-10-03 努比亚技术有限公司 一种系统字体切换方法、移动终端以及计算机可读存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1431881B1 (en) * 2002-12-18 2009-07-29 Microsoft Corporation Automatic determination of appropriate font characteristics
US8543914B2 (en) * 2009-05-22 2013-09-24 Blackberry Limited Method and device for proportional setting of font attributes
CN104238890B (zh) * 2014-09-19 2018-11-23 小米科技有限责任公司 文字显示方法及装置
US9633255B2 (en) * 2015-06-26 2017-04-25 Intel Corporation Substitution of handwritten text with a custom handwritten font
CN107644006B (zh) * 2017-09-29 2020-04-03 北京大学 一种基于深度神经网络的手写体中文字库自动生成方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002229974A (ja) * 2001-02-02 2002-08-16 Seiko Epson Corp 表示フォント切換装置、表示フォント切換方法、印刷フォント切換装置、印刷フォント切換方法、これらのためのプログラムおよび記録媒体
CN103207755A (zh) * 2012-01-13 2013-07-17 宇龙计算机通信科技(深圳)有限公司 终端和更改字体的方法
JP2013228856A (ja) * 2012-04-25 2013-11-07 Kyocera Document Solutions Inc 表示入力装置及びこれを備えた画像形成装置
CN105630511A (zh) * 2016-02-18 2016-06-01 青岛海信移动通信技术股份有限公司 字体切换方法及终端设备
CN106250020A (zh) * 2016-07-28 2016-12-21 维沃移动通信有限公司 一种字体的输入和显示方法及移动终端
CN107229470A (zh) * 2017-05-24 2017-10-03 努比亚技术有限公司 一种系统字体切换方法、移动终端以及计算机可读存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833688A (zh) * 2020-07-30 2020-10-27 上海松鼠课堂人工智能科技有限公司 基于生成对抗网络的练字系统

Also Published As

Publication number Publication date
CN112840305B (zh) 2023-11-28
CN112840305A (zh) 2021-05-25

Similar Documents

Publication Publication Date Title
US10824470B2 (en) Method for resource allocation and terminal device
EP3206110B1 (en) Method of providing handwriting style correction function and electronic device adapted thereto
WO2019233212A1 (zh) 文本识别方法、装置、移动终端以及存储介质
US20190355122A1 (en) Device, Method, and Graphical User Interface for Processing Document
CN108304762B (zh) 一种人体姿态匹配方法及其设备、存储介质、终端
KR20160026142A (ko) 스크랩 정보를 제공하는 전자 장치 및 그 제공 방법
CN109101498B (zh) 翻译方法、装置及移动终端
CN111767554B (zh) 屏幕分享方法、装置、存储介质及电子设备
CN108965981B (zh) 视频播放方法、装置、存储介质及电子设备
WO2019085840A1 (zh) 资源调整方法及装置
CN111209377B (zh) 基于深度学习的文本处理方法、装置、设备及介质
CN110852332A (zh) 训练样本的生成方法、装置、存储介质及电子设备
US11847812B2 (en) Image generation method and apparatus, device, and storage medium
CN108665510B (zh) 连拍图像的渲染方法、装置、存储介质及终端
CN115205925A (zh) 表情系数确定方法、装置、电子设备及存储介质
CN111428570A (zh) 非活体人脸的检测方法、装置、计算机设备及存储介质
WO2020124454A1 (zh) 字体切换方法及相关产品
CN114692639A (zh) 一种文本纠错方法和电子设备
CN109726379B (zh) 内容项编辑方法、装置、电子设备及存储介质
CN108921530B (zh) 信息判断方法、装置、存储介质及终端
CN111639158B (zh) 一种学习内容的显示方法及电子设备
CN117576388A (zh) 一种图像处理方法、装置、存储介质及电子设备
CN114092608B (zh) 表情的处理方法及装置、计算机可读存储介质、电子设备
CN108540726B (zh) 连拍图像的处理方法、装置、存储介质及终端
CN108647097B (zh) 文本图像处理方法、装置、存储介质及终端

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: 18943996

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 031121)

122 Ep: pct application non-entry in european phase

Ref document number: 18943996

Country of ref document: EP

Kind code of ref document: A1