Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Libraries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Libraries
Commits
375bca6d
Commit
375bca6d
authored
Nov 30, 2014
by
Andrea Iacovitti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Really cache font's xHeight.
parent
a981105a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
khtml/css/css_valueimpl.cpp
khtml/css/css_valueimpl.cpp
+2
-4
khtml/rendering/font.cpp
khtml/rendering/font.cpp
+2
-0
khtml/rendering/font.h
khtml/rendering/font.h
+2
-1
No files found.
khtml/css/css_valueimpl.cpp
View file @
375bca6d
...
...
@@ -1089,11 +1089,9 @@ double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, int
case
CSSPrimitiveValue
::
CSS_EMS
:
factor
=
style
->
font
().
pixelSize
();
break
;
case
CSSPrimitiveValue
::
CSS_EXS
:
{
const
QFontMetrics
fm
=
style
->
fontMetrics
();
factor
=
fm
.
xHeight
();
case
CSSPrimitiveValue
::
CSS_EXS
:
factor
=
style
->
htmlFont
().
xHeight
();
break
;
}
case
CSSPrimitiveValue
::
CSS_CHS
:
{
const
int
zw
=
style
->
htmlFont
().
zeroCharWidth
();
if
(
zw
!=
-
1
)
{
...
...
khtml/rendering/font.cpp
View file @
375bca6d
...
...
@@ -580,6 +580,7 @@ CachedFontInstance::CachedFontInstance(CachedFontFamily* p, int sz):
descent
=
fm
.
descent
();
height
=
fm
.
height
();
lineSpacing
=
fm
.
lineSpacing
();
xHeight
=
fm
.
xHeight
();
const
QChar
zeroChar
((
ushort
)
48
);
if
(
!
fm
.
inFont
(
zeroChar
))
{
...
...
@@ -609,6 +610,7 @@ void CachedFontInstance::invalidate()
descent
=
fm
.
descent
();
height
=
fm
.
height
();
lineSpacing
=
fm
.
lineSpacing
();
xHeight
=
fm
.
xHeight
();
const
QChar
zeroChar
((
ushort
)
48
);
if
(
!
fm
.
inFont
(
zeroChar
))
{
...
...
khtml/rendering/font.h
View file @
375bca6d
...
...
@@ -82,6 +82,7 @@ public:
int
descent
;
int
height
;
int
lineSpacing
;
int
xHeight
;
int
m_zeroCharWidth
;
mutable
bool
invalidated
;
...
...
@@ -241,7 +242,7 @@ public:
int
descent
()
const
{
return
cfi
->
descent
;
}
int
height
()
const
{
return
cfi
->
height
;
}
int
lineSpacing
()
const
{
return
cfi
->
lineSpacing
;
}
float
xHeight
()
const
{
return
cfi
->
fm
.
xHeight
()
;
}
int
xHeight
()
const
{
return
cfi
->
xHeight
;
}
// return -1 if '0' char glyph not in font
int
zeroCharWidth
()
const
{
return
cfi
->
m_zeroCharWidth
;
}
...
...
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