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
c54d5e44
Commit
c54d5e44
authored
Dec 05, 2019
by
GYR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
4f2daa91
Pipeline
#257
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
README.md
README.md
+29
-1
No files found.
README.md
View file @
c54d5e44
# PrintTemplateDoc
# PrintTemplateDoc
打印模版文档
打印模版文档
## ESC/POS
### 基本计算单位:mm(毫米)
### 基本打印单位:dot(点)
203dpi: 1mm = 8dot
300dpi: 1mm = 12dot
### 中文编码格式:GB2312,1个中文字 = 2个字符
### 单倍字节大小:1.25mm
将每一个打印字符,以GB2312的编码格式转字节,单字节字符宽度为1.25mm(如:小写字母、数字、英文字符)
,双字节字符宽度为1.25mm
*
2 = 2.5mm(如:中文字、大写英文字母)
### 单倍字体水平间距:0.25mm
无论是单字节字体还是双字节字体,单倍宽字体间距都为0.25mm,多倍宽字体间距为(0.25
*
宽度倍数)mm;
如:2倍宽字体,字体间距为:0.25
*
2 = 0.5mm
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
### 打印起始位置计算规则
基于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