Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PrintTemplateDoc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BusinessDoc
PrintTemplateDoc
Commits
2433915d
Commit
2433915d
authored
Dec 05, 2019
by
GYR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
a1f0ddaf
Pipeline
#259
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
README.md
README.md
+12
-12
No files found.
README.md
View file @
2433915d
...
...
@@ -7,8 +7,8 @@
203dpi: 1mm = 8dot
300dpi: 1mm = 12dot
### 中文编码格式:GB2312
1个小写字母、数字、英文字符 = 1个字节
1个中文字、大写字母 = 2个字节
1个小写字母、数字、英文字符 = 1个字节
1个中文字、大写字母 = 2个字节
### 单倍字节大小:1.25mm
将每一个打印字符,以GB2312的编码格式转字节,单字节字符宽度为1.25mm(如:小写字母、数字、英文字符)
,双字节字符宽度为1.25mm
*
2 = 2.5mm(如:中文字、大写英文字母)
...
...
@@ -19,15 +19,15 @@
3倍宽字体,字体间距为:0.25
*
7 = 0.75mm
### 字体打印宽度计算规则
1个单倍宽单字节字体(如:小写字母、数字、英文字符)的打印宽度 = 1
*
1.25 + 0.25 = 1.5mm
1个单倍宽双字节字体(如:中文字、大写英文字母)的打印宽度 = 2
*
1.25 + 0.25 = 2.75mm
1个x倍宽单字节字体(如:小写字母、数字、英文字符)的打印宽度 = x
* (1.25 + 0.25) = x *
1.5mm
1个x倍宽双字节字体(如:中文字、大写英文字母)的打印宽度 = x
* (2 *
1.25 + 0.25) = x
*
2.75mm
1个单倍宽单字节字体(如:小写字母、数字、英文字符)的打印宽度 = 1
*
1.25 + 0.25 = 1.5mm
1个单倍宽双字节字体(如:中文字、大写英文字母)的打印宽度 = 2
*
1.25 + 0.25 = 2.75mm
1个x倍宽单字节字体(如:小写字母、数字、英文字符)的打印宽度 = x
* (1.25 + 0.25) = x *
1.5mm
1个x倍宽双字节字体(如:中文字、大写英文字母)的打印宽度 = x
* (2 *
1.25 + 0.25) = x
*
2.75mm
### 打印起始位置计算规则
基于pos打印机逐行打印原理,打印的垂直位置,只能依靠换行来实现。
因此垂直位置不需要我们区计算,只需、也只能通过换行来调整垂直打印位置;
水平打印起始位置,则需要我们计算:
水平打印最小单位是:1dot
以每行最左侧为原点(0),用距离原点的距离x(单位:mm)
*
每mm对应的dot数,取整,得出水平坐标值
⚠️注意:多倍(x)宽字体打印,且右对齐打印时,需起始打印位置需向右偏移(x-1)
*
单倍字符间距(0.25mm)的距离,保证打印内容能够右对齐
基于pos打印机逐行打印原理,打印的垂直位置,只能依靠换行来实现。
因此垂直位置不需要我们区计算,只需、也只能通过换行来调整垂直打印位置;
水平打印起始位置,则需要我们计算:
水平打印最小单位是:1dot
以每行最左侧为原点(0),用距离原点的距离x(单位:mm)
*
每mm对应的dot数,取整,得出水平坐标值
⚠️注意:多倍(x)宽字体打印,且右对齐打印时,需起始打印位置需向右偏移(x-1)
*
单倍字符间距(0.25mm)的距离,保证打印内容能够右对齐
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment