Font processing method, device and equipment and storage medium

By compiling and mapping desktop font files to a virtual file system, the issue of inconsistent fonts between desktop and web versions is resolved, improving user interface consistency and user experience, and enabling flexible file access.

CN119598970BActive Publication Date: 2025-12-16SHENZHEN FUTU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411404026.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-12-16
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

The desktop and web versions of the same application may have inconsistent fonts due to different operating systems, which affects the consistency of user interface design and display effect, and reduces user experience.

Method used

By compiling the UI function code files of the desktop font files, the web-side font files stored in the local file system are obtained and mapped to the virtual file system, ensuring that the web-side version can load the same font and achieving consistency in user interface design.

Benefits of technology

Ensure that the desktop and web versions load the same fonts to improve the user interface display and user experience, while enabling legal and flexible file access methods through a virtual file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598970B_ABST
    Figure CN119598970B_ABST
Patent Text Reader

Abstract

The application provides a font processing method, device and equipment and a storage medium, including: obtaining an interface function code file of a target application program of a desktop version, the interface function code file including a desktop font file; determining a packaging mode and a target path mapping relationship between a target source storage path of a local file system and a target virtual storage path of a virtual file system; compiling the interface function code file according to the packaging mode to generate a webpage other code file and a webpage font file stored in the target source storage path; loading the webpage font file to the virtual file system according to the webpage other code file and the target path mapping relationship; and in response to an access request for the target application program of the webpage version, accessing and rendering a user interface of the target application program of the webpage version based on the webpage font file in the virtual file system. The same application of the desktop version and the webpage version can load consistent fonts, and the interface display effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly, to a font processing method and device, equipment and storage medium. BACKGROUND

[0002] An application program, simply referred to as an application, can include multiple versions according to different running environments or running modes. For example, a version of the same application generally includes a desktop version and a web version, that is, the same application generally includes a desktop application and a client application. The desktop application refers to an application directly installed on a user's computer or the like. The web application (or referred to as the Web application) is an application that presents a user interface and content through a browser.

[0003] The desktop application and the client application generally have the same or corresponding functions. For example, the desktop version and the web version of the same application generally have similar or consistent styles in user interface (UI) design. However, the desktop application and the client application can run on different systems, and generally load the system font of the system by default. Therefore, it is impossible to ensure that the loaded fonts are consistent, and it is impossible to ensure that the user interface design has a consistent style, thereby resulting in poor interface display effect and affecting user experience. SUMMARY

[0004] The present application provides a font processing method, device, equipment and storage medium, which can ensure that the desktop version and the web version of the same application can load consistent fonts and have consistent user interface design styles, and can improve the interface display effect and user experience.

[0005] In a first aspect, the present application provides a font processing method, which includes: obtaining an interface function code file of a target application program of a desktop version, the interface function code file including a desktop font file; determining a packaging mode corresponding to the desktop font file and a target path mapping relationship between a target source storage path of a local file system and a target virtual storage path of a virtual file system; compiling the interface function code file according to the packaging mode to generate a web font file stored in the target source storage path and other web code files; loading the web font file in the local file system into the virtual file system according to the other web code files and the target path mapping relationship; and in response to an access request for the target application program of the web version, accessing the web font file in the virtual file system and rendering a user interface of the target application program of the web version based on the web font file.

[0006] In a second aspect, the present application provides a font processing apparatus, comprising: a first obtaining module, configured to obtain an interface function code file of a target application program in a desktop version, the interface function code file comprising a desktop font file; a first determining module, configured to determine a packaging manner corresponding to the desktop font file and a target path mapping relationship between a target source storage path of a local file system and a target virtual storage path of a virtual file system; a file compiling module, configured to compile the interface function code file according to the packaging manner, to generate a webpage font file stored in the target source storage path and other webpage code files; a file loading module, configured to load the webpage font file in the local file system into the virtual file system according to the other webpage code files and the target path mapping relationship; and an access and rendering module, configured to, in response to an access request for the target application program in a webpage version, access the webpage font file in the virtual file system, and render a user interface of the target application program in the webpage version based on the webpage font file.

[0007] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, the memory being configured to store a computer program, and the processor being configured to invoke and run the computer program stored in the memory to execute the method in the first aspect or the implementations thereof.

[0008] In a fourth aspect, the present application provides a computer readable storage medium, configured to store a computer program, and the computer program causes a computer to execute the method in the first aspect or the implementations thereof.

[0009] In a fifth aspect, the present application provides a computer program product, comprising computer program instructions, and the computer program instructions cause a computer to execute the method in the first aspect or the implementations thereof.

[0010] In a sixth aspect, the present application provides a computer program, and the computer program causes a computer to execute the method in the first aspect or the implementations thereof.

[0011] By the technical scheme, the electronic device can obtain the web font file stored in the local file system through compiling the interface function code file including the desktop font file, and then ensure that the respective fonts of the web font file and the desktop font file are consistent, thereby ensuring that the loaded fonts of the target application program in the desktop version and the target application program in the web version are consistent, ensuring that the user interface design has a consistent style on the multi-end version, improving the interface display effect and user experience; and since the web end cannot directly access the local file system due to security and privacy considerations, the electronic device further maps the web font file of the local file system to a virtual file system, so that the user interface of the target application program in the web version can be rendered based on the web font file in the virtual file system, and a legal and flexible file access mode is realized. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0013] Figure 1 An application scenario diagram provided for the embodiments of the present application;

[0014] Figure 2 A flowchart of a font processing method provided for the embodiments of the present application;

[0015] Figure 3 A schematic diagram of a font processing method provided for the embodiments of the present application;

[0016] Figure 4 A schematic diagram of another font processing method provided for the embodiments of the present application;

[0017] Figure 5 A schematic diagram of still another font processing method provided for the embodiments of the present application;

[0018] Figure 6 A schematic diagram of a font processing device 600 provided for the embodiments of the present application;

[0019] Figure 7 A schematic block diagram of an electronic device 700 provided for the embodiments of the present application. DETAILED DESCRIPTION

[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and in the above description are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0021] As described above, due to the different systems running the desktop application and the client application under the same application program, the related art has the problem that the fonts loaded by the desktop application and the client application are inconsistent, thereby causing inconsistent user interface design and poor display effect, affecting the user experience.

[0022] To solve the above technical problems, the inventive concept of the present application is to obtain a web-end font file stored in a local file system by compiling an interface function code file including a desktop font file; map the web-end font file of the local file system to a virtual file system; and render a user interface of a target application program in a web version based on the web-end font file in the virtual file system.

[0023] It should be understood that the technical solution of the present application can be applied to the following scenarios, but is not limited to:

[0024] In one embodiment, the present application can be applied to the development or user interface display scenarios of an application program, and can be applied to the following scenarios in particular: the development of a user interface of a web-end version of an application program, or the display of fonts in a user interface of a web-end version of an application program.

[0025] In one embodiment, as shown in Figure 1 The application scenario can include a terminal device 110 and a server 120, and the terminal device 110 and the server 120 can be connected through a wired network or a wireless network.

[0026] For example, the browser on the terminal device 110 can start a desktop version of the target application, the server 120 can obtain an interface function code file of the desktop version of the target application, the interface function code file including a desktop font file, and obtain a web page font file stored in a local file system by compiling the interface function code file; the web page font file in the local file system is mapped to a virtual file system; then, the server 120 can access the web page font file in the virtual file system in response to an access request for a web page version of the target application, and control the terminal device 110 to render a user interface of the web page version of the target application based on the web page font file obtained by the above-mentioned access.

[0027] The server 120 can be a server, a server cluster composed of multiple servers, or a cloud platform control center, but is not limited thereto. The terminal device 110 can be a mobile phone, a tablet computer, a notebook computer, or a desktop computer, but is not limited thereto.

[0028] It should be noted that, Figure 1 The terminal device and the server in the above-mentioned application scenario are only exemplary, and other numbers or types of terminal devices or servers can also be included.

[0029] In addition, the technical solution of the present application can also be executed only by the terminal device, and the present application will not be repeated here.

[0030] After introducing the application scenarios of the embodiments of the present application, the technical solution of the present application will be described in detail as follows:

[0031] Figure 2 A flowchart of a font processing method provided by the embodiments of the present application, which can be executed by the terminal device 110 or the server 120 in the above-mentioned application scenario, but is not limited thereto. As shown in Figure 2 The method can include the following steps:

[0032] S210: Obtain an interface function code file of a desktop version of the target application, the interface function code file including a desktop font file;

[0033] S220: Determine a packaging mode corresponding to the desktop font file and a target path mapping relationship between a target source storage path of the local file system and a target virtual storage path of the virtual file system;

[0034] S230: Compile the interface function code file according to the packaging mode to generate a web page other code file and a web page font file stored in the target source storage path;

[0035] S240: loading the web-end font file in the local file system into the virtual file system according to the mapping relationship between the other code files of the web-end and the target path;

[0036] S250: in response to an access request for the target application program of the web-end version, accessing the web-end font file in the virtual file system, and rendering the user interface of the target application program of the web-end version based on the web-end font file.

[0037] The interface function code file refers to a code file used to define and implement the user interface related functions of the target application program of the desktop-end version. The user interface related functions can be functions related to the interaction or display of the user interface (User Interface, UI), but are not limited thereto. For example, it can be a function related to the font used for displaying the text font, drawing charts, etc. on the user interface.

[0038] Specifically, the interface function code file can include a desktop-end font file. The desktop-end font file refers to a file used to display the font required to be displayed on the user interface of the target application program, and can include specific resources required by the target application program to load the font on the user interface, for example, specific resource information used to specify the shape, size and style (bold, italic, etc.) of the font. The target application program of the desktop-end version can render the user interface according to the desktop-end font file to display various text, chart or image content.

[0039] The desktop-end can be a desktop-end running on a Windows, Mac, Linux, etc. system, but is not limited thereto.

[0040] The programming language used to develop the above interface function code file can be C language, C++ language, Rust language, but is not limited thereto.

[0041] The desktop-end font file can be a file related to the local custom font of the target application program of the desktop-end version.

[0042] In one embodiment, the electronic device can first determine all code files of the target application program of the desktop-end version; then, the interface function code file can be located in the all code files through a command line tool; finally, the interface function code file can be extracted directly from the all code files (for example, the interface function code file is directly copied from the all code files), so that the interface function code file can be obtained.

[0043] Specifically, the electronic device can first determine the file name, file type, string or function involved in the interface function code file; then take the above file name, file type, string or function as the search parameter of the command line tool; and then the interface function code file can be located in all code files through the above command line tool with the search parameter.

[0044] The command line tool includes but is not limited to find command, locate command and grep command.

[0045] It should be noted that, for security and privacy considerations, the web side generally cannot directly access the local file system, and the web side font file determined according to the interface function code file is generally generated in the local file system (for example, the generated web side font file is stored in the target source storage path of the local file system by default), therefore, the electronic device needs to determine the virtual file system in advance, and store the generated web side font file in the virtual file system, and then the web side can normally access the web side font file through the virtual file system.

[0046] In addition, the electronic device can package the desktop font file before storing the web side font file in the virtual file system, so as to reduce the file size and simplify the resource management, and also facilitate the obtained web side font file to be loaded / run in the web side, that is, better compatibility with the corresponding loading / run system of the web side.

[0047] The packaging and compiling of the desktop font file and the virtual file system will be introduced in the following embodiments:

[0048] In one embodiment, the packaging mode corresponding to the desktop font file includes two modes: asynchronous packaging mode (preload mode) and synchronous packaging mode (embed mode).

[0049] The asynchronous packaging mode means that the web side other code file and the web side font file are packaged independently, that is, the obtained web side other code file and the web side font file are independent and separate, so that the size of the obtained web side other code file is smaller, which is convenient for subsequent loading of the web side font file according to the web side other code file.

[0050] The synchronous packaging mode means that the web side font file is embedded in the web side other code file during the packaging process, that is, the obtained web side other code file and the web side font file are contained in one file, so that the size of the obtained web side other code file is larger, which is not convenient for subsequent loading of the web side font file according to the web side other code file.

[0051] Therefore, the electronic device can determine the web-side other code file and the web-side font file according to the asynchronous packaging manner, so as to reduce the file size of the generated web-side other code file, facilitate the subsequent loading process of the web-side font file, and improve the loading speed and efficiency. Of course, the web-side other code file and the web-side font file can also be determined according to the synchronous packaging manner, and the present application does not limit this.

[0052] In an embodiment, the electronic device can package the interface function code file during the compilation of the interface function file; or the electronic device can separate the compilation and packaging, for example, the electronic device can package the compiled file (for example, the web-side other code file and the web-side font file) after compiling the interface function code file. The present application does not limit the order of packaging and compilation.

[0053] For example, the electronic device can use a compiler to compile the interface function code file. Specifically, the compiler can be a compiler based on Wasm technology. For example, it can be a compiler based on Emscripten SDK, or it can also be Binaryen tool chain, WasmEdge, etc., but is not limited thereto.

[0054] In this embodiment, the electronic device can compile and package the interface function code file according to the compiler based on Emscripten SDK.

[0055] In addition, the electronic device can also use an automated build system to control the compilation process to achieve more efficient compilation. For example, the automated build system can be a CMake system, but is not limited thereto. The electronic device can use a configuration file to control the compilation of the interface function code file through the automated build system, for example, it can achieve the engineering configuration of different platforms through the conditional compilation provided by the CMake system, so as to realize as much code reuse as possible.

[0056] In this embodiment, the automated build system used to control the process of compiling the interface function code file can be the automated build system used when compiling the desktop version of the target application, so as to improve the compatibility and controllability of the compilation process and the code file generated by the compilation.

[0057] For example, for the mode of separating the compilation and the packaging, the electronic device can use a separate packaging script to package the file after compiling the interface function code file. Specifically, the packaging script can be a script tool in Emscripten SDK, and specifically can be file_packager.py, but is not limited thereto.

[0058] In an embodiment, the virtual file system is a file system that does not actually exist, and is a virtual file system whose directory structure and storage path are also virtual. Among them, the path level of the virtual file system is consistent with the path level of the local file system.

[0059] For example, the virtual file system can be a MEMFS (Memory File System), which is a virtual file system provided by Emscripten, which allows files to be stored in memory rather than directly on the hard disk, thus facilitating the simulation of file input and output in a web environment, i.e., a web page.

[0060] In addition, the virtual file system can also be a proc file system or an NFS (Network File System), but is not limited thereto.

[0061] In an embodiment, after the electronic device determines the web font file, it can generate a target virtual storage path of the virtual file system for subsequent storage of the web font file, wherein the path level of the target virtual storage path is consistent with the path level of the target source storage path.

[0062] It should be noted that the present application will introduce the storage path mapping between the virtual file system and the local file system and the target path mapping relationship between the target source storage path and the target virtual storage path in subsequent embodiments. To avoid repetition, the present application will not be described here.

[0063] In an embodiment, in combination with the above embodiment, the electronic device can control the compilation process through an automated build system (e.g., CMake compilation) and package during the compilation process, which will be introduced in the following embodiments:

[0064] Specifically, the above compilation of the interface function code file according to the packaging mode to generate the web other code file and the web font file stored in the target source storage path can include the following steps:

[0065] S230-1, constructing a compilation parameter according to the packaging mode and the target path mapping relationship.

[0066] Among them, the compilation parameter refers to a parameter for controlling the compilation process of the interface function code file of the desktop application. Specifically, after obtaining the packaging mode and the target path mapping relationship, a corresponding packaging tag can be generated based on the packaging mode, and the target virtual storage path can be determined according to the target path mapping relationship, and then the compilation parameter can be constructed according to the packaging tag and the target virtual storage path.

[0067] Among them, the packaging tag is a tag used to uniquely identify the packaging method. For example, if the packaging method is asynchronous, the packaging tag can be "--preload-file"; if the packaging method is synchronous, the packaging tag can be "--embed-file".

[0068] The target path mapping relationship can include the target virtual storage path and the mapping symbol. The mapping symbol is a symbol used to identify the step of mapping the source storage path of the local file system to the virtual storage path of the virtual file system. For example, the mapping symbol can be "@ / ". The target virtual storage path can refer to a specific level of the virtual directory of the virtual file system.

[0069] When constructing compilation parameters based on the packaging tag and the target virtual memory path, the packaging tag, the target virtual memory path, and the mapping symbol can be combined, or the packaging tag and the target virtual memory path can be combined to obtain the compilation parameters.

[0070] Specifically, assuming the packaging method is asynchronous, the target path mapping relationship includes: the specific level of the virtual directory to be mapped to the virtual file system (i.e., the target virtual storage path) and the mapping symbol. Then the compilation parameter can be: --preload-file.. / .. / .. / .. / fonts@ / , where "--preload-file" indicates that the packaging method is asynchronous; ".. / .. / .. / .. / fonts@ / " represents the target path mapping relationship; ".. / .. / .. / .. / fonts" represents the target virtual storage path; "@ / " is the mapping symbol, indicating that the source storage path of the local file system needs to be mapped to the virtual file system, and the " / " in "@ / " represents the default root directory of the virtual file system at runtime.

[0071] The target virtual storage path can be represented by a relative path. Specifically, the initial path on which the relative path is based can be the path where the script files generated by any project after compilation by the automated build system are located. For example, the initial path on which it is based can be the path where the Makefile files generated by different projects after compilation with cmake are located.

[0072] For example, such as Figure 3 As shown, assuming the generated web page font files need to be mapped and stored in the fonts folder, that is, the target virtual storage path is the path corresponding to the fonts folder; the Makefile file is located in the path "M / Src / build / FTMain / MainApp", combined with... Figure 3It can be known that the folder where the Makefile file is located has the fonts folder four layers up, so it can be determined that the target virtual storage path represented by the relative path is: “.. / .. / .. / .. / fonts”.

[0073] In S230-2, the compiling parameter is configured in the project configuration file corresponding to the interface function code file through a parameter configuration command.

[0074] Specifically, in combination with the above content, the project configuration file can be a configuration file in a CMake compilation configuration file named “CMakeLists.txt” that can generate an executable file, which is a file for controlling the compilation of the interface function code file.

[0075] Correspondingly, the parameter configuration command can be: target_link_libraries(). The compiling parameter is configured in the project configuration file corresponding to the interface function code file through the parameter configuration command, and specifically can be:

[0076] The following code is added to the project configuration file: target_link_libraries(${PROJECT_NAME}PUBLIC“--preload-file.. / .. / .. / .. / fonts@ / ”).

[0077] In S230-3, in response to the packaging mode being an asynchronous packaging mode, the compilation of the interface function code file is controlled through the project configuration file, and the web-side other code files packaged independently of each other and the web-side font files stored in the target source storage path are generated.

[0078] Correspondingly, in combination with the above content, the compilation of the interface function code file is controlled through the project configuration file, specifically, the compilation of the interface function code file is controlled through the above-mentioned added code, that is, the operation control of the project configuration file by the parameter configuration command, and specifically, the compilation is controlled to be packaged according to the asynchronous packaging mode in the compilation process, and the web-side other code files packaged independently of each other and the web-side font files stored in the target source storage path are generated.

[0079] After that, the process of automatically mapping the web-side font files stored in the target source storage path to the target virtual storage path of the virtual file system can also be controlled, and the storage and mapping process of the web-side font files will be introduced in subsequent embodiments.

[0080] In one embodiment, the web-side other code files can include: a web script file, a glue layer code file.

[0081] The webpage script file includes a tag for referencing the glue layer code file, and the glue layer code file can be loaded and executed through the tag to realize automatic execution of the glue layer code file. Specifically, the webpage script file can be text.html.

[0082] The glue layer code file is used to load the webpage font file, can trigger the loading interface of the virtual file system to load the webpage font file in the local file system into the virtual file system, and in addition, the glue layer code file can also “glue” different components or layers in the webpage font file together to ensure that different components or layers can run smoothly and stably in the webpage. Specifically, the glue layer code file can be test.js.

[0083] In addition, the webpage code file can also include a test.wasm file, which is a binary file generated by compiling the interface function code file using Emscripten.

[0084] In one embodiment, as shown in Figure 4 The above loading of the webpage font file in the local file system into the virtual file system according to the mapping relationship between the webpage other code file and the target path can include the following steps:

[0085] S240-1 running a webpage script file;

[0086] S240-2 loading and executing a glue layer code file through a tag in the webpage script file for referencing the glue layer code file;

[0087] The webpage script file can include the above-mentioned tag for referencing the glue layer code file, and if the webpage script file is run and parsed to the tag, the glue layer code file can be automatically loaded and executed in response to the parsing of the tag.

[0088] S240-3 triggering a loading interface of a virtual file system through the glue layer code file;

[0089] As shown in Figure 4 The loading interface can be FS.createPreloadedFile.

[0090] Specifically, the glue layer code file can include a call to the loading interface of the virtual file system, which can operate the virtual file system, for example, can realize input and output (i.e. read or write data from the virtual file system) of the virtual file system.

[0091] S240-4 loads web page font files from the local file system into the virtual file system by loading the interface and the target path mapping relationship.

[0092] Among them, such as Figure 4 As shown, the web-side font file can be a test.data file. It's understandable that by controlling the compilation of the interface function code files through the project configuration file, the desktop font file from the interface function code files is saved to a web-side font file (e.g., a .data file), and the file path of the font file is mapped to the target source storage path.

[0093] Specifically, in conjunction with the above embodiments, the electronic device can control S240-4 through the engineering configuration file to complete the storage path mapping for web page font files, realize the connection between the web page and the local file system, and enable the web page to use resources stored in the local file system through the virtual file system, such as web page font files, thereby improving user experience and web page performance.

[0094] It is understandable that before accessing the web-side font files in the virtual file system, i.e., before executing S250, the electronic device can first determine the function conversion relationship between the file system and the font files (e.g., the function conversion relationship between the file operation functions corresponding to the desktop font files and the web-side font files in the virtual file system) and the path mapping relationship between the virtual file system and the local file system (including but not limited to: the target path mapping relationship between the target source storage path of the local file system and the target virtual storage path of the virtual file system, i.e., the target path mapping relationship in S220 above). Therefore, when accessing the virtual file system later, it can be accessed directly according to the file operation functions and source storage paths used when accessing the local file system. This application can automatically convert them into the file operation functions and virtual storage paths corresponding to the virtual file system according to the function conversion relationship and path mapping relationship, and access the virtual file system, thereby achieving the same effect as directly accessing the local file system, improving access efficiency and user experience.

[0095] In addition, various operations on the virtual file system can be implemented, such as obtaining file paths, reading files, and writing files in the virtual file system. Thus, the web page font file can be mapped and stored (i.e. loaded) into the virtual file system, i.e., the above-mentioned S240 is executed.

[0096] Specifically, electronic devices can determine function conversion relationships and path mapping relationships during the compilation of interface function code files, and this application does not impose any restrictions on this.

[0097] The following section describes the function conversion relationships of file operation functions and the path mapping relationships of storage paths:

[0098] In one embodiment, the electronic device can first obtain desktop file operation functions for desktop font files; then, it can convert the desktop file operation functions into web-based file operation functions for interacting with the virtual file system, thus obtaining the function conversion relationship; finally, it can define the web-based file operation functions in the function library of the virtual file system to access the virtual file system through the function library.

[0099] Among them, the web-based file operation functions can achieve similar effects to accessing the local text system through the desktop-based file operation functions by calling the corresponding interfaces in the virtual file system, such as opening, reading, or writing files.

[0100] For example, in combination Figure 5 Assuming the desktop font file is a C / C++ file, electronic devices can use desktop file operation functions to call the desktop font file operation interface to operate the desktop font file. The desktop file operation functions can include: fopen, fread, and fwrite. "fopen" is used to open the file, "fread" is used to read the file or the data in the file, and "fwrite" is used to write to the file or write data to the file.

[0101] Specifically, "fopen", "fread", and "fwrite" can be converted into web-based file operation functions for interacting with the virtual file system: the open function, the read function, and the write function. The "open function" can call the FS.open interface of the virtual file system to open files in the virtual file system, or create file streams such as FS.createStream, or obtain file paths such as FS.getPath; the "read function" can call the FS.read interface of the virtual file system to read files or data from files; and the "write function" can call the FS.write interface of the virtual file system to write to files or write data to files.

[0102] Correspondingly, the function conversion relationship can include a one-to-one correspondence between web-based file operation functions and desktop-based file operation functions. For example, the function conversion relationship can be:

[0103] (fopen, the open function; fread, the read function; fwrite, the write function).

[0104] Next, the compiler can define the web-side file operation functions in the virtual file system's function library. Then, the virtual file system can be accessed using these web-side file operation functions. For example... Figure 5 As shown, the function library for the virtual file system can be library_fs.js.

[0105] In addition, the above function conversion relationships can also be defined in the function library. Based on the function library and the function conversion relationships, desktop file operation functions can be automatically converted into web-based file operation functions, achieving the same effect as directly accessing the local file system, thus improving access efficiency and user experience.

[0106] In addition, such as Figure 3 As shown, the compiler can also include a virtual file system, the C standard library (libc), and the C++ standard library (libcxx). The C and C++ standard libraries provide the basic functions (e.g., the desktop file operation functions mentioned above) and classes required for the execution of the interface function code files. These functions and classes are specifically adapted, encapsulated, and transformed during the compilation of the interface function code files to ensure that the subsequently generated desktop font files run correctly in the web-based environment.

[0107] In one embodiment, the electronic device can first obtain multiple source storage paths in the local file system where the files generated after compiling the interface function code files are located; then, it maps the multiple source storage paths to multiple virtual storage paths in the virtual file system to obtain a path mapping relationship, which includes a target path mapping relationship; wherein, the path hierarchy of the virtual file system is consistent with the path hierarchy of the local file system.

[0108] The virtual storage path can be represented using a relative path, as detailed in the above description of the target virtual storage path.

[0109] For example, assuming the storage path under the Wasm file in the virtual storage path is: font / AAA.ttf, if the source storage path is ".. / .. / .. / .. / Wasm", it can be mapped to the virtual storage path " / "; if the source storage path is ".. / .. / .. / .. / Wasm / font", it can be mapped to the virtual storage path " / font"; if the source storage path is ".. / .. / .. / .. / Wasm / font / BBB.ttf", it can be mapped to the virtual storage path " / font / BBB.ttf".

[0110] Accordingly, the path mapping relationship can include a one-to-one correspondence between the source storage path and the virtual storage path. For example, the path mapping relationship can be:

[0111] (“.. / .. / .. / .. / Wasm”, “ / ”; “.. / .. / .. / .. / Wasm / font”, “ / font”; “.. / .. / .. / .. / Wasm / font / AAA.ttf”, “ / font / BBB.ttf”).

[0112] The present application will be introduced in the following embodiments, the process of rendering the user interface of the target application based on the web-end font file in the virtual file system, that is, S250 described above:

[0113] In one embodiment, the electronic device can achieve S250 described above by the following steps:

[0114] S250-1, obtaining the target source storage path and the desktop font adding function corresponding to the desktop font file in the desktop file operation function.

[0115] Specifically, the electronic device can obtain the target source storage path and the desktop font adding function in response to the opening operation of the user interface of the target application in the web-end version.

[0116] For example, the target source storage path and the desktop font adding function obtained by the electronic device can be: ADD(str “.. / .. / .. / .. / Wasm / font”); Wherein, “ADD()” is the desktop font adding function, and “.. / .. / .. / .. / Wasm / font” represents the target source storage path.

[0117] It should be noted that the electronic device can be a terminal device running the target application in the web-end version, or a server corresponding to the terminal device, which will be introduced in this embodiment.

[0118] In addition, the electronic device can set an adding return function, if the adding of the web-end font file corresponding to the web-end font fails, the electronic device can return the value “-1” through the adding return function, and does not perform subsequent operations (for example, S250-5). If the adding of the web-end font file corresponding to the web-end font succeeds, subsequent operations (for example, S250-5) are performed. That is, whether the adding of the web-end font file corresponding to the web-end font succeeds or fails can be determined through the adding return function.

[0119] S250-2, converting the desktop font adding function into the web-end font adding function in the web-end file operation function according to the function conversion relationship, and mapping the target source storage path into the target virtual storage path according to the path mapping relationship.

[0120] For example, in combination with the above embodiment, assuming that the function conversion relationship is that the desktop font adding function "ADD()" corresponds to the webpage font adding function "add", the electronic device can determine that the target virtual storage path is " / font" and the webpage font adding function is "add".

[0121] S250-3, access the virtual file system through the function library and the target virtual storage path, and obtain the webpage font file in the virtual file system.

[0122] For example, the electronic device can first determine that the function library has defined a desktop font adding function; then call the interface corresponding to the desktop font adding function in the virtual file system through the function library, and then obtain the webpage font file from the target virtual storage path in the virtual file system through the interface.

[0123] S250-4, determine the webpage font corresponding to the webpage font file.

[0124] Specifically, the electronic device can first identify the specific resources included in the webpage font file, such as the font glyphs, size, and style (bold, italic, etc.); then determine the webpage font according to the specific resources. For example, the webpage font can be a bold and regular font.

[0125] The display effect of the webpage font corresponding to the webpage font file in the webpage is consistent with the display effect of the desktop font corresponding to the desktop font file in the desktop.

[0126] S250-5, set the webpage font in the font instance of the user interface, and render the user interface through the font instance.

[0127] Specifically, the electronic device can set the webpage font in the font instance of the user interface and render the user interface through the font instance by the following steps:

[0128] Step one, add the webpage font to the font database of the target application in the webpage version, and the font database is used to manage the font.

[0129] The font database can store a plurality of fonts, and the plurality of fonts can be all the fonts involved in the target application in the webpage version. Through the font database, the plurality of fonts can be more securely (for example, to ensure that the font displayed in the user interface later is authorized to use) and more centrally managed, which can improve the maintainability and accessibility of the font.

[0130] Step two, obtain the font family corresponding to the webpage font in the webpage font file.

[0131] The font family is a set of fonts with similar design styles, including different styles (such as bold, italic, etc.). Through the font family, the font can be ensured to be visually harmonious and unified. The font family can be included in the webpage font file, and can include a set of fonts with similar design styles and different styles in the same user interface.

[0132] Step three, according to the font family, set the webpage font in the font database in the font instance, and render the user interface through the font instance.

[0133] Specifically, the fonts in the font family and the webpage fonts in the font database can be set in the font instance together, so as to provide a consistent visual style for the user interface when displaying different display elements in the user interface. Some display elements can be displayed based on the webpage font, and some display elements can be displayed based on the font with similar design style and different style (i.e. the font in the font family) of the webpage font.

[0134] The font instance can define the elements and execution steps required to display the webpage font in the user interface. For example, the font instance can include the name of the font to be displayed on the webpage (such as the font name of the webpage font and the font in the font family), the storage path of each font to be displayed (such as the target virtual path or the path of the font in the font database), and the execution steps for displaying the font to be displayed. The execution steps can be: determining the storage path of each font to be displayed through the name of the font to be displayed; obtaining the corresponding font through the storage path of each font to be displayed; loading and rendering the corresponding display element (such as a paragraph of text or a title in the user interface) in the user interface according to the corresponding font.

[0135] Specifically, the above rendering of the user interface through the font instance can be understood as displaying the display elements displayed based on the webpage font in the user interface through the font instance. That is, through the fonts involved in the font instance and the execution steps, the display elements in the user interface are displayed.

[0136] In addition, if the electronic device fails to add / set the font in the instance, a log can be recorded.

[0137] In one embodiment, the electronic device can first obtain the interface function code file of the target application program in the desktop version, and the interface function code file includes the desktop font file.

[0138] Then, the electronic device can obtain a desktop file operation function performed on the desktop font file, convert the desktop file operation function into a webpage file operation function used for interacting with the virtual file system to obtain a function conversion relationship, and define the webpage file operation function in a function library of the virtual file system to access the virtual file system through the function library.

[0139] In addition, the electronic device can also obtain a plurality of source storage paths in which the file generated after compiling the interface function code file is located in the local file system, map the plurality of source storage paths to a plurality of virtual storage paths in the virtual file system to obtain a path mapping relationship, and the path mapping relationship includes a target path mapping relationship; wherein the path level of the virtual file system is consistent with the path level of the local file system.

[0140] Then, the electronic device can determine the packaging mode (for example, an asynchronous packaging mode) corresponding to the desktop font file, and determine the storage location of the webpage font file generated after compiling the interface function code file, that is, the target source storage path of the local file system.

[0141] Then, the electronic device can compile the interface function file, and package the interface function code file based on the asynchronous packaging mode during the compilation process to obtain the webpage other code files packaged independently of each other and the webpage font file stored in the target source storage path. Specifically, the electronic device can generate a corresponding packaging tag based on the asynchronous packaging mode, determine a target virtual storage path according to the target path mapping relationship and the target source storage path, combine the packaging tag corresponding to the asynchronous packaging mode and the target virtual storage path to obtain a compilation parameter, configure the compilation parameter in the project configuration file corresponding to the interface function code file in the automatic build system through a parameter configuration command, and control the compilation of the interface function code file through the project configuration file of the automatic build system to generate the webpage other code files packaged independently of each other and the webpage font file stored in the target source storage path. The webpage other code files can include a webpage script file and a glue layer code file.

[0142] Then, the electronic device can run the webpage script file, load and execute the glue layer code file through the tag in the webpage script file referencing the glue layer code file, trigger the loading interface of the virtual file system through the glue layer code file, and load the webpage font file stored in the target source storage path to the target virtual storage path in the virtual file system through the loading interface and the target path mapping relationship.

[0143] Finally, in response to an access request for the target application of the web version, the electronic device can obtain the target source storage path and the desktop font adding function corresponding to the desktop font file in the desktop file operation function; and convert the desktop font adding function to a web font adding function in the web file operation function according to the function conversion relationship, and map the target source storage path to a target virtual storage path according to the path mapping relationship; through the function library, call the interface corresponding to the desktop font adding function in the virtual file system, and through the interface, obtain the web font file from the target virtual storage path in the virtual file system; then, the web font corresponding to the web font file can be determined first; the web font is added to the font database of the target application of the web version, and the font database is used for managing the font; the font family corresponding to the web font in the web font file is obtained; and the web font in the font database is set in the font instance according to the font family, and the user interface is rendered through the font instance.

[0144] It should be noted that all the above technical solutions can be combined to form optional embodiments of the present application, which will not be repeated here.

[0145] It should be noted that in the specific embodiments of the present application, the code file, storage path, packaging method, and operation function related data are involved, and when the embodiments of the present application are applied to specific products or technologies, the user's permission, consent or authorization is required, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0146] Figure 6 A schematic diagram of a font processing device 600 provided by an embodiment of the present application is shown in FIG. 6. As shown in FIG. 6, the device 600 includes a first obtaining module 601, a first determining module 602, a file compiling module 603, a file loading module 604, an access rendering module 605, a second obtaining module 606, a function conversion module 607, a function definition module 608, a third obtaining module 609, and a path mapping module 610. Figure 6

[0147] ​In one embodiment, the first obtaining module 601 is configured to obtain an interface function code file of a target application program in a desktop version, the interface function code file comprising a desktop font file; the first determining module 602 is configured to determine a packaging mode corresponding to the desktop font file and a target path mapping relationship between a target source storage path of a local file system and a target virtual storage path of a virtual file system; the file compiling module 603 is configured to compile the interface function code file according to the packaging mode, to generate a web page end other code file and a web page end font file stored in the target source storage path; the file loading module 604 is configured to load the web page end font file in the local file system into the virtual file system according to the web page end other code file and the target path mapping relationship; and the access and rendering module 605 is configured to, in response to an access request for the target application program in the web page end version, access the web page end font file in the virtual file system and render a user interface of the target application program in the web page end version based on the web page end font file.

[0148] In one embodiment, the file compiling module 603 is specifically configured to construct a compiling parameter according to the packaging mode and the target path mapping relationship, configure the compiling parameter in an engineering configuration file corresponding to the interface function code file through a parameter configuration command, and in response to the packaging mode being an asynchronous packaging mode, control the compilation of the interface function code file through the engineering configuration file to generate the web page end other code file and the web page end font file stored in the target source storage path which are obtained through independent packaging.

[0149] In one embodiment, the web page end other code file comprises a web page script file and a glue layer code file, the web page script file comprises a tag for referencing the glue layer code file, and the glue layer code file is used for loading the web page end font file; the file loading module 604 is specifically configured to run the web page script file, load and execute the glue layer code file through the tag in the web page script file for referencing the glue layer code file, trigger a loading interface of the virtual file system through the glue layer code file, and load the web page end font file in the local file system into the virtual file system through the loading interface and the target path mapping relationship.

[0150] In one embodiment, the second obtaining module 606 is configured to obtain a desktop file operation function performed on the desktop font file; the function conversion module 607 is configured to convert the desktop file operation function into a web page end file operation function used for interacting with the virtual file system, to obtain a function conversion relationship; and the function defining module 608 is configured to define the web page end file operation function in a function library of the virtual file system, so as to access the virtual file system through the function library.

[0151] In an embodiment, the third obtaining module 609 is configured to: obtain a plurality of source storage paths in which a file generated after compiling the interface function code file is located in a local file system; and the path mapping module 610 is configured to map the plurality of source storage paths to a plurality of virtual storage paths in a virtual file system to obtain a path mapping relationship, the path mapping relationship including a target path mapping relationship; and the path layer level of the virtual file system is consistent with the path layer level of the local file system.

[0152] In an embodiment, the access and rendering module 605 is specifically configured to: obtain the target source storage path and a desktop font adding function corresponding to a desktop font file in the desktop file operation function; convert the desktop font adding function to a web font adding function in the web file operation function according to the function conversion relationship, and map the target source storage path to a target virtual storage path according to the path mapping relationship; access the virtual file system through the function library and the target virtual storage path to obtain the web font file in the virtual file system; determine the web font corresponding to the web font file; set the web font in the font instance of the user interface, and render the user interface through the font instance.

[0153] In an embodiment, the access and rendering module 605 is specifically configured to: add the web font to a font database of the web version of the target application, the font database being configured to manage fonts; obtain a font family corresponding to the web font in the web font file; and set the web font in the font instance in the font database according to the font family, and render the user interface through the font instance.

[0154] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, no longer described here. Specifically, Figure 6 The device 600 shown can perform the above-mentioned method embodiments, and the foregoing and other operations and / or functions of each module in the device 600 are respectively for realizing the corresponding processes in each of the above-mentioned methods. For the sake of brevity, no longer described here.

[0155] The apparatus 600 of the embodiments of the present application is described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions of software, or in the form of a combination of hardware and software modules. Specifically, each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits of hardware in a processor and / or instructions of software. The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing for execution by a processor, or be executed by a combination of hardware and software modules in the processor. Alternatively, the software module can be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, and the like. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the above method embodiments in combination with hardware thereof.

[0156] Figure 7 A schematic block diagram of an electronic device 700 according to an embodiment of the present application is provided.

[0157] As shown in Figure 7 the electronic device 700 can include:

[0158] The memory 710 is configured to store a computer program and transmit the program code to the processor 720. In other words, the processor 720 can call and run the computer program from the memory 710 to implement the method in the embodiments of the present application.

[0159] For example, the processor 720 can be configured to execute the above method embodiments according to the instructions in the computer program.

[0160] In some embodiments of the present application, the processor 720 can include but is not limited to:

[0161] a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and the like.

[0162] In some embodiments of the present application, the memory 710 includes but is not limited to:

[0163] The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache memory. By way of example, and not limitation, many forms of RAM are available, for example, a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch Link DRAM (SLDRAM), and a Direct Rambus RAM (DR RAM).

[0164] In some embodiments of the present application, the computer program can be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the method provided by the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.

[0165] As shown in Figure 7 The electronic device can further include:

[0166] The transceiver 730 can be connected to the processor 720 or the memory 710.

[0167] The processor 720 can control the transceiver 730 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 730 can include a transmitter and a receiver. The transceiver 730 can further include an antenna, and the number of antennas can be one or more.

[0168] It should be understood that the various components within the electronic device are connected via a bus system, which includes, in addition to a data bus, a power supply bus, a control bus, and a state signal bus.

[0169] The application also provides a computer storage medium, which stores a computer program, and the computer program enables a computer to execute the method of the method embodiment when executed by the computer. Alternatively, the application embodiment also provides a computer program product containing instructions, and the instructions enable the computer to execute the method of the method embodiment when executed by the computer.

[0170] When implemented by using software, the software can be implemented in the form of a computer program product entirely or partially. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer program instructions can enable the computer to execute the corresponding flow in each method in the application embodiment entirely or partially, and generate the function that can be implemented by each method in the application embodiment. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, digital video disc (DVD)), or a semiconductor medium (for example, solid state disk (SSD)), etc.

[0171] Those skilled in the art can realize that the modules and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.

[0172] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiment is merely illustrative. For example, the division of the modules is only a logical function division. There can be another division manner for the actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the modules can be indirect couplings or communication connections through some interfaces, devices or modules, and can be in electrical, mechanical or other forms.

[0173] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical modules, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. For example, the functional modules in the embodiments of the present application can be integrated into a processing module, or each module can be physically present separately, or two or more modules can be integrated into one module.

Claims

1. A font processing method characterized by, The method comprises the following steps: obtaining an interface function code file of a target application of a desktop version, the interface function code file comprising a desktop font file; determining a packaging mode corresponding to the desktop font file and a target path mapping relationship between a target source storage path of a local file system and a target virtual storage path of a virtual file system; compiling the interface function code file according to the packaging mode to generate a webpage other code file and a webpage font file stored in the target source storage path, wherein the webpage other code file comprises a webpage script file and a glue layer code file, the webpage script file comprises a tag for referencing the glue layer code file, and the glue layer code file is used for loading the webpage font file; running the webpage script file, loading and executing the glue layer code file through the tag in the webpage script file for referencing the glue layer code file, triggering a loading interface of the virtual file system through the glue layer code file, and loading the webpage font file in the local file system into the virtual file system through the loading interface and the target path mapping relationship; in response to an access request for the target application of the webpage version, accessing the webpage font file in the virtual file system and rendering a user interface of the target application of the webpage version based on the webpage font file.

2. The method of claim 1, wherein, The compiling the interface function code file according to the packaging mode to generate the webpage other code file and the webpage font file stored in the target source storage path comprises the following steps: constructing a compilation parameter according to the packaging mode and the target path mapping relationship; configuring the compilation parameter in an engineering configuration file corresponding to the interface function code file through a parameter configuration command; in response to the packaging mode being an asynchronous packaging mode, controlling the compilation of the interface function code file through the engineering configuration file to generate the webpage other code file and the webpage font file stored in the target source storage path which are packaged independently of each other.

3. The method of claim 1, wherein, Before the step of in response to the access request for the target application of the webpage version, accessing the webpage font file in the virtual file system and rendering a user interface of the target application of the webpage version based on the webpage font file, the method further comprises the following steps: obtaining a desktop file operation function performed on the desktop font file; converting the desktop file operation function into a webpage file operation function used for interacting with the virtual file system to obtain a function conversion relationship; defining the webpage file operation function in a function library of the virtual file system to access the virtual file system through the function library.

4. The method of claim 3, wherein, Before the step of in response to the access request for the target application of the webpage version, accessing the webpage font file in the virtual file system and rendering a user interface of the target application of the webpage version based on the webpage font file, the method further comprises the following steps: obtaining a plurality of source storage paths where files generated after compiling the interface function code file are located in the local file system; mapping the plurality of source storage paths as a plurality of virtual storage paths in the virtual file system to obtain a path mapping relationship, the path mapping relationship including the target path mapping relationship; wherein the path hierarchy of the virtual file system is consistent with the path hierarchy of the local file system.

5. The method of claim 4, wherein, The access to the web font file in the virtual file system includes: obtaining the target source storage path and the desktop font adding function corresponding to the desktop font file in the desktop file operation function; According to the function conversion relationship, the desktop font adding function is converted into a web font adding function in the web file operation function, and the target source storage path is mapped into the target virtual storage path according to the path mapping relationship; accessing the virtual file system through the function library and the target virtual storage path to obtain the web font file in the virtual file system; determining the web font corresponding to the web font file; setting the web font in the font instance of the user interface, and rendering the user interface through the font instance.

6. The method of claim 5, wherein, The setting of the web font in the font instance of the user interface includes: adding the web font to the font database of the web version of the target application, and the font database is used for managing fonts; obtaining the font family corresponding to the web font in the web font file; According to the font family, the web font in the font database is set in the font instance, and the user interface is rendered through the font instance.

7. A font processing apparatus characterized by comprising: It includes: The first acquisition module is used for acquiring the interface function code file of the desktop version of the target application, and the interface function code file includes the desktop font file; The first determination module is used for determining the packaging mode corresponding to the desktop font file and the target path mapping relationship between the target source storage path of the local file system and the target virtual storage path of the virtual file system; The file compiling module is used for compiling the interface function code file according to the packaging mode to generate a web font file stored in the target source storage path and a web other code file, wherein the web other code file includes a web script file and a glue layer code file, the web script file includes a tag for referencing the glue layer code file, and the glue layer code file is used for loading the web font file; The file loading module is configured to: run the webpage script file; load and execute the glue layer code file through a tag in the webpage script file referencing the glue layer code file; trigger a loading interface of the virtual file system through the glue layer code file; and load a webpage font file in the local file system into the virtual file system through the loading interface and the target path mapping relationship. The access rendering module is configured to: in response to an access request for a target application program in a webpage version, access the webpage font file in the virtual file system, and render a user interface of the target application program in the webpage version based on the webpage font file.

8. An electronic device, comprising: The computer program is configured to implement the method of any one of claims 1-6 when executed by a processor. The computer program is configured to implement the method of any one of claims 1-6 when executed by a processor. ​ ​ ​ 9. A computer readable storage medium having stored thereon a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Page rendering method and device, electronic equipment and storage medium

    CN114218890A

  • Page display method and device, equipment and storage medium

    CN117667084A