CN108734662B - Method and device for displaying icons - Google Patents

Method and device for displaying icons Download PDF

Info

Publication number
CN108734662B
CN108734662B CN201810526490.7A CN201810526490A CN108734662B CN 108734662 B CN108734662 B CN 108734662B CN 201810526490 A CN201810526490 A CN 201810526490A CN 108734662 B CN108734662 B CN 108734662B
Authority
CN
China
Prior art keywords
icon
displayed
dpi
vector picture
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810526490.7A
Other languages
Chinese (zh)
Other versions
CN108734662A (en
Inventor
魏亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Music Entertainment Technology Shenzhen Co Ltd
Original Assignee
Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Music Entertainment Technology Shenzhen Co Ltd filed Critical Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority to CN201810526490.7A priority Critical patent/CN108734662B/en
Publication of CN108734662A publication Critical patent/CN108734662A/en
Application granted granted Critical
Publication of CN108734662B publication Critical patent/CN108734662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention provides a method and a device for displaying icons, and belongs to the technical field of computers. The method comprises the following steps: acquiring the DPI of the points per inch of the screen; and if the DPI is not equal to the preset value, acquiring a vector picture corresponding to the icon to be displayed from a preset ttf font file through the character rendering component, and displaying the vector picture according to the DPI. By adopting the invention, the occupied storage resources can be reduced.

Description

Method and device for displaying icons
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for displaying icons.
Background
With the development of computer technology, terminals with high DPI (Dots Per Inch) screens are becoming more popular, and in order to enable applications to be displayed on the high DPI screens, the terminals can display images in a 2-fold graph manner.
In the related art, a bitmap (dot matrix pixel data of an icon) of two icons, one of which is dot matrix pixel data of the original icon and the other of which is double dot matrix pixel data of the original icon, is set in an installation package of an application program. Therefore, when the icon to be displayed is loaded, the terminal acquires the icon according to the screen DPI and displays the icon.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
for an application program supporting high DPI, the data of two icon images are stored, so that the occupied storage resources are more.
Disclosure of Invention
In order to solve the problems of the related art, embodiments of the present invention provide a method and an apparatus for displaying an icon. The technical scheme is as follows:
in a first aspect, a method for displaying icons is provided, the method is applied to a screen of a mobile terminal, the mobile terminal comprises a text rendering component, and the method comprises the following steps:
acquiring the number of DPI points per inch of the screen;
if the DPI is not equal to the preset value, obtaining a vector picture corresponding to the icon to be displayed from a preset ttf font file through the text rendering component,
and displaying the vector picture according to the DPI.
Optionally, the obtaining a vector picture corresponding to the icon to be displayed from the preset ttf font file includes:
and according to the unicode characters of the icon to be displayed, obtaining the vector picture corresponding to the unicode characters from the preset ttf font file.
Optionally, the displaying the vector picture according to the DPI includes:
and zooming the vector picture according to the DPI, and displaying the zoomed vector picture.
Optionally, the scaling the vector picture according to the DPI, and displaying the scaled vector picture, includes:
determining the font height of unicode characters of the icon to be displayed according to the DPI;
zooming the vector picture according to the font height;
and displaying the scaled vector picture.
Optionally, the method further includes:
acquiring color information corresponding to the icon to be displayed;
the displaying the vector picture comprises:
and displaying the vector picture according to the color information.
In a second aspect, an apparatus for displaying an icon is provided, the apparatus being applied to a screen of a mobile terminal, the mobile terminal including a text rendering component, the apparatus comprising:
the acquisition module is used for acquiring DPI (dot per inch) of the screen; if the DPI is not equal to the preset value, acquiring a vector picture corresponding to the icon to be displayed from a preset ttf font file through the text rendering component,
and the display module is used for displaying the vector picture according to the DPI.
Optionally, the obtaining module is configured to:
and according to the unicode characters of the icon to be displayed, obtaining the vector picture corresponding to the unicode characters from the preset ttf font file.
Optionally, the display module is configured to:
and zooming the vector picture according to the DPI, and displaying the zoomed vector picture.
Optionally, the display module is configured to:
determining the font height of the unicode characters of the icon to be displayed according to the DPI;
zooming the vector picture according to the font height;
and displaying the scaled vector picture.
Optionally, the obtaining module is further configured to:
acquiring color information corresponding to the icon to be displayed;
the display module is used for:
and displaying the vector picture according to the color information.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
in the embodiment of the invention, because the ttf font file is used, the vector picture can be arbitrarily amplified without blurring, so that only one ttf font file is stored to adapt to a high DPI screen without storing data of two icons, and the occupied storage resource is less. And various patterns are rendered through the character rendering component, so that the rendering efficiency is high.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1a is a schematic diagram of an icon provided by an embodiment of the present invention;
FIG. 1b is a unicode of an icon provided by an embodiment of the present invention;
FIG. 2 is a flowchart of a method for displaying icons according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an icon provided by an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for displaying icons according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The embodiment of the invention provides a method for displaying an icon, and an execution main body of the method can be a mobile terminal. The terminal can be a mobile phone, a tablet computer and the like, the mobile terminal can be provided with a processor, a receiver and a memory, the processor can be used for processing relevant processing in the icon display process, the receiver and the transmitter can be used for receiving and sending messages, and the memory can be used for storing data required in the icon display process and generated data. The mobile terminal may further include an input/output device such as a screen for displaying an interface. The embodiment of the invention takes an execution subject as a mobile phone as an example, and the detailed description of the scheme is carried out.
Before implementation, first, an application scenario in the embodiment of the present invention is described, where when a user wants to use an application, the application may be installed in a mobile terminal, and then the application is opened by operation, the mobile terminal displays an interface of the application, and when an icon is displayed in the interface, the method in the embodiment of the present invention may be used. The icons in the interface may be some marks fixedly displayed in the interface, for example, as shown in fig. 1a, a Logo of an application program, an indicator (e.g., an indicator that there is no song in the song list), and the like.
Next, a process of creating a ttf font file corresponding to a target application program is introduced, first, SVG (Scalable Vector Graphics) pictures of all icons of the target application program are obtained, as shown in fig. 1b, each SVG picture is converted into a ttf font file, that is, the SVG picture is corresponding to a unicode (unified character coding standard) character, that is, a corresponding relationship between a unicode character and a Vector picture is stored in the ttf font file, for example, as shown in fig. 1b, an indication that there is no song in a song list in fig. 1a indicates that the corresponding unicode character is "weier". The ttf font file can be set in the installation package, and the ttf font file is directly stored after the target application program is installed on the mobile terminal. In addition, in the ttf font file, each unicode character has an initial font height, and an initial size of the corresponding vector picture, that is, the initial font height of the unicode character corresponds to the initial size of the vector picture, and the display size of the vector picture can be adjusted by subsequently adjusting the initial font height of the character, for example, for a certain unicode character, the initial font height is a, the initial size of the vector picture is b, the adjusted font height of the unicode character is a1, and the size of the vector picture is a1 × b/a.
Finally, how to use the ttf font file is introduced, when the code of the target interface of the target application program is written, the code for acquiring the vector picture corresponding to the icon can be written at the position of the icon of the target interface, so that the vector picture corresponding to the icon can be acquired when the icon is displayed subsequently, and then the vector picture is displayed at the position of the icon.
As shown in fig. 2, in the embodiment of the present invention, an icon in an interface for displaying a target application is taken as an example for description, and a processing flow of the method may be as follows:
step 201, obtaining the DPI of the screen.
Wherein DPI refers to the number of screen samples, displayable or output points per inch of length in the screen of the mobile terminal.
In implementation, a user wants to use a target application program, the target application program is any application program, for example, an instant messaging application program, an audio application program, and the like, the target application program can be installed on the mobile terminal, after the installation is completed, the mobile terminal can display an icon of the target application program, the user can click the icon of the target application program, the mobile terminal can receive an opening instruction of the target application program, the mobile terminal can display a main interface of the target application program, and the user can perform subsequent operations.
When the mobile terminal detects that a certain interface of the target application program is displayed, the mobile terminal may acquire the code of the interface, and if the interface includes an icon (which may be referred to as an icon to be displayed later), the mobile terminal may acquire a pre-stored DPI of a screen when executing the code of the icon to be displayed, where the DPI is 120, for example. For example, as shown in fig. 3, the target application is an audio application, and the icon to be displayed is a logo of the audio application.
Step 202, if the DPI is not equal to the preset value, a vector picture corresponding to the icon to be displayed is obtained from the preset ttf font file through the text rendering component.
The preset value may be preset by a technician, and stored in an installation package of the target application, and installed on the mobile terminal along with the installation package of the target application, where the preset value may be the size of the DPI of a general screen, such as 96.
In implementation, after the mobile terminal acquires the DPI of the screen, the size of the DPI and the preset value 96 can be judged, and if the DPI of the screen is not equal to the preset value 96, the mobile terminal can call the text rendering component to acquire the vector image corresponding to the icon to be displayed from the preset ttf font file.
In addition, if the DPI of the screen is equal to 96, the mobile terminal may also call a text rendering component, obtain a vector picture corresponding to the icon to be displayed from the preset ttf font file, and directly display the vector picture, thereby completing the display of the icon to be displayed.
In addition, if the DPI of the screen is equal to 96, the mobile terminal may also display the icon to be displayed in a manner of a double graph in the prior art.
Optionally, a vector picture corresponding to the icon may be obtained based on unicode characters, and corresponding processing may be as follows:
and acquiring a vector picture corresponding to the unicode character from a preset ttf font file according to the unicode character of the icon to be displayed.
The ttf font file comprises the corresponding relation between unicode characters and vector pictures.
In implementation, when the code of the interface of the target application program is written, the code at the position of the icon to be displayed executes a process of obtaining the vector picture of the unicode character, the mobile terminal can obtain the unicode character of the icon to be displayed, and then the vector picture corresponding to the unicode character is found from the corresponding relation between the unicode character and the vector picture of the ttf font file, so that the vector picture corresponding to the icon to be displayed is obtained.
And step 203, displaying the vector picture according to the DPI.
In implementation, after the mobile terminal acquires the vector picture corresponding to the icon, since the vector picture stored in the font file generally corresponds to a DPI equal to 96, the mobile terminal may adjust the size of the vector picture according to the DPI of the screen and display the adjusted vector picture.
Optionally, scaling processing may be performed on the vector picture, and the size of the vector picture is adjusted, and the corresponding processing in step 203 may be as follows:
and zooming the vector picture according to the DPI, and displaying the zoomed vector picture.
In implementation, after the mobile terminal acquires the vector picture corresponding to the icon, the size of the vector picture can be adjusted according to the DPI of the screen, the vector picture can be enlarged when the DPI of the screen is larger than a preset value, the vector picture can be reduced when the DPI of the screen is smaller than the preset value, and then the zoomed vector picture is displayed.
For example, when the DPI of the screen is larger than the preset value, the DPI of the screen is 120, the preset value is 96, the ratio of the DPI of the screen to the preset value is 5/4, the vector picture is enlarged by 5/4 times, and the vector picture is changed into the original 5/4. When the DPI of the screen is smaller than the preset value, the DPI of the screen is 90, the preset value is 96, the ratio of the DPI of the screen to the preset value is 15/16, the vector picture is reduced by 15/16 times, and the vector picture is changed into the original 15/16.
Optionally, the vector image may be displayed based on the font height of the unicode character of the icon, and the corresponding processing may be as follows:
determining the font height of unicode characters of icon icons to be displayed according to the DPI;
zooming the vector picture according to the font height;
and displaying the scaled vector picture.
In implementation, after the mobile terminal acquires the vector picture corresponding to the icon to be displayed, the mobile terminal may calculate a ratio of the DPI of the screen to a preset value, and adjust the font height of the unicode character of the icon to be displayed to be a product of the initial font height and the ratio.
And then multiplying the initial size of the vector picture by the obtained product to obtain the scaled size of the vector picture, then scaling the vector picture based on the scaled size of the vector picture, and displaying the scaled vector picture after the scaling is finished.
Optionally, when the vector picture of the icon to be displayed is displayed, a color may be added to the vector picture, and the corresponding processing may be as follows:
acquiring color information corresponding to an icon to be displayed;
and displaying the vector picture according to the DPI and the color information.
In implementation, when compiling the code of the icon to be displayed, the color information is compiled together, and the mobile terminal can acquire the color information of the icon to be displayed according to the code of the icon to be displayed.
Then the mobile terminal can adjust the size of the vector picture according to the DPI of the screen, or can perform amplification processing on the vector picture when the DPI of the screen is larger than a preset value, perform reduction processing on the vector picture when the DPI of the screen is smaller than the preset value, then display the scaled vector picture, and add corresponding colors to the vector picture when displaying.
In addition, if the DPI of the screen is equal to the preset value, the mobile terminal may directly display the vector picture and add a corresponding color to the vector picture (e.g., control the display color by controlling the current of the backlight of the mobile terminal, etc.).
In the embodiment of the invention, because the ttf font file is used, the vector picture can be arbitrarily amplified without blurring, so that only one ttf font file is stored to adapt to a high DPI screen without storing data of two icons, and the occupied storage resource is less. And various patterns are rendered through the character rendering component, so that the rendering efficiency is high.
Based on the same technical concept, an embodiment of the present invention further provides an icon display apparatus, where the apparatus is applied to a screen of a mobile terminal, and the mobile terminal includes a text rendering component, as shown in fig. 4, and the apparatus includes:
an obtaining module 410, configured to obtain dots per inch DPI of the screen; if the DPI is not equal to the preset value, acquiring a vector picture corresponding to the icon to be displayed from a preset ttf font file through the text rendering component,
and a display module 420, configured to display the vector picture according to the DPI.
Optionally, the obtaining module 410 is configured to:
and according to the unicode characters of the icon to be displayed, obtaining the vector picture corresponding to the unicode characters from the preset ttf font file.
Optionally, the display module 420 is configured to:
and zooming the vector picture according to the DPI, and displaying the zoomed vector picture.
Optionally, the display module 420 is configured to:
determining the font height of unicode characters of the icon to be displayed according to the DPI;
zooming the vector picture according to the font height;
and displaying the scaled vector picture.
Optionally, the obtaining module 410 is further configured to:
acquiring color information corresponding to the icon to be displayed;
the display module 420 is configured to:
and displaying the vector picture according to the color information.
In the embodiment of the invention, because the ttf font file is used, the vector picture can be arbitrarily amplified without blurring, so that only one ttf font file is stored to adapt to a high DPI screen without storing data of two icons, and the occupied storage resource is less. And various patterns are rendered through the character rendering component, so that the rendering efficiency is high.
It should be noted that: in the device for displaying icons provided in the above embodiment, only the division of the above functional modules is used for illustration when displaying icons, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus for displaying icons and the method for displaying icons provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a block diagram illustrating a mobile terminal 500 according to an exemplary embodiment of the present invention. The mobile terminal 500 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The mobile terminal 500 may also be referred to by other names such as user equipment, portable mobile terminal, laptop mobile terminal, desktop mobile terminal, and the like.
In general, the mobile terminal 500 includes: a processor 501 and a memory 502.
The processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 501 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one instruction for execution by processor 501 to implement the method of displaying icons provided by the method embodiments herein.
In some embodiments, the mobile terminal 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502 and peripheral interface 503 may be connected by a bus or signal lines. Various peripheral devices may be connected to the peripheral interface 503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, touch screen display 505, camera 506, audio circuitry 507, positioning components 508, and power supply 509.
The peripheral interface 503 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 501 and the memory 502. In some embodiments, the processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 501, the memory 502, and the peripheral interface 503 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 504 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 504 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 504 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 504 may communicate with other mobile terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 504 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 505 is a touch display screen, the display screen 505 also has the ability to capture touch signals on or over the surface of the display screen 505. The touch signal may be input to the processor 501 as a control signal for processing. At this point, the display screen 505 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 505 may be one, providing a front panel of the mobile terminal 500; in other embodiments, the display screens 505 may be at least two, respectively disposed on different surfaces of the mobile terminal 500 or in a folded design; in still other embodiments, the display 505 may be a flexible display disposed on a curved surface or on a folded surface of the mobile terminal 500. Even more, the display screen 505 can be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 505 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 506 is used to capture images or video. Optionally, camera assembly 506 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of a mobile terminal, and a rear camera is disposed at a rear surface of the mobile terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera head assembly 506 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp and can be used for light compensation under different color temperatures.
Audio circuitry 507 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 501 for processing, or inputting the electric signals to the radio frequency circuit 504 to realize voice communication. The microphones may be provided in plural numbers, respectively, at different portions of the mobile terminal 500 for the purpose of stereo sound collection or noise reduction. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 507 may also include a headphone jack.
The positioning component 508 is used to locate the current geographic Location of the mobile terminal 500 for navigation or LBS (Location Based Service). The Positioning component 508 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, the grignard System in russia, or the galileo System in the european union.
A power supply 509 is used to power the various components within mobile terminal 500. The power source 509 may be alternating current, direct current, disposable or rechargeable. When power supply 509 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the mobile terminal 500 also includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: acceleration sensor 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514, optical sensor 515, and proximity sensor 516.
The acceleration sensor 511 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the mobile terminal 500. For example, the acceleration sensor 511 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 501 may control the touch screen 505 to display the user interface in a landscape view or a portrait view according to the acceleration signal of gravity collected by the acceleration sensor 511. The acceleration sensor 511 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 512 may detect a body direction and a rotation angle of the mobile terminal 500, and the gyro sensor 512 may cooperate with the acceleration sensor 511 to acquire a 3D motion of the user on the mobile terminal 500. The processor 501 may implement the following functions according to the data collected by the gyro sensor 512: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization while shooting, game control, and inertial navigation.
The pressure sensor 513 may be disposed on a side bezel of the mobile terminal 500 and/or an underlying layer of the touch display screen 505. When the pressure sensor 513 is disposed on the side frame of the mobile terminal 500, the holding signal of the user to the mobile terminal 500 may be detected, and the processor 501 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 513. When the pressure sensor 513 is disposed at the lower layer of the touch display screen 505, the processor 501 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 505. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 514 is used for collecting a fingerprint of the user, and the processor 501 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 514, or the fingerprint sensor 514 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 501 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 514 may be disposed on the front, back, or side of the mobile terminal 500. When a physical key or a vendor Logo is provided on the mobile terminal 500, the fingerprint sensor 514 may be integrated with the physical key or the vendor Logo.
The optical sensor 515 is used to collect the ambient light intensity. In one embodiment, the processor 501 may control the display brightness of the touch display screen 505 based on the ambient light intensity collected by the optical sensor 515. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 505 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 505 is turned down. In another embodiment, processor 501 may also dynamically adjust the shooting parameters of camera head assembly 506 based on the ambient light intensity collected by optical sensor 515.
A proximity sensor 516, also called a distance sensor, is generally disposed at the front panel of the mobile terminal 500. The proximity sensor 516 serves to collect a distance between the user and the front surface of the mobile terminal 500. In one embodiment, when the proximity sensor 516 detects that the distance between the user and the front surface of the mobile terminal 500 gradually decreases, the processor 501 controls the touch display screen 505 to switch from the bright screen state to the dark screen state; when the proximity sensor 516 detects that the distance between the user and the front surface of the mobile terminal 500 becomes gradually larger, the processor 501 controls the touch display screen 505 to switch from the screen-on state to the screen-on state.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is not intended to be limiting of the mobile terminal 500 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (4)

1. A method of displaying an icon, the method being applied to a screen of a mobile terminal, the mobile terminal including a text rendering component, the method comprising:
acquiring the number of DPI points per inch of the screen;
if the DPI is not equal to a preset value, obtaining a vector picture corresponding to an icon to be displayed from a preset ttf font file through the character rendering component, wherein the preset value is stored in an installation package of a target application program, the icon to be displayed is an icon in an interface of the target application program, and the ttf font file stores a corresponding relation between the vector picture of the icon in the target application program and unicode characters;
determining the font height of the unicode characters of the icon to be displayed according to the DPI and the preset value, wherein the determination comprises the following steps: calculating the ratio of the DPI to the preset value, and adjusting the font height of the unicode characters of the icon to be displayed to be the product of the initial font height and the ratio;
zooming the vector picture according to the font height;
displaying the zoomed vector picture;
if the DPI is equal to the preset value, acquiring a vector picture corresponding to the icon to be displayed, and directly displaying the vector picture corresponding to the icon to be displayed;
the method for acquiring the vector picture corresponding to the icon to be displayed from the preset ttf font file comprises the following steps:
according to the unicode characters of the icon to be displayed, obtaining a vector picture corresponding to the unicode characters from the preset ttf font file;
in the codes of the interface of the target application program, the code at the position of the icon is a code for executing obtaining of the vector picture corresponding to the icon, and after the vector picture corresponding to the icon is obtained, the vector picture corresponding to the icon is displayed at the position of the icon;
when compiling the code of the icon to be displayed, compiling color information, and acquiring the color information of the icon to be displayed by the mobile terminal according to the code of the icon to be displayed.
2. The method of claim 1, further comprising:
acquiring color information corresponding to the icon to be displayed;
displaying the vector picture, including:
and displaying the vector picture according to the color information.
3. An apparatus for displaying an icon, wherein the apparatus is applied to a screen of a mobile terminal, wherein the mobile terminal comprises a text rendering component, the apparatus comprising:
the acquisition module is used for acquiring DPI (dot per inch) of the screen; if the DPI is not equal to a preset value, obtaining a vector picture corresponding to an icon to be displayed from a preset ttf font file through the character rendering component, wherein the preset value is stored in an installation package of a target application program, the icon to be displayed is an icon in an interface of the target application program, and the ttf font file stores a corresponding relation between the vector picture of the icon in the target application program and unicode characters;
the display module is used for determining the font height of the unicode characters of the icon to be displayed according to the DPI and the preset value; zooming the vector picture according to the font height; displaying the zoomed vector picture; determining the font height of the unicode characters of the icon to be displayed according to the DPI and the preset value, wherein the determining comprises the following steps: calculating the ratio of the DPI to the preset value, and adjusting the font height of the unicode characters of the icon to be displayed to be the product of the initial font height and the ratio;
the obtaining module is further configured to obtain a vector picture corresponding to the icon to be displayed if the DPI is equal to the preset value;
the display module is further configured to directly display the vector picture corresponding to the icon to be displayed, which is acquired by the acquisition module, if the DPI is equal to the preset value;
the obtaining module is configured to: according to the unicode characters of the icon to be displayed, obtaining a vector picture corresponding to the unicode characters from the preset ttf font file;
in the codes of the interface of the target application program, the codes at the positions of the icons are codes for executing and acquiring vector pictures corresponding to the icons, and after the vector pictures corresponding to the icons are acquired, the vector pictures corresponding to the icons are displayed at the positions of the icons;
when compiling the code of the icon to be displayed, compiling color information, and acquiring the color information of the icon to be displayed by the mobile terminal according to the code of the icon to be displayed.
4. The apparatus of claim 3, wherein the obtaining module is further configured to:
acquiring color information corresponding to the icon to be displayed;
the display module is used for:
and displaying the vector picture according to the color information.
CN201810526490.7A 2018-05-21 2018-05-21 Method and device for displaying icons Active CN108734662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810526490.7A CN108734662B (en) 2018-05-21 2018-05-21 Method and device for displaying icons

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810526490.7A CN108734662B (en) 2018-05-21 2018-05-21 Method and device for displaying icons

Publications (2)

Publication Number Publication Date
CN108734662A CN108734662A (en) 2018-11-02
CN108734662B true CN108734662B (en) 2023-02-28

Family

ID=63936517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810526490.7A Active CN108734662B (en) 2018-05-21 2018-05-21 Method and device for displaying icons

Country Status (1)

Country Link
CN (1) CN108734662B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111507067A (en) * 2019-01-31 2020-08-07 北京易真学思教育科技有限公司 Acquisition method for displaying formula picture, and method and device for transferring formula picture
CN109803126A (en) * 2019-02-22 2019-05-24 重庆紫光华山智安科技有限公司 Control method, control terminal and Multi-screen display system for multihead display
CN112817667A (en) * 2019-11-18 2021-05-18 青岛海信移动通信技术股份有限公司 Terminal and control icon display method
CN113360113B (en) * 2021-05-24 2022-07-19 中国电子科技集团公司第四十一研究所 System and method for dynamically adjusting character display width based on OLED screen

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978183A (en) * 2015-01-22 2015-10-14 腾讯科技(深圳)有限公司 Icon construction method, and terminal equipment
CN106055295A (en) * 2016-05-24 2016-10-26 腾讯科技(深圳)有限公司 Picture processing method and device, and picture drawing method and device
CN106383689A (en) * 2016-09-20 2017-02-08 青岛海信电器股份有限公司 Display font size adjustment method and apparatus, and terminal device
AU2015384100A1 (en) * 2015-02-26 2017-09-28 Huawei Technologies Co., Ltd. DPI adaptation method and electronic device
CN107301046A (en) * 2017-06-15 2017-10-27 腾讯科技(深圳)有限公司 Treating method and apparatus, computer equipment and the storage medium of icon
CN107704615A (en) * 2017-10-24 2018-02-16 北京有字库网络科技有限公司 Webpage font display methods and system based on Chinese font subset

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104978183A (en) * 2015-01-22 2015-10-14 腾讯科技(深圳)有限公司 Icon construction method, and terminal equipment
AU2015384100A1 (en) * 2015-02-26 2017-09-28 Huawei Technologies Co., Ltd. DPI adaptation method and electronic device
CN106055295A (en) * 2016-05-24 2016-10-26 腾讯科技(深圳)有限公司 Picture processing method and device, and picture drawing method and device
CN106383689A (en) * 2016-09-20 2017-02-08 青岛海信电器股份有限公司 Display font size adjustment method and apparatus, and terminal device
CN107301046A (en) * 2017-06-15 2017-10-27 腾讯科技(深圳)有限公司 Treating method and apparatus, computer equipment and the storage medium of icon
CN107704615A (en) * 2017-10-24 2018-02-16 北京有字库网络科技有限公司 Webpage font display methods and system based on Chinese font subset

Also Published As

Publication number Publication date
CN108734662A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
CN108449641B (en) Method, device, computer equipment and storage medium for playing media stream
CN110308956B (en) Application interface display method and device and mobile terminal
CN110944374B (en) Communication mode selection method and device, electronic equipment and medium
CN110602321A (en) Application program switching method and device, electronic device and storage medium
CN108734662B (en) Method and device for displaying icons
CN110362366B (en) Application interface display method and device
CN110288689B (en) Method and device for rendering electronic map
CN108845777B (en) Method and device for playing frame animation
CN110839174A (en) Image processing method and device, computer equipment and storage medium
CN109783176B (en) Page switching method and device
CN109614563B (en) Method, device and equipment for displaying webpage and storage medium
CN110769120A (en) Method, device, equipment and storage medium for message reminding
CN108664300B (en) Application interface display method and device in picture-in-picture mode
CN111083554A (en) Method and device for displaying live gift
CN107943484B (en) Method and device for executing business function
CN109033473B (en) Picture sharing method and device and computer readable storage medium
CN111275607A (en) Interface display method and device, computer equipment and storage medium
CN111370096A (en) Interactive interface display method, device, equipment and storage medium
CN111158575A (en) Method, device and equipment for terminal to execute processing and storage medium
CN111464829B (en) Method, device and equipment for switching media data and storage medium
CN110996115A (en) Live video playing method, device, equipment, storage medium and program product
CN112732133A (en) Message processing method and device, electronic equipment and storage medium
CN110045999B (en) Method, device, terminal and storage medium for drawing assembly
CN113345478B (en) Player time acquisition method, device, storage medium and player
CN113064537B (en) Media resource playing method, device, equipment, medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant