Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
02238f7e
Commit
02238f7e
authored
Jun 09, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug with drawing a char with negative size of the font.
parent
907e00a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
33 deletions
+23
-33
PdfReader/Src/RendererOutputDev.cpp
PdfReader/Src/RendererOutputDev.cpp
+23
-33
No files found.
PdfReader/Src/RendererOutputDev.cpp
View file @
02238f7e
...
@@ -2982,39 +2982,36 @@ namespace PdfReader
...
@@ -2982,39 +2982,36 @@ namespace PdfReader
double
*
pCTM
=
pGState
->
GetCTM
();
double
*
pCTM
=
pGState
->
GetCTM
();
double
*
pTm
=
pGState
->
GetTextMatrix
();
double
*
pTm
=
pGState
->
GetTextMatrix
();
GrFont
*
pFont
=
pGState
->
GetFont
();
GrFont
*
pFont
=
pGState
->
GetFont
();
//double dTfs = pGState->GetFontSize();
//double dTh = pGState->GetHorizScaling();
//double dTrise = pGState->GetRise();
//double *pFontBBox = pGState->GetFont()->GetFontBBox();
//double dAcsentFactor = ( ( fabs(pFontBBox[1]) + fabs(pFontBBox[3]) ) - ( pFont->GetAscent() + fabs( pFont->GetDescent() ) ) ) / 2 + pFont->GetAscent();
double
pNewTm
[
6
],
arrMatrix
[
6
];
double
pNewTm
[
6
],
arrMatrix
[
6
];
//double dKoef = 0;//( pFont->GetAscent() - fabs( pFont->GetDescent() ) ) * dTfs;
double
dTextScale
=
min
(
sqrt
(
pTm
[
2
]
*
pTm
[
2
]
+
pTm
[
3
]
*
pTm
[
3
]),
sqrt
(
pTm
[
0
]
*
pTm
[
0
]
+
pTm
[
1
]
*
pTm
[
1
]));
double
dTextScale
=
min
(
sqrt
(
pTm
[
2
]
*
pTm
[
2
]
+
pTm
[
3
]
*
pTm
[
3
]),
sqrt
(
pTm
[
0
]
*
pTm
[
0
]
+
pTm
[
1
]
*
pTm
[
1
]));
double
dITextScale
=
1
/
dTextScale
;
double
dITextScale
=
1
/
dTextScale
;
//pTm[0] *= dITextScale;
//pTm[1] *= dITextScale;
//pTm[2] *= dITextScale;
//pTm[3] *= dITextScale;
//double dOldSize = m_oFont.Size;
//m_oFont.Size *= dTextScale;
double
dOldSize
=
10.0
;
double
dOldSize
=
10.0
;
m_pRenderer
->
get_FontSize
(
&
dOldSize
);
m_pRenderer
->
get_FontSize
(
&
dOldSize
);
m_pRenderer
->
put_FontSize
(
std
::
fabs
(
dOldSize
*
dTextScale
));
if
(
dOldSize
*
dTextScale
>
0
)
{
pNewTm
[
0
]
=
pTm
[
0
]
*
dITextScale
;
m_pRenderer
->
put_FontSize
(
dOldSize
*
dTextScale
);
pNewTm
[
1
]
=
pTm
[
1
]
*
dITextScale
;
pNewTm
[
2
]
=
-
pTm
[
2
]
*
dITextScale
;
pNewTm
[
0
]
=
pTm
[
0
]
*
dITextScale
;
pNewTm
[
3
]
=
-
pTm
[
3
]
*
dITextScale
;
pNewTm
[
1
]
=
pTm
[
1
]
*
dITextScale
;
//pNewTm[0] = pTm[0];
pNewTm
[
2
]
=
-
pTm
[
2
]
*
dITextScale
;
//pNewTm[1] = pTm[1];
pNewTm
[
3
]
=
-
pTm
[
3
]
*
dITextScale
;
//pNewTm[2] = -pTm[2];
pNewTm
[
4
]
=
dX
;
//pNewTm[3] = -pTm[3];
pNewTm
[
5
]
=
dY
;
pNewTm
[
4
]
=
dX
;
//+ pTm[2] * dKoef;
}
pNewTm
[
5
]
=
dY
;
//+ pTm[3] * dKoef;
else
{
m_pRenderer
->
put_FontSize
(
-
dOldSize
*
dTextScale
);
pNewTm
[
0
]
=
pTm
[
0
]
*
dITextScale
;
pNewTm
[
1
]
=
pTm
[
1
]
*
dITextScale
;
pNewTm
[
2
]
=
pTm
[
2
]
*
dITextScale
;
pNewTm
[
3
]
=
pTm
[
3
]
*
dITextScale
;
pNewTm
[
4
]
=
dX
;
pNewTm
[
5
]
=
dY
;
}
arrMatrix
[
0
]
=
pNewTm
[
0
]
*
pCTM
[
0
]
+
pNewTm
[
1
]
*
pCTM
[
2
];
arrMatrix
[
0
]
=
pNewTm
[
0
]
*
pCTM
[
0
]
+
pNewTm
[
1
]
*
pCTM
[
2
];
arrMatrix
[
1
]
=
-
(
pNewTm
[
0
]
*
pCTM
[
1
]
+
pNewTm
[
1
]
*
pCTM
[
3
]);
arrMatrix
[
1
]
=
-
(
pNewTm
[
0
]
*
pCTM
[
1
]
+
pNewTm
[
1
]
*
pCTM
[
3
]);
...
@@ -3023,13 +3020,6 @@ namespace PdfReader
...
@@ -3023,13 +3020,6 @@ namespace PdfReader
arrMatrix
[
4
]
=
pNewTm
[
4
]
*
pCTM
[
0
]
+
pNewTm
[
5
]
*
pCTM
[
2
]
+
pCTM
[
4
];
arrMatrix
[
4
]
=
pNewTm
[
4
]
*
pCTM
[
0
]
+
pNewTm
[
5
]
*
pCTM
[
2
]
+
pCTM
[
4
];
arrMatrix
[
5
]
=
-
(
pNewTm
[
4
]
*
pCTM
[
1
]
+
pNewTm
[
5
]
*
pCTM
[
3
]
+
pCTM
[
5
])
+
pGState
->
GetPageHeight
();
arrMatrix
[
5
]
=
-
(
pNewTm
[
4
]
*
pCTM
[
1
]
+
pNewTm
[
5
]
*
pCTM
[
3
]
+
pCTM
[
5
])
+
pGState
->
GetPageHeight
();
//double dAscentShiftX = arrMatrix[2] * pFont->GetDescent();
//double dAscentShiftY = arrMatrix[3] * pFont->GetDescent();
//arrMatrix[4] += dAscentShiftX;
//arrMatrix[5] += dAscentShiftY;
if
(
true
)
if
(
true
)
{
{
double
dNorma
=
min
(
sqrt
(
arrMatrix
[
0
]
*
arrMatrix
[
0
]
+
arrMatrix
[
1
]
*
arrMatrix
[
1
]),
sqrt
(
arrMatrix
[
2
]
*
arrMatrix
[
2
]
+
arrMatrix
[
3
]
*
arrMatrix
[
3
]));
double
dNorma
=
min
(
sqrt
(
arrMatrix
[
0
]
*
arrMatrix
[
0
]
+
arrMatrix
[
1
]
*
arrMatrix
[
1
]),
sqrt
(
arrMatrix
[
2
]
*
arrMatrix
[
2
]
+
arrMatrix
[
3
]
*
arrMatrix
[
3
]));
...
...
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