Method and system for checking and performing variant glyph embedding based on glyph data

By checking and executing variant glyph embedding methods based on glyph glyph data, the problem of watermark embedding without Unicode encoded glyphs in text files is solved, embedding and multi-media extraction in text files are realized, and the invisibility and invisibility of watermarks are improved. Extraction convenience.

CN118277972BActive Publication Date: 2024-09-10HEFEI HIGH DIMENSIONAL DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410706004.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-10
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

Existing font watermark technology cannot embed glyph watermark information without Unicode encoding in text files, and cannot extract watermark information from screen photography and cross-media printing photography.

Method used

The variant font embedding method is implemented using a checksum based on glyph glyph data, extracting embedded font data information, parsing glyph glyph data and offsets, calculating checksums, obtaining grouping information, replacing byte information, and modifying offsets. Shift, realize font variant embedding, support Unicode encoded text files and multiple font formats (such as OTF, TTF, WOFF, WOFF2).

Benefits of technology

It realizes embedding Unicode-encoded glyph watermarks in text files, and supports screen photography and cross-media printing and photography to extract watermark information, which enhances the survivability and extraction convenience of watermarks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118277972B
    Figure CN118277972B
Patent Text Reader

Abstract

The present invention relates to a method and system for checking and executing variant glyph embedding based on glyph glyph data, which comprises extracting font data information embedded in a preset text file, obtaining local table information in the embedded font data information, parsing data information, offset and checksum of byte information of a single glyph glyph in the embedded font data information, obtaining grouping information of a single glyph glyph and byte information of glyph glyphs of multiple variants to be embedded, confirming byte information of glyph glyphs of target variants, replacing byte information of a single glyph glyph with byte information of glyph glyphs of target variants and modifying its offset, updating information of the embedded font correspondence table, and implementing embedding of variant glyphs of the embedded font. The present invention can solve the problem of glyph watermark embedding of embedded fonts without Unicode encoding, and also supports screen camera extraction, cross-media print camera extraction, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of font watermarking, and in particular to a method and system for verifying and embedding variant glyphs based on glyph data. Background Art

[0002] Digital watermarking, as an important technology for intellectual property protection and information security maintenance, has developed rapidly in recent years. The basic principle of digital watermarking is to embed hidden digital watermark information with certain significance in the carrier of multimedia data (such as text, images, audio and video, etc.). The embedded watermark information does not affect the use of the original multimedia carrier data, and the watermark information is transmitted and used together with the original carrier data. As an aspect of digital watermarking technology, text watermarking has attracted more and more attention. Font watermarking is a text watermarking technology that can encode specific watermark information (name, ID, etc.) and hide it in the glyphs that make up the document. Finally, the watermark information can be extracted by a specific program. The document after the embedded information does not look significantly changed, but in fact the document has been embedded with unique watermark information, which can achieve copyright protection and leakage traceability of text content without destroying the original document and without being noticed by people.

[0003] There are technical barriers to easily embedding font watermark information into text files. Currently, the commonly used font watermark technologies are:

[0004] (1) Font watermark technology based on document structure fine-tuning. Common documents, such as Word, PDF, and RTF, all have the function of setting text layout formats. Watermark information can be embedded by fine-tuning the text line spacing, font spacing, text shading, and font.

[0005] (2) Font watermark technology based on content replacement. This type of text watermark embedding technology regards the carrier text as a series of meaning sequences rather than text images. The embedding process is the process of converting the carrier text into a hidden text with the same or similar meaning.

[0006] (3) Font watermarking technology based on natural speech. Speech can be expressed in many ways. Without changing the original meaning, watermark information can be hidden by replacing, adding, and modifying the word order of some text. This type of text watermark embedding technology has a very high concealment and does not rely on text format and encoding.

[0007] (4) Font watermarking technology based on text imaging. This type of text watermark embedding technology has many characteristics of image watermarks, such as resistance to printing and scanning attacks, and the watermark has strong survivability.

[0008] The Internet is a network that connects the world. In order to ensure that people in different regions can display the correct text, Unicode is used. The current mainstream font watermark embedding technology is based on Unicode search and execution of the embedding process, resulting in the inability of existing mainstream font watermark technology to perform text embedded fonts without Unicode encoding.

[0009] In view of the problems existing in the prior art, the present invention proposes a method and system for verifying and executing variant glyph embedding based on glyph data. This technical solution can solve the problem of embedding glyph watermarks in text-embedded fonts without Unicode encoding, and also supports screen camera extraction, cross-media print camera extraction, etc. Summary of the invention

[0010] In order to solve the problem of embedding a glyph watermark in a text-embedded font without Unicode encoding, the present invention proposes a method and system for verifying and executing variant glyph embedding based on glyph data.

[0011] In a first aspect, the present invention provides a method for verifying and performing variant glyph embedding based on glyph data, which adopts the following technical solution, including:

[0012] S10, extracting font data information embedded in a preset text file, and obtaining local table information in the embedded font data information;

[0013] S20, parsing data information and offset of a single glyph in the embedded font data information according to local table information in the embedded font data information;

[0014] S30, calculating a checksum of byte information of a single glyph in the embedded font data information according to the data information and offset of the single glyph in the embedded font data information;

[0015] S40, acquiring grouping information of a single glyph in the embedded font data information and byte information of glyphs of multiple variants to be embedded according to a checksum of byte information of a single glyph in the embedded font data information;

[0016] S50, confirming the byte information of the glyph glyph of the target variant according to the grouping information of the single glyph glyph in the embedded font data information and the byte information of the glyph glyphs of the multiple variants to be embedded, replacing the byte information of the single glyph glyph in the embedded font data information with the byte information of the glyph glyph of the target variant and modifying the offset of the single glyph glyph in the embedded font data information;

[0017] S60: Update the information of the embedded font correspondence table according to the byte information and offset of the replaced single glyph in the embedded font data information, so as to embed the embedded font variant glyph into the text file.

[0018] Furthermore, in step S40, before obtaining the grouping information of a single glyph font in the embedded font data information and the byte information of the glyph fonts of multiple variants to be embedded, the method further includes:

[0019] S401, generating a font file containing the main body and the variant according to the mapping relationship between the main body unicode code and the variant of the preset font file;

[0020] S402, according to the font file containing the body and variants, obtaining data information of a single glyph in the body and variant data information, and forming a mapping relationship with the Unicode encoding of the character;

[0021] S403, calculating the checksum of the byte information of the single glyph in the body data information by a certain method;

[0022] S404: Obtain the pre-calculated grouping information of the single glyph font of the main body in the main body and variant data information by calculating in some method.

[0023] Furthermore, the text files mentioned in the above-mentioned method for verifying and embedding variant glyphs based on glyph data at least include: PDF, ofd, office files with embedded fonts, and web pages.

[0024] Furthermore, the text file embedded fonts mentioned in the above-mentioned method for verifying and performing variant glyph embedding based on glyph data include at least: OTF, TTF, WOFF, and WOFF2.

[0025] Furthermore, the checksum of the single glyph byte information in the body and embedded font data information mentioned in the method for performing variant glyph embedding based on the checksum of glyph data at least includes: a hash value and a cumulative sum.

[0026] In a second aspect, the present invention provides a system for verifying and performing variant glyph embedding based on glyp glyph data, which adopts the following technical solution: comprising:

[0027] Extract local table information module: extract local table information in the font data information embedded in the preset text file;

[0028] Parsing data information and offset acquisition module: parsing data information and offset of a single glyph font in the embedded font data information;

[0029] A checksum calculation module is configured to calculate the checksum of the single glyph byte information in the embedded font data information;

[0030] A module for obtaining grouping information and byte information: obtaining grouping information of a single glyph font in the embedded font data information and byte information of glyph fonts of multiple variants to be embedded;

[0031] Update data information module: replace the byte information of a single glyph font in the embedded font data information with the byte information of the target variant glyph font and modify the offset of the single glyph font in the embedded font data information;

[0032] The embedding module is used to embed the embedded font variant glyph into the text file.

[0033] In a third aspect, the present disclosure provides an electronic device comprising: a memory and a processor; the memory is used to store program instructions; the processor is used to call the program instructions in the memory so that the electronic device executes the method of checking glyph data based on the first aspect and performing variant glyph embedding in any possible design of the first aspect.

[0034] In a fourth aspect, the present disclosure provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, enables the electronic device to perform the method of checking glyph data based on the first aspect and performing variant glyph embedding in any possible design of the first aspect.

[0035] Compared with the prior art, the present invention has the following technical effects: it is not only applicable to PDF files but also to glyph invisible watermark embedding in files containing embedded fonts (OTF, TTF, WOFF, WOFF2, etc.). The character invisible watermark not only supports screen photography extraction, but also cross-media print photography extraction, and any medium with text can be extracted. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0037] Figure 1The present invention is a flowchart of a method for performing variant glyph embedding based on glyph data verification and execution.

[0038] Figure 2 A block diagram of a system for performing glyph data-based validation and variant glyph embedding.

[0039] Explanation of the accompanying drawings: 210, extracting local table information module; 220, parsing data information and offset acquisition module; 230, calculating checksum module; 240, obtaining grouping information and byte information module; 250, updating data information module; 260, embedding module. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.

[0042] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0043] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0044] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.

[0045] The optional embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0046] like Figure 1 As shown, a method for performing variant glyph embedding based on glyph data verification and execution specifically includes the following method steps:

[0047] S10, extracting font data information embedded in a preset text file, and obtaining local table information in the embedded font data information;

[0048] S20, parsing data information and offset of a single glyph in the embedded font data information according to local table information in the embedded font data information;

[0049] S30, calculating a checksum of byte information of a single glyph in the embedded font data information according to the data information and offset of the single glyph in the embedded font data information;

[0050] S40, acquiring grouping information of a single glyph in the embedded font data information and byte information of glyphs of multiple variants to be embedded according to a checksum of byte information of a single glyph in the embedded font data information;

[0051] S50, confirming the byte information of the glyph glyph of the target variant according to the grouping information of the single glyph glyph in the embedded font data information and the byte information of the glyph glyphs of the multiple variants to be embedded, replacing the byte information of the single glyph glyph in the embedded font data information with the byte information of the glyph glyph of the target variant and modifying the offset of the single glyph glyph in the embedded font data information;

[0052] S60: Update the information of the embedded font correspondence table according to the byte information and offset of the replaced single glyph in the embedded font data information, so as to embed the embedded font variant glyph into the text file.

[0053] In step S10, the text files include at least: PDF, ofd, office files with embedded fonts, and web pages.

[0054] The embedded fonts include at least: OTF, TTF, WOFF, and WOFF2.

[0055] The local table is responsible for providing the position or offset of a single glyph outline data in the font file.

[0056] In step S20, the data information and offset of a single glyph in the embedded font data information may be parsed according to the format of the embedded font and the official principle of the embedded font format.

[0057] In step S30, the information such as the offset and checksum of a single glyph in the embedded font data information facilitates navigation and access to a specific table in the embedded font.

[0058] The checksum of the single glyph byte information in the embedded font data information at least includes: a hash value and a cumulative sum.

[0059] In step S40, before obtaining the grouping information of a single glyph font in the embedded font data information and the byte information of the glyph fonts of multiple variants to be embedded, the following method steps are specifically included:

[0060] S401, generating a font file containing the main body and the variant according to the mapping relationship between the main body unicode code and the variant of the preset font file;

[0061] S402, according to the font file containing the body and the variants, obtaining data information of a single glyph in the body and the variant data information, and forming a mapping relationship with the Unicode code of the character;

[0062] S403, calculating the checksum of the byte information of the single glyph in the body data information by a certain method;

[0063] S404: Obtain the pre-calculated grouping information of the single glyph fonts in the above-mentioned base data and variant data information by calculating in some way.

[0064] In step S401, the font file containing the main body and the watermark character (font variant of the main body) is generated. Please refer to the invention patent "Font Generation Method, Storage Medium and Electronic Device", publication number: CN 116362202 B.

[0065] The embedded font can be OTF, TTF, WOFF, or WOFF2.

[0066] In step S403, the method for calculating the checksum of the single glyph font byte information in the body data information is consistent with the method for calculating the checksum of the single glyph font byte information in the embedded font data information in step S30, wherein the method for calculating the checksum of the single glyph font byte information in the body data information at least includes: a hash value and a cumulative sum.

[0067] In step S403, the grouping information of the above-mentioned entity and watermark characters (character variants of the entity) is calculated, as detailed in the invention patent "Character grouping method, storage medium and electronic device based on word spacing chain", publication number: CN 115455965 B.

[0068] In step S60, the font file correspondence table includes tables related to glyphs, such as a maxp table and a loca table.

[0069] Figure 1 An embodiment of a method for performing variant glyph embedding based on a checksum of glyph data is provided. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0070] Based on the same technical concept, such as Figure 2 As shown, the embodiment of the present invention also provides a system for checking and performing glyph embedding based on glyph variant data, adopting the following technical solution, the system comprising:

[0071] Extract local table information module: extract local table information in the font data information embedded in the preset text file;

[0072] Parsing data information and offset acquisition module: parsing data information and offset of a single glyph font in the embedded font data information;

[0073] A checksum calculation module is configured to calculate the checksum of the single glyph byte information in the embedded font data information;

[0074] A module for obtaining grouping information and byte information: obtaining grouping information of a single glyph font in the embedded font data information and byte information of glyph fonts of multiple variants to be embedded;

[0075] Update data information module: replace the byte information of a single glyph font in the embedded font data information with the byte information of the target variant glyph font and modify the offset of the single glyph font in the embedded font data information;

[0076] The embedding module is used to embed the embedded font variant glyph into the text file.

[0077] Furthermore, the present invention provides an electronic device, comprising: a memory and a processor; the memory is used to store program instructions; the processor is used to call the program instructions in the memory so that the electronic device executes the method of checking glyph variant data based on the first aspect and any possible design of the first aspect and executing variant embedding.

[0078] Furthermore, the present invention provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method for checking glyph variant data based on the first aspect and any possible design of the first aspect and executing variant glyph embedding.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for performing variant glyph embedding based on glyph data verification and execution, characterized in that: include: S10, extracting font data information embedded in a preset text file, and obtaining local table information in the embedded font data information; S20, parsing data information and offset of a single glyph in the embedded font data information according to the local table information in the embedded font data information; S30, calculating a checksum of byte information of a single glyph in the embedded font data information according to the data information and offset of the single glyph in the embedded font data information; S40, obtaining grouping information of a single glyph in the embedded font data information and byte information of glyphs of multiple variants to be embedded according to a checksum of byte information of a single glyph in the embedded font data information, including: S401, generating a font file containing the main body and the variant according to the mapping relationship between the main body unicode code and the variant of the preset font file; S402, according to the font file containing the body and variants, obtaining data information of a single glyph in the body and variant data information, and forming a mapping relationship with the Unicode encoding of the character; S403, calculating the checksum of the byte information of the single glyph in the body data information by a certain method; S404, obtaining the pre-calculated grouping information of a single entity glyph in the entity and variant data information by calculating by some method; S50, confirming the byte information of the glyph glyph of the target variant according to the grouping information of the single glyph glyph in the embedded font data information and the byte information of the glyph glyphs of the multiple variants to be embedded, replacing the byte information of the single glyph glyph in the embedded font data information with the byte information of the glyph glyph of the target variant and modifying the offset of the single glyph glyph in the embedded font data information; S60: Update the information of the embedded font correspondence table according to the byte information and offset of the replaced single glyph in the embedded font data information, so as to embed the embedded font variant glyph into the text file.

2. The method of claim 1, wherein: The text files at least include: PDF, ofd, office files with embedded fonts, and web pages.

3. The method of claim 1, wherein: The text file embedded fonts include at least: OTF, TTF, WOFF, and WOFF2.

4. The method of claim 1, wherein: The checksum of the single glyph byte information in the body data information at least includes: a hash value and a cumulative sum.

5. A system for verifying and performing variant glyph embedding based on glyph data, characterized in that: The method for checking and performing variant glyph embedding based on glyph data as claimed in any one of claims 1 to 4 is adopted, comprising: Extracting local table information module: extracting font data information embedded in a preset text file, and obtaining local table information in the embedded font data information; Parsing data information and offset acquisition module: parsing data information and offset of a single glyph in the embedded font data information according to local table information in the embedded font data information; A checksum calculation module: calculates the checksum of the byte information of a single glyph in the embedded font data information according to the data information and offset of the single glyph in the embedded font data information; A module for obtaining grouping information and byte information: obtaining grouping information of a single glyph in the embedded font data information and byte information of glyphs of multiple variants to be embedded according to a checksum of byte information of a single glyph in the embedded font data information; The data information updating module is configured to confirm the byte information of the glyph glyph of the target variant according to the grouping information of the single glyph glyph in the embedded font data information and the byte information of the glyph glyph of the multiple variants to be embedded, replace the byte information of the single glyph glyph in the embedded font data information with the byte information of the glyph glyph of the target variant and modify the offset of the single glyph glyph in the embedded font data information; Embedding module: updates the information of the embedded font correspondence table according to the byte information and offset of the replaced single glyph in the embedded font data information, so as to embed the embedded font variant glyph into the text file.

6. An electronic device comprising: one or more processors; Memory; and one or more computer programs; in The one or more computer programs are stored in the memory; it is characterized in that when the one or more processors execute the one or more computer programs, the electronic device implements the method for verifying and performing variant glyph embedding based on glyph data as described in any one of claims 1-4.

7. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the method for verifying and embedding variant glyphs based on glyph data as claimed in any one of claims 1 to 4.