CAD (Computer Aided Design) drawing watching method and device supporting cross-platform font configuration, equipment and medium

By embedding a mapped font library suitable for different operating platforms in the backend server, CAD drawings are parsed and rendered, solving the font incompatibility problem in cross-platform operation, realizing cross-platform font configuration and rendering quality optimization, and enhancing the company's market competitiveness.

CN120995982APending Publication Date: 2025-11-21INSPUR HONGQI (SHANDONG) DIGITAL TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511509224.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing technologies, CAD drawings suffer from problems such as missing fonts, incompatible formats, unclear drawings, incomplete rendering, and information loss or distortion when operated across platforms. This increases the software purchase costs for enterprises and users, and hinders the operational efficiency and business expansion of enterprises.

Method used

The backend server has a built-in mapped font library suitable for different operating platforms. It parses CAD drawings using image parsing algorithms, selects mapped fonts for rendering based on the applicable operating platform, and generates cross-platform compatible viewing files.

Benefits of technology

It enables cross-platform font configuration, enriches font selection, optimizes the presentation quality in the CAD design environment, reduces difficulties caused by platform incompatibility, and enhances the company's market competitiveness and long-term profitability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995982A_ABST
    Figure CN120995982A_ABST
Patent Text Reader

Abstract

The invention provides a CAD drawing watching method and device supporting cross-platform font configuration, equipment and a medium, and belongs to the technical field of data processing. The CAD drawing reading method supporting the cross-platform font configuration comprises the following steps: receiving a drawing reading request sent by a front-end operating system; according to an image analysis algorithm, a CAD drawing corresponding to the drawing reading request is analyzed, drawing analysis information is obtained, and the drawing analysis information comprises text information; mapping fonts corresponding to the character information are selected from a built-in font library of a back-end server according to applicable operation platforms of the CAD drawing, and the built-in font library comprises mapping fonts applicable to different operation platforms respectively; and using the mapping font to render a CAD drawing, and sending a reading file corresponding to the CAD drawing to a front-end operating system. The problems of font missing, format incompatibility, rendering incompleteness and drawing information loss or deformation caused by platform incompatibility fonts in the drawing viewing process in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of digital data processing technology, specifically relating to a CAD drawing viewing method, apparatus, device, and medium that supports cross-platform font configuration. Background Technology

[0002] With the continuous development of digital and information technologies, Computer-Aided Design (CAD) technology has become an indispensable tool in engineering design, architecture, and manufacturing. However, viewing CAD drawings is often limited by operating systems and font settings. For example, most domestically produced CAD software is developed based on the Windows operating system, and its fonts can mostly only be displayed on Windows. Because the Linux operating system lacks the fonts corresponding to the aforementioned CAD software, or does not support the font formats of Windows applications by default, the fonts of many CAD software cannot be displayed correctly in the Linux operating system environment.

[0003] However, many applications and services are developed based on the Linux operating system. CAD software developed for Windows cannot display correctly in a Linux environment, leading to serious technical difficulties. Therefore, ensuring the correct display of CAD drawings during cross-platform (or cross-system) operations has become an urgent problem to be solved. To address this issue, an existing patent (publication number CN107368622A) provides a method for online viewing of CAD drawings. This method converts CAD drawings into Flash files (SWF) and directly enables remote model browsing and design through an online browser system, reducing the space required for model data. However, this method focuses on converting CAD drawing formats to other file formats to support online viewing. While it supports cross-platform display, the need to switch between different file formats results in low processing efficiency for CAD drawing files.

[0004] The difficulty of cross-platform operation of CAD drawings imposes various limitations on enterprises and users, increases software purchase costs, and hinders operational efficiency and business expansion. This not only prevents enterprises from fully utilizing the productivity and competitive advantages brought by the technology, but also slows down their development, affecting their market competitiveness and long-term profitability. Summary of the Invention

[0005] This application aims to provide a method, device, and medium for online CAD viewing that supports cross-platform font configuration. It seeks to address issues such as missing fonts, incompatible font formats, unclear drawings, incomplete rendering, and lost or distorted drawing information in Linux operating system environments caused by existing technologies, thereby enriching font selection and optimizing font presentation quality in CAD design environments.

[0006] According to a first aspect of this application, embodiments of this application provide a CAD drawing viewing method that supports cross-platform font configuration, including: Receive drawing viewing requests sent by the front-end operating system; Based on the image parsing algorithm, the CAD drawing corresponding to the drawing viewing request is parsed to obtain drawing parsing information, which includes text information; Based on the applicable operating platform of the CAD drawing, the corresponding mapped font for the text information is selected from the built-in font library of the back-end server. The built-in font library includes mapped fonts applicable to different operating platforms. Use mapped fonts to render CAD drawings and send the corresponding viewing file of the CAD drawing to the front-end operating system.

[0007] Preferably, the above-described CAD drawing viewing method further includes, before the step of receiving the drawing viewing request sent by the front-end operating system: Generate a built-in font library on the backend server; Import mapped fonts compatible with multiple operating platforms into the built-in font library; Obtain font files for various CAD applications, and import the mapped fonts from the font files into the built-in font library according to the corresponding operating platform of the CAD application; In the built-in font library, a mapping relationship is established between each mapped font and its corresponding glyph feature encoding.

[0008] Preferably, in the above CAD drawing viewing method, the step of parsing the CAD drawing corresponding to the drawing viewing request according to the image parsing algorithm to obtain the drawing parsing information includes: Using graphic element recognition and classification algorithms, feature points of graphic elements in CAD drawings are extracted and classified according to the type of graphic element. Using layer and block processing algorithms, locate the target processing object in the CAD drawing and extract the attribute features of the target processing object; By combining the feature points of graphic elements and the attribute features of the target object, drawing analysis information is obtained.

[0009] Preferably, in the above CAD drawing viewing method, the step of selecting the mapped font corresponding to the text information from the built-in font library of the backend server according to the applicable operating platform of the CAD drawing includes: Using a contour feature extraction algorithm, contour features of text information are extracted from the parsed information of the drawing. Based on the contour features, establish the glyph feature encoding corresponding to the text information; Based on the mapping relationship between the mapped font and the glyph feature code, and combined with the operating platform applicable to the CAD drawing, the mapped font corresponding to the text information is selected from the built-in font library.

[0010] Preferably, in the above CAD drawing viewing method, the steps of using mapped fonts to render CAD drawings and sending the corresponding viewing file of the CAD drawing to the front-end operating system include: For the parsed drawing information, a format conversion algorithm is used to convert the CAD drawings to a uniform format to obtain drawing data. Store drawing data in a unified format and generate corresponding viewing files for the drawing data in a specified path on the backend server; The file is sent to the front-end operating system for viewing, and then displayed on the front-end operating system.

[0011] Preferably, the above-mentioned CAD drawing viewing method, based on the applicable operating platform of the CAD drawing, further includes the step of selecting the mapped font corresponding to the text information from the built-in font library of the backend server, specifically: Determine whether a mapped font has been selected from the built-in font library; If no mapped font is selected, the similarity algorithm is used to calculate the similarity between the outline features and the features of other fonts in the built-in font library. From the built-in font library, temporarily select the font with the highest similarity as the mapping font for the text information; and, After selecting the mapped font corresponding to the text information, obtain the manufacturer information of the CAD drawing; Obtain the additional font file corresponding to the manufacturer's information; Import additional font files into the built-in font library.

[0012] Preferably, in the above CAD viewing method, the front-end operating system is a Linux operating system, and the method further includes: Deploy an image viewing service in the front end of a Linux operating system; When a drawing viewing request is received, determine whether the CAD drawing corresponding to the drawing viewing request is compatible with the Linux operating system; If it is determined that the CAD drawing is not compatible with the Linux operating system, then the step of selecting the mapped font corresponding to the text information from the built-in font library according to the applicable operating platform of the CAD drawing is executed. After rendering the CAD drawing using the mapped font, the rendering CAD drawing is displayed by calling the image viewing service of the Linux operating system front end.

[0013] According to a second aspect of this application, this application also provides a CAD viewing device that supports cross-platform font configuration, comprising: The request receiving module is used to receive drawing viewing requests sent by the front-end operating system; The drawing parsing module is used to parse the CAD drawing corresponding to the drawing viewing request according to the image parsing algorithm to obtain the drawing parsing information, which includes text information. The font selection module is used to select the mapped font corresponding to the text information from the built-in font library of the back-end server according to the applicable operating platform of the CAD drawing. The built-in font library includes mapped fonts applicable to different operating platforms. The font rendering module is used to render CAD drawings using mapped fonts and send the corresponding viewing files of the CAD drawings to the front-end operating system.

[0014] Preferably, the aforementioned CAD viewing device supporting cross-platform font configuration further includes: a font library setting module, used to generate a built-in font library on the backend server, import mapping fonts common to multiple operating platforms into the built-in font library, obtain font library files for multiple CAD applications respectively, import the mapping fonts of the font library files into the built-in font library according to the operating platform corresponding to the CAD application, and establish a mapping relationship between each mapping font and its corresponding glyph feature code in the built-in font library. Preferably, the above-mentioned drawing parsing module is specifically used to use graphic element recognition and classification algorithms to extract feature points of graphic elements in CAD drawings, classify feature points according to the type of graphic elements; use layer and block processing algorithms to locate the target processing object in the CAD drawing, extract the attribute features of the target processing object; and combine the feature points of graphic elements and the attribute features of the target processing object to obtain drawing parsing information.

[0015] Preferably, the above-mentioned font selection module is specifically used to extract the contour features of text information from the drawing parsing information using a contour feature extraction algorithm; establish the glyph feature code corresponding to the text information based on the contour features; and select the mapped font corresponding to the text information from the built-in font library according to the mapping relationship between the mapped font and the glyph feature code, combined with the operating platform applicable to the CAD drawing.

[0016] Preferably, the above-mentioned font rendering module is specifically used to convert the CAD drawing into a uniform format using a format conversion algorithm based on the drawing parsing information; store the uniform format drawing data; generate a viewing file corresponding to the drawing data in a specified path on the backend server; and send the viewing file to the frontend operating system for display.

[0017] Preferably, the font selection module is further configured to determine whether a mapped font is selected from the built-in font library; if no mapped font is selected, the similarity between the contour features and other fonts in the built-in font library is calculated based on a similarity algorithm; the font with the highest feature similarity is temporarily selected from the built-in font library as the mapped font corresponding to the text information; and after selecting the mapped font corresponding to the text information, the manufacturer information of the CAD drawing is obtained; the additional font file corresponding to the manufacturer information is obtained; and the additional font file is imported into the built-in font library.

[0018] Preferably, the CAD viewing device that supports cross-platform font configuration further includes: a viewing service deployment module, used to deploy a viewing service on the front end of a Linux operating system; when a drawing viewing request is received, it determines whether the CAD drawing corresponding to the drawing viewing request is applicable to the Linux operating system; if it is determined that the CAD drawing is not applicable to the Linux operating system, it performs the step of selecting the mapped font corresponding to the text information from the built-in font library according to the applicable operating platform of the CAD drawing; after rendering the CAD drawing using the mapped font, it calls the viewing service of the Linux operating system to display the rendered CAD drawing.

[0019] According to a third aspect of this application, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the CAD viewing method supporting cross-platform font configuration provided by any of the above technical solutions.

[0020] According to a fourth aspect of this application, this application also provides a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the CAD viewing method supporting cross-platform font configuration provided by the above-described technical solution.

[0021] The technical solution of this application has at least the following technical effects: The CAD drawing viewing solution provided in this application, which supports cross-platform font configuration, first requires configuring mapped fonts suitable for different operating platforms in the built-in font library of the backend server, including fonts for Linux and Windows operating systems. When a drawing viewing request is received from the frontend operating system, the CAD drawing corresponding to the request is parsed using an image analysis algorithm to obtain drawing parsing information, including text information. Then, the operating platform applicable to the CAD drawing, especially the text information, can be determined. Based on the applicable operating platform, the mapped font corresponding to the text information is selected from the built-in font library of the backend server. Since the fonts in the built-in font library are applicable to different operating platforms, this can be achieved by importing fonts from additional font libraries using manufacturer and application information. This allows the CAD drawing to be displayed on the local operating platform, such as Linux. Specifically, after selecting the mapped font from the built-in font library, the CAD drawing is rendered using that mapped font, and the corresponding viewing file is sent to the frontend operating system. The frontend operating system, such as Linux, then displays the CAD drawing, including displaying the text information in the CAD drawing using the mapped font. The above methods can enrich font selection, optimize font presentation quality in CAD design environments, and enable cross-platform font configuration for CAD drawings on different operating systems. This solves problems in existing technologies where font incompatibility with platforms leads to issues such as missing fonts, incompatible font formats, unclear drawings, incomplete rendering, and loss or distortion of drawing information. It also reduces the difficulties of cross-platform operation of CAD drawings, which increase software purchase costs for enterprises and users, hinder operational efficiency and business expansion, and ultimately enhances the market competitiveness and long-term profitability of enterprises. Attached Figure Description

[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This application provides an architecture diagram of an online CAD viewing service that supports cross-platform font configuration. Figure 2 A flowchart illustrating the first CAD drawing viewing method supporting cross-platform font configuration provided in this application embodiment; Figure 3 A flowchart illustrating the second CAD drawing viewing method supporting cross-platform font configuration provided in this application embodiment; Figure 4This is a schematic diagram of the structure of a CAD viewing device that supports cross-platform font configuration, provided in an embodiment of this application. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0023] To more clearly illustrate the overall concept of this application, a detailed explanation is provided below with reference to the accompanying drawings.

[0024] Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below. It should be noted that, unless otherwise specified, the embodiments of this application and the features thereof can be combined with each other.

[0025] In this application, unless otherwise expressly specified and limited, the terms "above" and "below" the second feature can refer to direct contact between the first and second features, or indirect contact between the first and second features through an intermediate medium. In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples.

[0026] The existing technology has the following drawbacks: Viewing CAD drawings is often limited by operating system and font settings. For example, most domestically produced CAD software is developed based on the Windows operating system, and its fonts can mostly only be displayed on Windows. Because the Linux operating system lacks the fonts corresponding to the aforementioned CAD software, or does not support the font formats of Windows applications by default, the fonts of many CAD software cannot be displayed correctly in the Linux operating system environment.

[0027] However, many applications and services are developed based on the Linux operating system. CAD software developed for Windows cannot display correctly in a Linux environment, leading to serious technical difficulties, including: missing fonts, font format incompatibility, unclear drawings, incomplete drawing rendering, and lost or distorted drawing information. The difficulty of cross-platform operation of CAD drawings imposes various limitations on enterprises and users, increases software purchase costs, and hinders operational efficiency and business expansion. This not only prevents enterprises from fully utilizing the productivity and competitive advantages brought by this technology but also slows down their development, affecting their market competitiveness and long-term profitability.

[0028] To address the aforementioned issues, the following embodiments of this application provide a CAD viewing solution that supports cross-platform font configuration. By embedding a font library in the backend server, which contains mapped fonts suitable for different operating platforms, after parsing the text information of the CAD drawing, the system can select the corresponding mapped font from the backend server's built-in font library based on the applicable operating platform of the CAD drawing. This mapped font is then used to render the CAD drawing, which is then displayed on the frontend operating system. This solution enables cross-platform font configuration, thereby enriching font selection and optimizing font presentation quality in the CAD design environment.

[0029] To achieve the above objectives, see [link to relevant documentation]. Figure 1 , Figure 1 This is an architecture diagram of an online CAD viewing service that supports cross-platform font configuration, provided as an embodiment of this application. Figure 1 As shown, this CAD viewing service that supports cross-platform font configuration includes: Image viewing service 100 and front-end operating system 200; wherein, image viewing service 100 includes image viewing service font library 101 and data conversion accurate matching font library 102, etc.; front-end operating system includes document management service 201 and front-end image viewing service 202, etc.

[0030] This CAD viewing service runs on a Linux environment. Based on its architecture, the functions of this online CAD viewing service are as follows: (1) Supports configurable fonts: Given the diverse and unique fonts used by various CAD software programs, the entire system (including the front-end operating system and back-end server) not only supports default font options but also allows for the import of new fonts for expansion. To support cross-platform font compatibility and ensure accurate font display in CAD drawings, the system supports online uploading of additional font library files from CAD manufacturers, especially for certain specialized Chinese fonts. Uploading additional font library files increases the richness of font types, ensuring accurate font matching during drawing parsing.

[0031] (2) Parsing and extraction: Based on uploaded CAD drawings, advanced image recognition and processing technologies (such as graphic element recognition and classification algorithms and layer and block processing algorithms) enable rapid identification and parsing of CAD drawings. Parsing CAD drawings involves identifying elements (such as lines, text, and annotations) and extracting their attributes (such as color, line type, and layers), ensuring the integrity and accuracy of the drawings. This results in the parsed content of the CAD drawings, including element and attribute information such as geometric elements, layers, annotations and dimensions, and text and annotations.

[0032] (3) Data conversion: Based on the obtained parsed content, professional image algorithms and technologies (such as graphic element recognition and classification algorithms, layer and block processing algorithms, dimensioning and text recognition algorithms, and drawing compression and optimization algorithms) are used for different drawing formats such as DWG, DXF, DGN, and DWF CAD drawings to ensure that CAD drawings maintain their original accuracy and detail during the conversion process. Font mapping conversion is found for the parsed drawing text, and the extracted data is converted into a unified specified format, such as OCF format.

[0033] (4) Data storage: Data is stored in the converted specified format, and a new file is generated in the specified path. This eliminates the need to modify the original drawing file. The newly generated file can only be previewed. Once the file conversion and storage are successful, it can be viewed permanently after a single conversion. The file does not require further conversion; it can be accessed directly in the new format, thus improving preview and viewing efficiency. Using this method, each time a CAD drawing is viewed, it is unnecessary to parse, load, and convert the original drawing file. By creating a new file, the address can be directly obtained, and a preview file in the specific format can be viewed, thereby improving preview and viewing efficiency.

[0034] (5) Drawing Preview: Based on the deployment of the drawing viewing service, when previewing CAD drawings, users can directly view preview files in specific formats, enabling rapid drawing viewing. Furthermore, the font display remains consistent with the original design CAD software on the Linux operating system. Because the font information of the original design drawings is already available, the correct text display and meaning can be matched and parsed, thus avoiding the display of garbled characters.

[0035] (6) Configurability and extensibility of the usage process: After the solution is delivered to the client, as the client's business adjusts and the number of drawings increases, it becomes necessary to configure and expand the font files of the original software system. Therefore, a configurable "system + service + font" approach can be used to deploy the drawing viewing service and expand and assemble the fonts. During configuration, the needs for accurate display of different CAD drawings are met; when the drawing viewing service is not needed, the service can be uninstalled, thereby reducing system complexity, avoiding resource contention, and lowering maintenance costs.

[0036] See also: Figure 2 , Figure 2 This application provides a flowchart illustrating a CAD drawing viewing method that supports cross-platform font configuration. For example... Figure 2 As shown, this CAD viewing method that supports cross-platform font configuration includes: S110: Receives drawing viewing requests sent by the front-end operating system. Combined with... Figure 1 As shown, when a user uploads a CAD drawing and requests a preview, a request is sent to the front-end operating system, such as a Linux operating system. The operating system can then generate a drawing viewing request based on this request and send it to the back-end server's drawing viewing service program.

[0037] S120: Based on the image analysis algorithm, the CAD drawing corresponding to the drawing viewing request is analyzed to obtain drawing analysis information, which includes text information. The image analysis algorithm here includes graphic element recognition and classification algorithms, as well as layer and block processing algorithms. Specifically, the graphic element recognition and classification algorithm can identify the feature points of graphic elements in the CAD drawing and classify these feature points according to the type of graphic element; the layer and block processing algorithm can locate the target processing object in the CAD drawing, thereby extracting the attribute features of the target processing object. Combining these feature points and attribute features allows for the comprehensive acquisition of drawing analysis information, including text information.

[0038] S130: Based on the applicable operating platform of the CAD drawing, select the mapped font corresponding to the text information from the built-in font library of the backend server. The built-in font library includes mapped fonts applicable to different operating platforms. In this embodiment, the aforementioned built-in font library needs to be set up on the backend server first. This built-in font library includes not only fonts applicable to the operating platform of this system but also fonts applicable to other operating platforms. For example, if the current operating platform is Linux, then Linux does not support fonts for most types of CAD drawings. By importing fonts applicable to Windows operating systems for most types of CAD drawings into the built-in font library of the backend server, when the frontend retrieves a font, it can retrieve the mapped font according to the mapping relationship, thereby displaying the mapped font on the frontend Linux operating platform.

[0039] S140: Render the CAD drawing using mapped fonts and send the corresponding viewing file to the front-end operating system. In this embodiment, after rendering the CAD drawing using mapped fonts, the CAD drawing is not opened directly. Instead, a viewing file corresponding to the CAD drawing is generated and sent. This viewing file is only for viewing purposes. Thus, after successful file conversion and storage, it can be converted sequentially for permanent viewing. The viewing file does not require further conversion; the front-end operating system can directly access the new format file, thereby improving the efficiency of CAD drawing viewing.

[0040] In summary, the CAD drawing viewing method supporting cross-platform font configuration provided in this application first requires configuring mapped fonts suitable for different operating platforms in the built-in font library of the backend server, including fonts suitable for Linux and Windows operating systems. When a drawing viewing request is received from the frontend operating system, the CAD drawing corresponding to the request is parsed using an image analysis algorithm to obtain drawing parsing information, including text information. Then, the operating platform applicable to the CAD drawing, especially the text information, can be determined. Based on the applicable operating platform of the CAD drawing, the mapped font corresponding to the text information is selected from the built-in font library of the backend server. Since the fonts in the built-in font library are applicable to different operating platforms, this can be achieved by importing fonts from additional font libraries using manufacturer and application information. This allows the CAD drawing to be displayed on the local operating platform, such as Linux. Specifically, after selecting the mapped font from the built-in font library, the CAD drawing is rendered using this mapped font, and the corresponding viewing file is sent to the frontend operating system. The frontend operating system, such as Linux, then displays the CAD drawing, including displaying the text information in the CAD drawing using the mapped font. The above methods can enrich font selection, optimize font presentation quality in CAD design environments, and enable cross-platform font configuration for CAD drawings on different operating systems. This solves problems in existing technologies where font incompatibility with platforms leads to issues such as missing fonts, incompatible font formats, unclear drawings, incomplete rendering, and loss or distortion of drawing information. It also reduces the difficulties of cross-platform operation of CAD drawings, which increase software purchase costs for enterprises and users, hinder operational efficiency and business expansion, and ultimately enhances the market competitiveness and long-term profitability of enterprises.

[0041] Additionally, it should be noted that, in this embodiment of the application, before receiving a drawing viewing request sent by the front-end operating system, a corresponding built-in font library needs to be configured on the back-end server. This built-in font library stores fonts applicable to different CAD software. Since most CAD software is developed for specific operating systems, fonts can be categorized according to the operating system applicable to the CAD software.

[0042] Specifically, as a preferred embodiment, the above-described CAD drawing viewing method further includes, before step S110: receiving a drawing viewing request sent by the front-end operating system: S201: Generates a built-in font library on the backend server. This built-in font library includes general-purpose mapped fonts, as well as mapped fonts for CAD drawings applicable to different operating platforms.

[0043] S202: Import mapping fonts compatible with multiple operating platforms into the built-in font library. The built-in font library of this application not only supports default font options but also allows for the import of new fonts to expand the library. By importing mapping fonts compatible with multiple operating platforms, cross-platform font compatibility can be achieved, thereby enabling accurate display of fonts in CAD drawings.

[0044] S203: Obtain font files for various CAD applications and import the mapped fonts from these files into the built-in font library according to the operating platform of each CAD application. This allows for the uploading of corresponding mapped fonts from CAD manufacturers, as different manufacturers develop their CAD software for specific operating platforms, ensuring compatibility. Therefore, importing mapped fonts from multiple CAD manufacturers into the built-in font library enables compatibility across various operating platforms. The mapped fonts are categorized according to the operating platform supported by the CAD application, allowing for accurate font matching based on the operating system during subsequent font matching.

[0045] S204: In the built-in font library, establish a mapping relationship between each mapped font and its corresponding glyph feature code. In this embodiment, a corresponding glyph feature code is set for each character, including metadata such as font name, version, character set, and style. By establishing the mapping relationship between the glyph feature code and the mapped font, font matching can be performed from the built-in font library for each subsequently input character, and the corresponding mapped font can be called from the built-in font library for rendering.

[0046] The technical solution provided in this application generates a built-in font library on a backend server and then imports mapping fonts common to multiple operating platforms into the built-in font library. This allows the built-in font library to support default font options. Furthermore, font files for various CAD applications are obtained, and the mapping fonts from these font files are imported into the built-in font library according to the operating platform corresponding to the CAD application. This approach covers as many font types as possible used by all CAD applications, achieving cross-platform font compatibility and accurate display of fonts in CAD drawings, especially supporting special Chinese fonts supported by CAD manufacturers. In addition, the built-in font library provided in this application not only supports default font options but also allows the import of new fonts to expand the font library.

[0047] In a preferred embodiment, step S120 of the above CAD drawing viewing method, which involves parsing the CAD drawing corresponding to the drawing viewing request using an image parsing algorithm to obtain drawing parsing information, specifically includes: S121: Using a graphic element recognition and classification algorithm, feature points of graphic elements in the CAD drawing are extracted, and the feature points are classified according to the type of graphic element. The image analysis algorithm provided in this application includes a graphic element recognition and classification algorithm and a layer and block processing algorithm; wherein, the graphic element recognition and classification algorithm can extract feature points of geometric elements in the CAD drawing, such as lines, text, and arcs. After extracting feature points, all extracted feature points can be classified according to the type of the corresponding geometric element (such as text, graphics, and special symbols), thereby achieving efficient organization of feature points.

[0048] S122: Using layer and block processing algorithms, locate the target processing object in the CAD drawing and extract its attribute features. Layer and block processing algorithms can quickly locate target objects, such as edges and annotations, by recognizing layers and colors, thereby quickly extracting the attribute features of the target processing object, such as graphic elements, dimension annotations, and text annotations.

[0049] S123: Combine the feature points of the graphic elements and the attribute features of the target processing object to obtain the drawing analysis information.

[0050] In summary, the technical solution provided in this application can extract feature points of geometric elements in CAD drawings through graphic element recognition and classification algorithms; and quickly locate the attribute features of target objects using layer and color recognition technology through layer and block processing algorithms; finally, by combining the feature points of graphic elements and the attribute features of the target object, drawing parsing information is obtained. This drawing parsing information includes text information, graphics, and annotations, thereby restoring the content of the CAD drawing to the greatest extent possible.

[0051] In addition, as a preferred embodiment, in the above CAD drawing viewing method, step S130: selecting the mapped font corresponding to the text information from the built-in font library of the backend server according to the applicable operating platform of the CAD drawing, includes: S131: Using a contour feature extraction algorithm, the contour features of text information are extracted from the drawing parsing information. In this embodiment, after obtaining the drawing parsing information, the contour features of text information are extracted from the drawing parsing information using a contour feature extraction algorithm, thus matching the corresponding font for each character in the text information.

[0052] S132: Based on the contour features, establish the glyph feature encoding corresponding to the text information. For each character in the text information, the font corresponding to that character can be determined according to its contour features. This allows the establishment of a unique glyph feature encoding for each character, which includes metadata such as font name, version, character set, and style. Using the above metadata, the corresponding character and style in the character set can be found through the contour features, the font name of the corresponding version can be determined, and then the corresponding mapped font can be matched from the built-in font library.

[0053] S133: Based on the mapping relationship between the mapped font and the glyph feature code, and combined with the operating platform applicable to the CAD drawing, select the mapped font corresponding to the text information from the built-in font library.

[0054] The technical solution provided in this application establishes font library management for the built-in font library, covering all possible font sources; for uploaded common font file formats, the contour features of the characters are extracted through the contour feature extraction algorithm to generate unique feature glyph feature codes, and record metadata such as font name, version, character set, and style.

[0055] After establishing this mapping relationship between glyph feature codes and font data, upon receiving text parsing information, the system can establish the glyph feature codes corresponding to the text information based on the outline features. Following the mapping relationship between the glyph feature codes and mapped fonts in the built-in font library, it can match each character in the text information with a mapped font in the built-in font library. Furthermore, if the font exists in the CAD drawing, it can be rendered by calling the mapped font based on the parsed glyph feature codes.

[0056] In addition, as a preferred embodiment, in the above CAD drawing viewing method, step S140: rendering the CAD drawing using a mapped font and sending the viewing file corresponding to the CAD drawing to the front-end operating system includes: S141: For the parsed drawing information, a format conversion algorithm is used to convert the CAD drawings to a unified format, resulting in drawing data. CAD drawings include different formats such as DWG, DXF, DGN, and DWF. This embodiment employs professional image algorithms and technologies to convert the CAD drawings, ensuring that the drawings retain their original accuracy and detail during the conversion process. The format conversion algorithm includes drawing compression and optimization algorithms, unified specified format conversion algorithms, and file storage methods. Specifically, it can uniformly convert CAD drawings in formats such as DWG, DXF, DGN, and DWF to OCF format.

[0057] S142: Stores drawing data in a unified format and generates a corresponding view file for the drawing data in a specified path on the backend server. This view file is only for previewing; once the file is converted and stored, it allows for permanent viewing. Subsequent viewing of the CAD drawings only requires accessing the new format view file, eliminating the need for any further conversion and thus improving preview and viewing efficiency.

[0058] S143: Send the viewed file to the front-end operating system and display the viewed file on the front-end operating system.

[0059] The technical solution provided in this application converts CAD drawings into drawing data in a unified format and generates a corresponding viewing file for that drawing data. This enables a one-time conversion of CAD data for permanent viewing. Subsequent conversions are unnecessary; the viewing file can be accessed directly, thus improving preview and viewing efficiency.

[0060] Furthermore, as a preferred embodiment, S130 of the above CAD drawing viewing method, which involves selecting the mapped font corresponding to the text information from the built-in font library of the backend server based on the applicable operating platform of the CAD drawing, specifically further includes: S134: Determine whether a mapped font has been selected from the built-in font library.

[0061] S135: If no mapped font is selected, calculate the similarity between the contour features and the features of other fonts in the built-in font library according to the similarity algorithm.

[0062] S136: Temporarily select the font with the highest feature similarity from the built-in font library as the mapping font corresponding to the text information; and, S137: After selecting the mapped font corresponding to the text information, obtain the manufacturer information of the CAD drawing.

[0063] S138: Obtain the additional font file corresponding to the manufacturer information and import the additional font file into the built-in font library.

[0064] The technical solution provided in this application, when no mapped font is selected, calculates the feature similarity between the outline features and other fonts in the built-in font library based on a similarity algorithm. This allows the selection of one or more fonts with the highest feature similarity from the built-in font library, and the user can choose whether to use these fonts to display the text in the CAD drawing. This method avoids issues such as garbled fonts or unclear display. Furthermore, the built-in font library in this application also supports importing new fonts for expansion. After viewing the document, an additional font file containing the manufacturer information of the CAD drawing can be obtained promptly. Importing this additional font file into the built-in font library enables subsequent updates and accurate display of the mapped fonts.

[0065] In addition, as a preferred embodiment, the front-end operating system in the above CAD viewing method is a Linux operating system, and the method further includes: S301: Deploy an image viewing service in front of the Linux operating system.

[0066] S302: When a drawing viewing request is received, determine whether the CAD drawing corresponding to the drawing viewing request is compatible with the Linux operating system.

[0067] S303: If it is determined that the CAD drawing is not compatible with the Linux operating system, then the step of selecting the mapped font corresponding to the text information from the built-in font library according to the applicable operating platform of the CAD drawing is executed.

[0068] S304: After rendering CAD drawings using mapped fonts, call the viewing service deployed on the Linux operating system front end to display the rendered CAD drawings.

[0069] Combination Figure 1 As can be seen from the architecture shown, the embodiments of this application are applicable to the Linux operating system. By deploying a drawing viewing service in front of the Linux operating system, the drawing can be viewed quickly, and the font display effect can be maintained in the Linux operating system in accordance with the original design CAD software.

[0070] Furthermore, the technical solution provided in this application embodiment enables the configurability and expansion of fonts during use. Specifically, in conjunction with... Figure 1 As shown in the architecture, after the solution is delivered to the customer, with the adjustment of the customer's business and the increase of drawings, it is necessary to configure and expand the font files of the original CAD software system. Based on the configurable method of "system + service + font", the service is deployed and the font is expanded and assembled. During the configuration process, the needs of accurate display of different CAD drawings are met. When the system does not need the drawing viewing service, the service can also be uninstalled to reduce the complexity of the system and avoid resource competition, thereby reducing operation and maintenance costs.

[0071] See also: Figure 3 , Figure 3 This is a flowchart illustrating the second CAD drawing viewing method supporting cross-platform font configuration provided in an embodiment of this application. (Combined with...) Figure 1 The architecture shown illustrates a CAD drawing viewing method that supports cross-platform font configuration, including: S410: The front end receives CAD drawing preview requests sent by users.

[0072] S420: The front end sends a request to the image viewing service.

[0073] S430: The microservice on the backend server accepts the request.

[0074] S440: A microservice that converts CAD drawing information and matches text based on the uploaded font library.

[0075] S450: Microservice storage is converted to a new file while retaining the source file, i.e., the original CAD drawing.

[0076] S460: The microservice returns the transformed file.

[0077] S470: Displays the converted CAD drawing information for users to view.

[0078] In summary, the CAD viewing solution supporting cross-platform font configuration provided in the above embodiments of this application can form a configurable online viewing method of "system + service + font", and this online viewing service has at least the following effects: This system separates the front-end operating system from the fonts, avoiding the downloading of many useless fonts and reducing redundancy. The font extensibility is increased, supporting the uploading of additional font files from various domestic CAD manufacturers, enhancing the software's portability and scalability, and accurately conveying the meaning of drawings. An independent drawing viewing service focuses on drawing conversion and presentation, using advanced processing technology to achieve rapid drawing format conversion—one-time conversion, permanent viewing—reducing conversion costs and improving the quality and stability of the system software. It improves the cross-platform compatibility of CAD drawings, reducing the operation and maintenance costs for software service providers and software users, and improving the smoothness and user experience of cross-platform drawing viewing for enterprise users. The drawing viewing service and fonts support extended configuration, allowing enterprise customers to customize them according to their needs, reducing subsequent software maintenance costs.

[0079] Furthermore, the beneficial effects of the product embodiments provided in the following embodiments of this application are the same as the beneficial effects of the CAD drawing viewing method provided in the above embodiments, and other technical features in the product embodiments are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.

[0080] See Figure 4, Figure 4 This is a schematic diagram of a CAD viewing device that supports cross-platform font configuration, provided as an embodiment of this application. Figure 4 As shown, the CAD viewing device includes: The request receiving module 110 is used to receive drawing viewing requests sent by the front-end operating system; The drawing parsing module 120 is used to parse the CAD drawing corresponding to the drawing viewing request according to the image parsing algorithm to obtain drawing parsing information, which includes text information. The font selection module 130 is used to select the mapped font corresponding to the text information from the built-in font library of the back-end server according to the applicable operating platform of the CAD drawing. The built-in font library includes mapped fonts applicable to different operating platforms. The font rendering module 140 is used to render CAD drawings using mapped fonts and send the corresponding viewing file of the CAD drawing to the front-end operating system.

[0081] In summary, the CAD drawing viewer supporting cross-platform font configuration provided in this application embodiment first needs to configure mapped fonts applicable to different operating platforms in the built-in font library of the backend server, including fonts applicable to Linux operating systems and Windows operating systems. Thus, when the request receiving module 110 receives a drawing viewing request sent by the front-end operating system, the drawing parsing module 120 can parse the CAD drawing corresponding to the drawing viewing request according to the image parsing algorithm, obtaining drawing parsing information including text information. Then, the font selection module 130 can determine the operating platform applicable to the CAD drawing, especially the text information, and select the mapped font corresponding to the text information from the built-in font library of the backend server according to the operating platform applicable to the CAD drawing. Since the fonts in the built-in font library are applicable to different operating platforms, this can be achieved by importing fonts from additional font libraries through manufacturer information and application information. In this way, the font rendering module 140 can display the CAD drawing on the local operating platform (e.g., on a Linux operating system). Specifically, after selecting a mapped font from the built-in font library, the CAD drawing is rendered using this mapped font. The corresponding viewing file for the CAD drawing can then be sent to the front-end operating system, such as Linux, to display the CAD drawing, including displaying the text information within the CAD drawing using the mapped font. This method enriches font selection, optimizes font presentation quality in the CAD design environment, and enables cross-platform font configuration for CAD drawings across different operating systems. This solves problems in existing technologies where font incompatibility with platforms leads to issues such as missing fonts, incompatible font formats, unclear drawings, incomplete rendering, and lost or distorted drawing information. It also reduces the increased software purchase costs for businesses and users due to the difficulty of cross-platform operation of CAD drawings, hindering operational efficiency and business expansion, thereby enhancing the company's market competitiveness and long-term profitability.

[0082] In addition, see Figure 5 The electronic device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the CAD viewing method supporting cross-platform font configuration of any of the above embodiments.

[0083] The following is for reference. Figure 5The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments can include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0084] like Figure 5 As shown, the electronic device can include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory ROM 1002 or a program loaded from a storage device 1003 into a random access memory RAM 1004. The RAM 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication device 1009 can operate the electronic device to exchange data with other devices via wireless or wired communication. Although the diagram shows a model building device with various systems, it should be understood that it is not required to implement or have all of the systems shown. It is possible to implement or have more or fewer systems alternatively.

[0085] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application. This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to perform the CAD viewing method supporting cross-platform font configuration in the above embodiments.

[0086] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0087] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0088] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0089] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0090] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A CAD drawing viewing method that supports cross-platform font configuration, characterized in that, include: Receive drawing viewing requests sent by the front-end operating system; According to the image parsing algorithm, the CAD drawing corresponding to the drawing viewing request is parsed to obtain drawing parsing information, wherein the drawing parsing information includes text information; According to the applicable operating platform of the CAD drawing, the mapping font corresponding to the text information is selected from the built-in font library of the back-end server, wherein the built-in font library includes mapping fonts applicable to different operating platforms; The mapped font is used to render the CAD drawing, and the corresponding viewing file of the CAD drawing is sent to the front-end operating system.

2. The method as described in claim 1, characterized in that, Before the step of receiving the drawing viewing request sent by the front-end operating system, the method further includes: The built-in font library is generated on the backend server; Import mapping fonts that are compatible with multiple operating platforms into the built-in font library; Obtain font files for various CAD applications, and import the mapped fonts from the font files into the built-in font library according to the operating platform corresponding to the CAD application. In the built-in font library, a mapping relationship is established between each mapped font and its corresponding glyph feature code.

3. The method as described in claim 1 or 2, characterized in that, The step of parsing the CAD drawing corresponding to the drawing viewing request according to the image parsing algorithm to obtain the drawing parsing information includes: Using a graphic element recognition and classification algorithm, feature points of graphic elements in the CAD drawing are extracted, and the feature points are classified according to the type of the graphic element. Using layer and block processing algorithms, the target processing object in the CAD drawing is located, and the attribute features of the target processing object are extracted. By combining the feature points of the graphic elements and the attribute features of the target processing object, the drawing parsing information is obtained.

4. The method as described in claim 2, characterized in that, The step of selecting the mapped font corresponding to the text information from the built-in font library of the backend server according to the applicable operating platform of the CAD drawing includes: Using a contour feature extraction algorithm, the contour features of text information are extracted from the parsed information of the drawing. Based on the outline features, establish the glyph feature encoding corresponding to the text information; Based on the mapping relationship between the mapped font and the glyph feature code, and combined with the operating platform applicable to the CAD drawing, the mapped font corresponding to the text information is selected from the built-in font library.

5. The method as described in claim 4, characterized in that, The step of rendering the CAD drawing using the mapped font and sending the corresponding viewing file of the CAD drawing to the front-end operating system includes: Based on the parsed drawing information, a format conversion algorithm is used to convert the CAD drawing into a unified format drawing data. The unified format drawing data is stored, and a viewing file corresponding to the drawing data is generated under a specified path on the backend server. The file to be viewed is sent to the front-end operating system, and the file is displayed on the front-end operating system.

6. The method as described in claim 4, characterized in that, The step of selecting the mapped font corresponding to the text information from the built-in font library of the backend server according to the applicable operating platform of the CAD drawing further includes: Determine whether the mapped font has been selected from the built-in font library; If the mapped font is not selected, the similarity between the outline feature and the features of other fonts in the built-in font library is calculated according to the similarity algorithm. From the built-in font library, temporarily select the font with the highest feature similarity as the mapping font corresponding to the text information; as well as, After selecting the mapped font corresponding to the text information, obtain the manufacturer information of the CAD drawing; Obtain the additional font file corresponding to the manufacturer information; Import the additional font file into the built-in font library.

7. The method as described in claim 1, characterized in that, The front-end operating system is a Linux operating system, and the method further includes: Deploy an image viewing service in front of the Linux operating system; When the drawing viewing request is received, it is determined whether the CAD drawing corresponding to the drawing viewing request is applicable to the Linux operating system; If it is determined that the CAD drawing is not applicable to the Linux operating system, then the step of selecting the mapped font corresponding to the text information from the built-in font library according to the applicable operating platform of the CAD drawing is executed; After rendering the CAD drawing using the mapped font, the rendering CAD drawing is displayed by calling the image viewing service of the Linux operating system.

8. A CAD drawing viewer that supports cross-platform font configuration, characterized in that, include: The request receiving module is used to receive drawing viewing requests sent by the front-end operating system; The drawing parsing module is used to parse the CAD drawing corresponding to the drawing viewing request according to the image parsing algorithm to obtain drawing parsing information, wherein the drawing parsing information includes text information; The font selection module is used to select the mapped font corresponding to the text information from the built-in font library of the back-end server according to the applicable operating platform of the CAD drawing. The built-in font library includes mapped fonts applicable to different operating platforms. The font rendering module is used to render the CAD drawing using the mapped font and send the viewing file corresponding to the CAD drawing to the front-end operating system.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the CAD viewing method that supports cross-platform font configuration as described in any one of claims 1 to 7.

10. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the CAD viewing method that supports cross-platform font configuration as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for realizing online browsing of CAD drawings

    CN107368622A

  • Method and device for matching fonts under different operation systems

    CN102739969A

  • CAD drawing loading method and device, font file replacement method and device and storage medium

    CN113886906A

  • Cross-platform collaborative loading method for CAD drawing

    CN120315778A

  • Method and system for converting CAD drawing into spatial data and making map

    CN120687411A

Cited By

  • Automatic font collection and missing font supplementation method applied to DWG drawing

    CN121833989A