Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
posprintdll
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yunpeng.song
posprintdll
Commits
f02d7b7b
Commit
f02d7b7b
authored
Sep 06, 2018
by
yunpeng.song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消指定的行字符长度,改为自动换行
parent
84839cf8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
50 deletions
+7
-50
LoadDll.cpp
+7
-50
No files found.
LoadDll.cpp
View file @
f02d7b7b
...
@@ -1171,59 +1171,16 @@ bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height)
...
@@ -1171,59 +1171,16 @@ bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height)
VC_POS_SetLineSpacing
(
0
);
VC_POS_SetLineSpacing
(
0
);
m_first
=
false
;
m_first
=
false
;
}
}
char
lineData
[
48
]
=
{
'\0'
};
int
linefms
=
LENTH_FMS_80
;
int
lineDataLength
=
0
,
index
=
0
,
lineDataSize
=
0
;
if
(
m_printclass
.
m_PrintSize
==
80
)
if
(
length
<
145
)
{
{
strncpy_s
(
lineData
,
sizeof
(
lineData
),
data
,
length
);
linefms
=
LENTH_FMS_56
;
VC_POS_S_TextOut
(
lineData
,
30
+
LENTH_FMS
+
LENTH_FMS_80
,
width
,
height
,
fontType
,
fontStyle
);
VC_POS_FeedLine
();
}
else
{
for
(;
index
<
length
;)
{
int
chlength
=
0
;
unsigned
char
ch
=
data
[
index
];
if
(
ch
>
0x7F
)
{
chlength
=
8
;
}
else
{
chlength
=
3
;
}
lineDataLength
+=
chlength
*
width
;
lineDataSize
+=
chlength
;
index
+=
chlength
;
if
(
40
<
lineDataLength
){
VC_Log_WriteLog
(
1
,
"%d|%d|%d|%d"
,
lineDataLength
,
lineDataSize
,
index
,
chlength
);
strncpy_s
(
lineData
,
sizeof
(
lineData
),
data
+
index
-
lineDataSize
,
lineDataSize
-
chlength
);
VC_Log_WriteLog
(
1
,
"%s"
,
lineData
);
VC_POS_S_TextOut
(
lineData
,
10
+
LENTH_FMS
+
LENTH_FMS_80
,
width
,
height
,
fontType
,
fontStyle
);
VC_POS_FeedLine
();
lineDataSize
=
0
;
lineDataLength
=
0
;
index
=
index
-
chlength
;
}
else
if
(
40
==
lineDataLength
)
{
strncpy_s
(
lineData
,
sizeof
(
lineData
),
data
+
index
-
lineDataSize
,
lineDataSize
);
VC_POS_S_TextOut
(
lineData
,
10
+
LENTH_FMS
+
LENTH_FMS_80
,
width
,
height
,
fontType
,
fontStyle
);
VC_POS_FeedLine
();
lineDataSize
=
0
;
lineDataLength
=
0
;
}
}
else
//char lineData[1024]={'\0'};
{
//strncpy_s(lineData,sizeof(lineData), data, length);
if
(
index
>=
length
)
VC_POS_S_TextOut
(
data
,
10
+
LENTH_FMS
+
linefms
,
width
,
height
,
fontType
,
fontStyle
);
{
strncpy_s
(
lineData
,
sizeof
(
lineData
),
data
+
index
-
lineDataSize
,
lineDataSize
);
VC_POS_S_TextOut
(
lineData
,
10
+
LENTH_FMS
+
LENTH_FMS_80
,
width
,
height
,
fontType
,
fontStyle
);
VC_POS_FeedLine
();
VC_POS_FeedLine
();
}
}
}
}
return
true
;
return
true
;
}
}
...
...
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