Two-color printing method based on thermal printer

By using dual-color thermal printing technology and temperature gradient control of dual-color thermal paper and printhead, key information in commercial transaction documents can be highlighted, solving the problem of low information recognition in monochrome printing technology and improving information reading efficiency.

CN121179879APending Publication Date: 2025-12-23FUJIAN NEWLAND PAYMENT TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511546373.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing monochrome thermal printing technology has low information recognition in commercial transaction scenarios, making it difficult to highlight key information and failing to meet the hierarchical labeling requirements of different types of information, resulting in low reading efficiency and easy errors for users.

Method used

A two-color printing method based on thermal printers is adopted. By using two-color thermal paper with layered thermal coating and temperature gradient control of the print head, combined with 2-bit data encoding rules, two-color output such as red and black is achieved, with key information highlighted in the second color.

Benefits of technology

It improves information recognition and reduces the information reading error rate, making it particularly suitable for scenarios with frequent transactions such as supermarkets and convenience stores.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121179879A_ABST
    Figure CN121179879A_ABST
Patent Text Reader

Abstract

The invention discloses a two-color printing method based on a thermal printer. The two-color printing method comprises the steps that a two-color printing mode is started; performing color configuration on different types of to-be-printed information, and respectively setting the to-be-printed information as a first color and a second color; converting the character data to be printed into dot matrix data; according to the color configuration, converting the dot matrix data into double-color printing dot matrix data according to a double-color printing data encoding format; the control chip of the thermal printer separates second color printing data from the two-color printing dot matrix data, and respectively restores all the two-color printing dot matrix data and the second color printing data into 1-bit single-color printing dot matrix data; calculating the first color heating time and the second color heating time of the double-color thermo-sensitive paper according to the restored double-color printing dot matrix data and the second color printing data; and according to the first color heating time and the second color heating time, the printing head is controlled to heat the two-color thermo-sensitive paper in a time-sharing mode, and two-color printing is achieved. The printing information identification degree can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of thermal printing, and particularly to a dual-color printing method based on a thermal printer. Background Art

[0002] In the current commercial transaction scenarios, thermal printers equipped with POS terminal devices generally adopt monochromatic printing technology, and the content of transaction vouchers, receipts, etc. output is all of a single color (mostly black). The core principle of the existing monochromatic thermal printing technology is to utilize the single-layer heat-sensitive coating of monochromatic thermal paper. By applying a fixed temperature heating through a print head, a chemical reaction occurs in the heat-sensitive layer of a specific area on the paper surface (such as the reaction between fluoran dyes and acidic developers), thereby presenting text and patterns of a single color. Its design purpose is to quickly output basic information related to transactions, such as merchant number, terminal number, transaction date and time, transaction type, etc., to meet the basic requirements of information recording and retention in commercial transactions. From the perspective of technical measures, the print head of the existing monochromatic printing technology only needs to heat the thermal paper at a fixed temperature (usually 120 - 150°C) and for a fixed heating duration, without the need for temperature gradient control; the data encoding uses 1-bit monochromatic printing dot matrix data to control the "heating / non-heating" state of a single data point, without the need to distinguish color information; the function design of the print driver also only focuses on monochromatic data processing and does not involve dual-color data separation and differential temperature control logic. In terms of actual application effects, the monochromatic printing technology has certain advantages. For example, the printing speed is relatively fast, and the unit price of monochromatic thermal paper is relatively low, which reduces the long-term use cost of merchants to a certain extent. However, with the increasing demand for refined display of voucher information in commercial transaction scenarios, the deficiencies of the existing monochromatic printing technology have become increasingly prominent. First, the information recognition rate is low. The key information (such as transaction amount, card organization logo, authorization code) in the transaction voucher is mixed with ordinary auxiliary information (such as merchant address, terminal model). When users quickly check the voucher, they need to search for the core content line by line, which not only takes time but is also prone to information reading errors (such as misreading the transaction amount, missing the authorization code) due to visual fatigue, especially during peak transaction periods (such as supermarket cashiering, restaurant settlement), this problem is more obvious. Second, the function extensibility is poor. The existing technology cannot meet the hierarchical identification requirements of different types of information. For example, some merchants hope to configure special contents such as "refund amount" and "preferential information" with different colors, while the monochromatic printing technology can only achieve limited differentiation through methods such as bold and enlarged fonts, and the effect is not good. The above problems seriously restrict the application expansion of POS terminal devices in diverse commercial scenarios. Therefore, developing a dual-color printing technology solution has become an urgent need in the industry. Summary of the Invention

[0003] In view of this, the purpose of this invention is to propose a two-color printing method based on a thermal printer to solve the problems of low information recognition and difficulty in highlighting key information in existing monochrome printing technology.

[0004] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows: This invention provides a two-color printing method based on a thermal printer, comprising the following steps: Step 1: Enable two-color printing mode; Step 2: Divide the information to be printed into two categories according to the importance of the printed content, and configure the colors of the different categories of information to be printed, setting them to the first color and the second color respectively; Step 3: Convert the character data to be printed into dot matrix data; Step 4: Convert the dot matrix data into two-color printing dot matrix data according to the color configuration and the two-color printing data encoding format. Each data point is allocated 2 bits of data for encoding color information and heating control. Step 5: The control chip of the thermal printer separates the second color printing data from the two-color printing dot matrix data, and restores all the two-color printing dot matrix data and the second color printing data into 1-bit single-color printing dot matrix data respectively. Step 6: Calculate the heating time of the first color and the heating time of the second color of the two-color thermal paper based on the restored two-color printing dot matrix data and the second color printing data. Step 7: Control the print head to heat the two-color thermal paper in a time-sharing manner according to the heating time of the first color and the heating time of the second color, so as to achieve two-color printing.

[0005] Furthermore, step 1 specifically includes: Step 11: The host computer sends a dual-color printing mode activation command to the control chip of the thermal printer; Step 12: After the control chip's print driver module receives the dual-color printing mode activation command, Set its internal operating state to two-color printing mode.

[0006] Furthermore, step 2 specifically includes: Step 21: Divide the information to be printed into key information and general information according to the importance of the content; Step 22: Mark key information with the first color and ordinary information with the second color; Step 23: The host computer configures the colors according to the labeled color type, dynamically setting key information in the printed content to the first color and ordinary information to the second color.

[0007] Furthermore, step 3 specifically includes: Step 31: Initialize the font rendering engine and load the selected TTF font library from the file system; Step 32: Configure the font size and display resolution for the character data to be processed; Step 33: Based on the input character data, query and obtain the corresponding font index from the loaded TTF font library; Step 34: Based on the character index, read the vector outline description information of the character data from the TTF font library; Step 35: Convert the vector contour description information into a grayscale or binary pixel array according to the font size and resolution; Step 36: Calculate the bounding box of the character data from the generated pixel matrix, extract the valid pixel data within the bounding box, and generate the corresponding pixel matrix data for output.

[0008] Furthermore, the specific encoding format for the two-color printing data in step 4 is as follows: The first bit is a color identifier bit used to identify the first color and the second color, where 0 represents the first color and 1 represents the second color; The second bit is a heating control bit used to control the printhead heating switch; 0 indicates no heating and 1 indicates heating is performed. The four data combinations formed by the two-color printing data encoding format and their meanings are as follows: When the data is "00" or "10", it means no heating; when the data is "11", it means heating with the first color; when the data is "01", it means heating with the second color. The step of converting the dot matrix data into two-color printing dot matrix data according to the color configuration and the two-color printing data encoding format specifically includes: Iterate through each data point in the given dot matrix data: If the data point's color is configured as the first color, then the encoding is 11; If the data point is configured with the second color, then the encoding is 01; If the data point has no color configuration, it is encoded as 00 or 10.

[0009] Furthermore, step 5 specifically includes: Step 51: Send the two-color printing dot matrix data to the control chip of the thermal printer; Step 52: After receiving the two-color printing dot matrix data, the control chip of the thermal printer traverses each 2-bit two-color printing dot matrix data of the current dot row, identifies the data points in which the color identifier bit is the second color and the heating control bit is in an active state, extracts and combines the identified data points to form the second color printing data. Step 53: Restore the second color printing data to 1-bit monochrome printing dot matrix data. The restored second color printing data only contains the data points that need to be displayed as the second color. Step 54: Extract all data points in the dual-color printing dot matrix data where the heating control bit is in an active state, and restore them to 1-bit monochrome printing dot matrix data. The restored dual-color printing dot matrix data contains all data points that need to be displayed as the first color and the second color.

[0010] Furthermore, step 6 specifically includes: Step 61: Determine the color distribution of the current row of printed data based on the restored two-color printing dot matrix data and the second-color printing data; Step 62: If all the printed data in the current row is the first color, calculate the heating time T based on the baseline heating time calculation method of monochrome thermal printing paper, and reduce the heating time T by m% to obtain the heating time T1 of the first color, that is, T1 = T×(1-m%); where the specific value of m can be set by the user according to the user's needs. Step 63: If all the printed data in the current row is the second color, calculate the heating time T based on the baseline heating time calculation method of monochrome thermal printing paper, and multiply the heating time T by n to obtain the heating time T2 of the second color, that is, T2 = T×n; where the specific value of n can be set by the user according to the user's needs. Step 64: If the printed data of the current row contains both the first color and the second color, then: The first reference heating time t1 is calculated based on the restored two-color printing dot matrix data; The second baseline heating time t2 is calculated based on the restored second color printing data. Reduce t1 by m% to get the heating time T1 of the first color, that is, T1 = t1×(1-m%). Multiplying t2 by n gives the heating time T2 for the second color, i.e., T2 = t2×n.

[0011] Furthermore, the method for calculating the reference heating time based on monochrome thermal printing paper is as follows:

[0012] Where t represents the printhead heating pulse width, E represents the printing energy, and R represents the calibrated resistance. The value is V, which represents the calibrated voltage value, and C represents the printhead heating pulse cycle coefficient.

[0013] Furthermore, step 7 specifically includes: Step 71: If all the printed data in the current row is the first color, control the print head to apply a heating pulse with a duration of the first color heating time T1 to all data points in the row. Step 72: If all the printed data in the current row is the second color, control the print head to apply a heating pulse with a duration of the second color heating time T2 to all data points in the row. Step 73: If the print data of the current line contains both the first color and the second color, control the print head to heat according to the following timing sequence: First, a heating pulse with a duration of the first color heating time T1 is applied to all data points in the current row to activate the low melting point thermal layer of the two-color thermal paper and develop the first color. Next, a supplementary heating pulse with a duration of time T2-T1 is applied only to the data points corresponding to the restored second color printing data to activate the high melting point thermal layer in the area corresponding to the restored second color printing data, thereby covering and developing the second color.

[0014] Furthermore, the dual-color thermal paper comprises, from top to bottom: A low-melting-point thermally sensitive layer undergoes a chemical reaction to develop the first color when its temperature exceeds a first temperature threshold. Clear layer, used to enhance color contrast; A high-melting-point heat-sensitive layer undergoes a chemical reaction to develop a second color when its temperature is higher than a second temperature threshold, and the second temperature threshold is higher than the first temperature threshold.

[0015] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: The overall solution of this invention is based on the existing thermal printer architecture. It achieves two-color printing through "software modification + adaptation to dedicated two-color thermal paper." The core includes two major modules: modification of the print driver and design of the two-color data processing flow. The technical principle is as follows: utilizing the layered thermal coating of the two-color thermal paper (the low-melting-point thermal layer displays the first color, the high-melting-point thermal layer displays the second color, and the clearing layer enhances contrast), and through printhead temperature gradient control (short-term low temperature activates the first color, long-term high temperature activates the second color), combined with 2-bit data encoding rules (1 bit to identify the color, 1 bit to control heating), two-color output in a single print is achieved.

[0016] This invention solves the problem of low efficiency and error-prone reading of key information and ordinary information on transaction vouchers due to the lack of color differentiation in existing monochrome printing. By modifying the printing data and driver of existing thermal printers and using dedicated dual-color thermal paper, it achieves dual-color printing output, including red and black, which can be widely used in scenarios such as printing merchant transaction vouchers and receipts. Through dual-color printing technology, key information (such as transaction amount, card organization, authorization code, etc.) in the transaction voucher is highlighted with a second color (such as red), while ordinary information is displayed with a first color (such as black), giving the information a sense of hierarchy and improving information recognition. Actual testing shows that users find it faster to locate key information when viewing dual-color printed transaction vouchers compared to monochrome printed vouchers, effectively reducing the information reading error rate and improving information reading efficiency. This is especially suitable for scenarios with frequent transactions, such as supermarkets and convenience stores, where users need to quickly verify information. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Fig. 1 This is an execution flowchart of a two-color printing method based on a thermal printer provided in an embodiment of the present invention.

[0019] Fig. 2 This is a flowchart illustrating the calculation scheme for the heating time of the first color and the heating time of the second color under different conditions provided in the embodiments of the present invention.

[0020] Fig. 3 This is a flowchart of heating strategies under different conditions provided in the embodiments of the present invention. Detailed Implementation

[0021] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Please see Figs. 1-3 The present invention provides a two-color printing method based on a thermal printer, comprising the following steps: Step 1: Enable two-color printing mode; In this embodiment, step 1 specifically includes: Step 11: The host computer sends a dual-color printing mode activation command to the control chip of the thermal printer; Step 12: After the control chip's print driver module receives the dual-color printing mode activation command, Set its internal operating state to two-color printing mode.

[0023] Step 2: Divide the information to be printed into two categories according to the importance of the printed content, and configure the colors of the different categories of information to be printed, setting them to the first color and the second color respectively; In this embodiment, step 2 specifically includes: Step 21: Divide the information to be printed into key information and general information according to the importance of the content; Step 22: Mark key information with the first color and ordinary information with the second color; Step 23: The host computer configures the colors according to the labeled color type, dynamically setting key information in the printed content to the first color and ordinary information to the second color.

[0024] Step 3: Convert the character data to be printed into dot matrix data; In this embodiment, step 3 specifically includes: Step 31: Initialize the font rendering engine and load the selected TTF font library from the file system; Step 32: Configure the font size and display resolution for the character data to be processed; Step 33: Based on the input character data, query and obtain the corresponding font index from the loaded TTF font library; Step 34: Based on the character index, read the vector outline description information of the character data from the TTF font library; Step 35: Convert the vector contour description information into a grayscale or binary pixel array according to the font size and resolution; Step 36: Calculate the bounding box of the character data from the generated pixel matrix, extract the valid pixel data within the bounding box, and generate the corresponding pixel matrix data for output.

[0025] Step 4: Convert the dot matrix data into two-color printing dot matrix data according to the color configuration and the two-color printing data encoding format. Each data point is allocated 2 bits of data for encoding color information and heating control. In this embodiment, the two-color printing data encoding format in step 4 is specifically as follows: The first bit is a color identifier bit used to identify the first and second colors, where 0 represents the first color and 1 represents the second color; the second bit is a heating control bit used to control the printhead heating switch, where 0 indicates no heating and 1 indicates heating is performed; this ensures that each data point can accurately represent the target color; the four data combinations formed by the two-color printing data encoding format and their meanings are as follows: When the data is "00" or "10", it means no heating; when the data is "11", it means heating with the first color; when the data is "01", it means heating with the second color. The step of converting the dot matrix data into two-color printing dot matrix data according to the color configuration and the two-color printing data encoding format specifically includes: Iterate through each data point in the given dot matrix data: If the data point's color is configured as the first color, then the encoding is 11; If the data point is configured with the second color, then the encoding is 01; If the data point has no color configuration, it is encoded as 00 or 10.

[0026] 2-bit dual-color printing data encoding format design: Breaking through the limitations of traditional 1-bit monochrome encoding, it assigns 2 bits of data to each data point (the first bit identifies the color, and the second bit controls heating), constructing an encoding rule of "00 - no color development, 11 - first color, 01 - second color, 10 - no color development", realizing accurate mapping between data point color and heating status, providing underlying technical support for dual-color printing data transmission and parsing, and solving the problem that monochrome encoding cannot distinguish color information.

[0027] Step 5: The control chip of the thermal printer separates the second color printing data from the two-color printing dot matrix data, and restores all the two-color printing dot matrix data and the second color printing data into 1-bit single-color printing dot matrix data respectively. In this embodiment, step 5 specifically includes: Step 51: Send the two-color printing dot matrix data to the control chip of the thermal printer; Step 52: After receiving the two-color printing dot matrix data, the control chip of the thermal printer traverses each 2-bit two-color printing dot matrix data of the current dot row, identifies the data points in which the color identifier bit is the second color and the heating control bit is in an active state, extracts and combines the identified data points to form the second color printing data. Step 53: Restore the second color printing data to 1-bit monochrome printing dot matrix data. The restored second color printing data only contains the data points that need to be displayed as the second color. Step 54: Extract all data points in the dual-color printing dot matrix data where the heating control bit is in an active state, and restore them to 1-bit monochrome printing dot matrix data. The restored dual-color printing dot matrix data contains all data points that need to be displayed as the first color and the second color.

[0028] Dual-color printing dot matrix data separation and driver adaptation architecture: In the control chip driver of the thermal printer, the 2-bit dual-color printing dot matrix data is restored into two types of 1-bit single-color printing dot matrix data (full dual-color printing dot matrix data and second color printing data). With the timing control of "first heating the full data to activate the first color, and then heating the second color printing data to display the second color", dual-color output can be achieved without modifying the print head hardware, only through driver logic optimization, reducing hardware upgrade costs and compatibility risks.

[0029] Step 6: Calculate the heating time of the first color and the heating time of the second color of the two-color thermal paper based on the restored two-color printing dot matrix data and the second color printing data. In this embodiment, step 6 specifically includes: Step 61: Determine the color distribution of the current row of printed data based on the restored two-color printing dot matrix data and the second-color printing data; Step 62: If all the printed data in the current row is the first color, calculate the heating time T based on the baseline heating time calculation method for monochrome thermal printing paper, and reduce the heating time T by m% to obtain the heating time T1 for the first color, i.e., T1 = T×(1-m%); where the specific value of m can be set according to user needs; in this embodiment, the value of m% is 15%; The method for calculating the reference heating time based on monochrome thermal printing paper is as follows:

[0030] Where t represents the printhead heating pulse width, E represents the printing energy, and R represents the calibrated resistance. The value is V, which represents the calibrated voltage value, and C represents the printhead heating pulse cycle coefficient.

[0031] Step 63: If all the printed data in the current row is the second color, calculate the heating time T based on the baseline heating time calculation method of monochrome thermal printing paper, and multiply the heating time T by n to obtain the heating time T2 of the second color, that is, T2 = T×n; where the specific value of n can be set by the user according to the user's needs; in this embodiment, the value of n is 3. Step 64: If the printed data of the current row contains both the first color and the second color, then: The first reference heating time t1 is calculated based on the restored two-color printing dot matrix data; The second baseline heating time t2 is calculated based on the restored second color printing data. Reduce t1 by m% to get the heating time T1 of the first color, that is, T1 = t1×(1-m%). Multiplying t2 by n gives the heating time T2 for the second color, i.e., T2 = t2×n.

[0032] Layered heating time dynamic calculation strategy: Based on the color distribution differences of the printed data of the current dot row, a differentiated heating time calculation logic is designed - pure color dot rows are adjusted according to "single color base time" (first color reduced by 15%, second color multiplied by 3), and mixed color dot rows are supplemented by "heating difference between total two-color time and second color time".

[0033] Step 7: Control the print head to heat the two-color thermal paper in a time-sharing manner according to the heating time of the first color and the heating time of the second color, so as to achieve two-color printing.

[0034] In this embodiment, step 7 specifically includes: Step 71: If all the printed data in the current row is the first color, control the print head to apply a heating pulse with a duration of the first color heating time T1 to all data points in the row. Step 72: If all the printed data in the current row is the second color, control the print head to apply a heating pulse with a duration of the second color heating time T2 to all data points in the row. Step 73: If the print data of the current line contains both the first color and the second color, control the print head to heat according to the following timing sequence: First, a heating pulse with a duration of the first color heating time T1 is applied to all data points in the current row to activate the low melting point thermal layer of the two-color thermal paper and develop the first color. Next, a supplementary heating pulse with a duration of time T2-T1 is applied only to the data points corresponding to the restored second color printing data to activate the high melting point thermal layer in the area corresponding to the restored second color printing data, thereby covering and developing the second color.

[0035] Step 8: After printing is complete, turn off the two-color printing mode. This includes: Step 81: The host computer sends a dual-color printing mode shutdown command to the control chip of the thermal printer; Step 82: After the control chip's print driver module receives the dual-color printing mode shutdown command, Turn off two-color printing mode.

[0036] The modular dual-color printing control logic constructs a complete control process of "dual-color mode activation - color setting - dot matrix conversion - data processing - heating output - mode deactivation". Flexible control is achieved through dual-color printing mode activation and color configuration commands, supporting color control down to each data point, meeting the layered display requirements of key information (red) and ordinary information (black) in transaction vouchers, and improving information recognition.

[0037] In this embodiment, the two-color thermal paper comprises, from top to bottom: A low-melting-point thermally sensitive layer undergoes a chemical reaction to develop the first color when its temperature exceeds a first temperature threshold. Clear layer, used to enhance color contrast; A high-melting-point heat-sensitive layer undergoes a chemical reaction to develop a second color when its temperature is higher than a second temperature threshold, and the second temperature threshold is higher than the first temperature threshold.

[0038] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A two-color printing method based on a thermal printer, characterized in that, Includes the following steps: Step 1: Enable two-color printing mode; Step 2: Divide the information to be printed into two categories according to the importance of the printed content, and configure the colors of the different categories of information to be printed, setting them to the first color and the second color respectively; Step 3: Convert the character data to be printed into dot matrix data; Step 4: Convert the dot matrix data into two-color printing dot matrix data according to the color configuration and the two-color printing data encoding format. Each data point is allocated 2 bits of data for encoding color information and heating control. Step 5: The control chip of the thermal printer separates the second color printing data from the two-color printing dot matrix data, and restores all the two-color printing dot matrix data and the second color printing data into 1-bit single-color printing dot matrix data respectively. Step 6: Calculate the heating time of the first color and the heating time of the second color of the two-color thermal paper based on the restored two-color printing dot matrix data and the second color printing data. Step 7: Control the print head to heat the two-color thermal paper in a time-sharing manner according to the heating time of the first color and the heating time of the second color, so as to achieve two-color printing.

2. The two-color printing method based on a thermal printer as described in claim 1, characterized in that, Step 1 specifically includes: Step 11: The host computer sends a dual-color printing mode activation command to the control chip of the thermal printer; Step 12: After the control chip's print driver module receives the dual-color printing mode activation command, Set its internal operating state to two-color printing mode.

3. The two-color printing method based on a thermal printer according to claim 1, characterized in that, Step 2 specifically includes: Step 21: Divide the information to be printed into key information and general information according to the importance of the content; Step 22: Mark key information with the first color and ordinary information with the second color; Step 23: The host computer configures the colors according to the labeled color type, dynamically setting key information in the printed content to the first color and ordinary information to the second color.

4. The two-color printing method based on a thermal printer according to claim 1, characterized in that, Step 3 specifically includes: Step 31: Initialize the font rendering engine and load the selected TTF font library from the file system; Step 32: Configure the font size and display resolution for the character data to be processed; Step 33: Based on the input character data, query and obtain the corresponding font index from the loaded TTF font library; Step 34: Based on the character index, read the vector outline description information of the character data from the TTF font library; Step 35: Convert the vector contour description information into a grayscale or binary pixel array according to the font size and resolution; Step 36: Calculate the bounding box of the character data from the generated pixel matrix, extract the valid pixel data within the bounding box, and generate the corresponding pixel matrix data for output.

5. A two-color printing method based on a thermal printer as described in claim 1, characterized in that, The specific encoding format for the two-color printing data in step 4 is as follows: The first bit is a color identifier bit used to identify the first color and the second color, where 0 represents the first color and 1 represents the second color; The second bit is a heating control bit used to control the printhead heating switch; 0 indicates no heating and 1 indicates heating is performed. The four data combinations formed by the two-color printing data encoding format and their meanings are as follows: When the data is "00" or "10", it means no heating; when the data is "11", it means heating with the first color; when the data is "01", it means heating with the second color. The step of converting the dot matrix data into two-color printing dot matrix data according to the color configuration and the two-color printing data encoding format specifically includes: Iterate through each data point in the given dot matrix data: If the data point's color is configured as the first color, then the encoding is 11; If the data point is configured with the second color, then the encoding is 01; If the data point has no color configuration, it is encoded as 00 or 10.

6. The two-color printing method based on a thermal printer as described in claim 1, characterized in that, Step 5 specifically includes: Step 51: Send the two-color printing dot matrix data to the control chip of the thermal printer; Step 52: After receiving the two-color printing dot matrix data, the control chip of the thermal printer traverses each 2-bit two-color printing dot matrix data of the current dot row, identifies the data points in which the color identifier bit is the second color and the heating control bit is in an active state, extracts and combines the identified data points to form the second color printing data. Step 53: Restore the second color printing data to 1-bit monochrome printing dot matrix data. The restored second color printing data only contains the data points that need to be displayed as the second color. Step 54: Extract all data points in the dual-color printing dot matrix data where the heating control bit is in an active state, and restore them to 1-bit monochrome printing dot matrix data. The restored dual-color printing dot matrix data contains all data points that need to be displayed as the first color and the second color.

7. A two-color printing method based on a thermal printer as described in claim 1, characterized in that, Step 6 specifically includes: Step 61: Determine the color distribution of the current row of printed data based on the restored two-color printing dot matrix data and the second-color printing data; Step 62: If all the printed data in the current row is the first color, calculate the heating time T based on the baseline heating time calculation method of monochrome thermal printing paper, and reduce the heating time T by m% to obtain the heating time T1 of the first color, that is, T1 = T×(1-m%); where the specific value of m can be set by the user according to the user's needs. Step 63: If all the printed data in the current row is the second color, calculate the heating time T based on the baseline heating time calculation method of monochrome thermal printing paper, and multiply the heating time T by n to obtain the heating time T2 of the second color, that is, T2 = T×n; where the specific value of n can be set by the user according to the user's needs. Step 64: If the printed data of the current row contains both the first color and the second color, then: The first reference heating time t1 is calculated based on the restored two-color printing dot matrix data; The second baseline heating time t2 is calculated based on the restored second color printing data. Reduce t1 by m% to get the heating time T1 of the first color, that is, T1 = t1×(1-m%). Multiplying t2 by n gives the heating time T2 for the second color, i.e., T2 = t2×n.

8. A two-color printing method based on a thermal printer according to claim 7, characterized in that, The method for calculating the reference heating time based on monochrome thermal printing paper is as follows: Where t represents the printhead heating pulse width, E represents the printing energy, and R represents the calibrated resistance. The value is V, which represents the calibrated voltage value, and C represents the printhead heating pulse cycle coefficient.

9. A two-color printing method based on a thermal printer as described in claim 1, characterized in that, Step 7 specifically includes: Step 71: If all the printed data in the current row is the first color, control the print head to apply a heating pulse with a duration of the first color heating time T1 to all data points in the row. Step 72: If all the printed data in the current row is the second color, control the print head to apply a heating pulse with a duration of the second color heating time T2 to all data points in the row. Step 73: If the print data of the current line contains both the first color and the second color, control the print head to heat according to the following timing sequence: First, a heating pulse with a duration of the first color heating time T1 is applied to all data points in the current row to activate the low melting point thermal layer of the two-color thermal paper and develop the first color. Next, a supplementary heating pulse with a duration of time T2 - T1 is applied only to the data points corresponding to the restored second color printing data to activate the high melting point thermal layer in the area corresponding to the restored second color printing data, thereby covering and developing the second color.

10. A two-color printing method based on a thermal printer as described in claim 1, characterized in that, The dual-color thermal paper comprises, from top to bottom: A low-melting-point thermally sensitive layer undergoes a chemical reaction to develop the first color when its temperature exceeds a first temperature threshold. Clear layer, used to enhance color contrast; A high-melting-point heat-sensitive layer undergoes a chemical reaction to develop a second color when its temperature is higher than a second temperature threshold, and the second temperature threshold is higher than the first temperature threshold.

Citation Information

Cited By

  • Red and black thermo-sensitive paper printing control method, system, equipment and medium

    CN121742780A