Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
de6edcc4
Commit
de6edcc4
authored
Sep 26, 2014
by
Dinar Ahmatnurov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing issue with "ёЁ";
parent
e9f7c4ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
drawing.cpp
modules/core/src/drawing.cpp
+15
-8
No files found.
modules/core/src/drawing.cpp
View file @
de6edcc4
...
...
@@ -1938,16 +1938,27 @@ static const int* getFontData(int fontFace)
return
ascii
;
}
inline
void
readCheck
(
int
&
c
,
int
&
i
,
const
string
&
text
,
const
int
rightBoundary
)
inline
void
readCheck
(
int
&
c
,
int
&
i
,
const
string
&
text
)
{
int
leftBoundary
=
' '
,
rightBoundary
=
127
;
if
(
c
>=
0x80
)
{
if
(
c
>=
0xC0
&&
c
<=
0xDF
)
//2 bytes utf
{
if
(
c
&
1
)
{
c
=
(
uchar
)
text
[
++
i
]
+
47
;
leftBoundary
=
175
;
rightBoundary
=
191
;
}
else
{
c
=
(
uchar
)
text
[
++
i
]
-
17
;
leftBoundary
=
127
;
rightBoundary
=
175
;
}
}
else
{
...
...
@@ -1969,7 +1980,7 @@ inline void readCheck(int &c, int &i, const string &text, const int rightBoundar
}
}
if
(
c
>=
rightBoundary
||
c
<
' '
)
if
(
c
>=
rightBoundary
||
c
<
leftBoundary
)
c
=
'?'
;
}
...
...
@@ -1998,14 +2009,12 @@ void putText( Mat& img, const string& text, Point org,
pts
.
reserve
(
1
<<
10
);
const
char
**
faces
=
cv
::
g_HersheyGlyphs
;
int
rightBoundary
=
fontFace
==
FONT_HERSHEY_COMPLEX
?
191
:
127
;
for
(
int
i
=
0
;
text
[
i
]
!=
'\0'
;
i
++
)
{
int
c
=
(
uchar
)
text
[
i
];
Point
p
;
readCheck
(
c
,
i
,
text
,
rightBoundary
);
readCheck
(
c
,
i
,
text
);
const
char
*
ptr
=
faces
[
ascii
[(
c
-
' '
)
+
1
]];
p
.
x
=
(
uchar
)
ptr
[
0
]
-
'R'
;
...
...
@@ -2047,14 +2056,12 @@ Size getTextSize( const string& text, int fontFace, double fontScale, int thickn
int
cap_line
=
(
ascii
[
0
]
>>
4
)
&
15
;
size
.
height
=
cvRound
((
cap_line
+
base_line
)
*
fontScale
+
(
thickness
+
1
)
/
2
);
int
rightBoundary
=
fontFace
==
FONT_HERSHEY_COMPLEX
?
191
:
127
;
for
(
int
i
=
0
;
text
[
i
]
!=
'\0'
;
i
++
)
{
int
c
=
(
uchar
)
text
[
i
];
Point
p
;
readCheck
(
c
,
i
,
text
,
rightBoundary
);
readCheck
(
c
,
i
,
text
);
const
char
*
ptr
=
faces
[
ascii
[(
c
-
' '
)
+
1
]];
p
.
x
=
(
uchar
)
ptr
[
0
]
-
'R'
;
...
...
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