Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
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
sdkjs
Commits
5c64dfd2
Commit
5c64dfd2
authored
Mar 26, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
добавлена возможность не добавлять смещение в "самопальных" болдах
parent
9493322a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
53 deletions
+60
-53
common/FontsFreeType/FontFile.js
common/FontsFreeType/FontFile.js
+29
-29
common/FontsFreeType/FontManager.js
common/FontsFreeType/FontManager.js
+31
-24
No files found.
common/FontsFreeType/FontFile.js
View file @
5c64dfd2
...
...
@@ -631,7 +631,7 @@ function CFontFile(fileName, faceIndex)
oSizes
.
oBBox
.
fMinY
=
(
yMin
>>
6
);
oSizes
.
oBBox
.
fMaxY
=
(
yMax
>>
6
);
if
(
this
.
m_bNeedDoBold
)
if
(
this
.
m_bNeedDoBold
&&
this
.
m_oFontManager
.
IsAdvanceNeedBoldFonts
)
oSizes
.
fAdvanceX
+=
1
;
var
dstM
=
oSizes
.
oMetrics
;
...
...
@@ -710,7 +710,7 @@ function CFontFile(fileName, faceIndex)
pString
.
SetBBox
(
nIndex
,
charSymbolObj
.
oBBox
.
fMinX
,
charSymbolObj
.
oBBox
.
fMaxY
,
charSymbolObj
.
oBBox
.
fMaxX
,
charSymbolObj
.
oBBox
.
fMinY
);
fPenX
+=
charSymbolObj
.
fAdvanceX
+
this
.
m_fCharSpacing
;
if
(
this
.
m_bNeedDoBold
)
if
(
this
.
m_bNeedDoBold
&&
this
.
m_oFontManager
.
IsAdvanceNeedBoldFonts
)
{
// Когда текст делаем жирным сами, то мы увеличиваем расстояние на 1 пиксель в ширину (независимо от DPI и размера текста всегда 1 пиксель)
fPenX
+=
1
;
...
...
@@ -982,7 +982,7 @@ function CFontFile(fileName, faceIndex)
pString
.
SetBBox
(
nIndex
,
charSymbolObj
.
oBBox
.
fMinX
,
charSymbolObj
.
oBBox
.
fMaxY
,
charSymbolObj
.
oBBox
.
fMaxX
,
charSymbolObj
.
oBBox
.
fMinY
);
fPenX
+=
charSymbolObj
.
fAdvanceX
+
this
.
m_fCharSpacing
;
if
(
this
.
m_bNeedDoBold
)
if
(
this
.
m_bNeedDoBold
&&
this
.
m_oFontManager
.
IsAdvanceNeedBoldFonts
)
{
// Когда текст делаем жирным сами, то мы увеличиваем расстояние на 1 пиксель в ширину (независимо от DPI и размера текста всегда 1 пиксель)
fPenX
+=
1
;
...
...
@@ -1271,7 +1271,7 @@ function CFontFile(fileName, faceIndex)
}
fPenX
+=
charSymbolObj
.
fAdvanceX
+
this
.
m_fCharSpacing
;
if
(
this
.
m_bNeedDoBold
)
if
(
this
.
m_bNeedDoBold
&&
this
.
m_oFontManager
.
IsAdvanceNeedBoldFonts
)
{
// Когда текст делаем жирным сами, то мы увеличиваем расстояние на 1 пиксель в ширину (независимо от DPI и размера текста всегда 1 пиксель)
//fPenX += 1;
...
...
@@ -1437,7 +1437,7 @@ function CFontFile(fileName, faceIndex)
oSizes
.
oBBox
.
fMinY
=
(
yMin
>>
6
);
oSizes
.
oBBox
.
fMaxY
=
(
yMax
>>
6
);
if
(
this
.
m_bNeedDoBold
)
if
(
this
.
m_bNeedDoBold
&&
this
.
m_oFontManager
.
IsAdvanceNeedBoldFonts
oSizes
.
fAdvanceX
+=
1
;
var
dstM
=
oSizes
.
oMetrics
;
...
...
common/FontsFreeType/FontManager.js
View file @
5c64dfd2
...
...
@@ -1335,6 +1335,8 @@ function CFontManager()
this
.
LOAD_MODE
=
40970
;
this
.
IsAdvanceNeedBoldFonts
=
true
;
this
.
AfterLoad
=
function
()
{
if
(
null
==
this
.
m_pFont
)
...
...
@@ -1719,4 +1721,9 @@ function CFontManager()
this
.
LOAD_MODE
=
40970
;
}
}
this
.
SetAdvanceNeedBoldFonts
=
function
(
value
)
{
this
.
IsAdvanceNeedBoldFonts
=
value
;
}
}
\ No newline at end of file
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