summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-09-05 16:16:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-09-05 16:17:14 +0200
commit93786f7c79b3ae61feed42d397cbbdbd8107d152 (patch)
treec5cda620884a83f7539b676d8c1ae6fd9d7f5310
parenta897c5ed86c6d8981305bf725e83c76e4e3a36d0 (diff)
Revert "Resolves: tdf#107249 round ascent/descent/extleading on conversion to int"
This reverts commit e2159061db8e266a3fe9f31773c676887168b254, it broke CppunitTest_vcl_complextext.
-rw-r--r--vcl/source/font/fontmetric.cxx25
1 files changed, 10 insertions, 15 deletions
diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 23954b3c67d9..b8e7f1e748ff 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -412,7 +412,6 @@ void ImplFontMetricData::ImplCalcLineSpacing(const std::vector<uint8_t>& rHheaDa
mnAscent = mnDescent = mnExtLeading = mnIntLeading = 0;
double fScale = static_cast<double>(mnHeight) / nUPEM;
- double fAscent = 0, fDescent = 0, fExtLeading = 0;
vcl::TTGlobalFontInfo rInfo;
memset(&rInfo, 0, sizeof(vcl::TTGlobalFontInfo));
@@ -421,34 +420,30 @@ void ImplFontMetricData::ImplCalcLineSpacing(const std::vector<uint8_t>& rHheaDa
// Try hhea table first.
if (rInfo.ascender || rInfo.descender)
{
- fAscent = rInfo.ascender * fScale;
- fDescent = -rInfo.descender * fScale;
- fExtLeading = rInfo.linegap * fScale;
+ mnAscent = rInfo.ascender * fScale;
+ mnDescent = -rInfo.descender * fScale;
+ mnExtLeading = rInfo.linegap * fScale;
}
// But if OS/2 is present, prefer it.
if (rInfo.winAscent || rInfo.winDescent || rInfo.typoAscender || rInfo.typoDescender)
{
- if (fAscent == 0 && fDescent == 0)
+ if (mnAscent == 0 && mnDescent == 0)
{
- fAscent = rInfo.winAscent * fScale;
- fDescent = rInfo.winDescent * fScale;
- fExtLeading = 0;
+ mnAscent = rInfo.winAscent * fScale;
+ mnDescent = rInfo.winDescent * fScale;
+ mnExtLeading = 0;
}
const uint16_t kUseTypoMetricsMask = 1 << 7;
if (rInfo.fsSelection & kUseTypoMetricsMask)
{
- fAscent = rInfo.typoAscender * fScale;
- fDescent = -rInfo.typoDescender * fScale;
- fExtLeading = rInfo.typoLineGap * fScale;
+ mnAscent = rInfo.typoAscender * fScale;
+ mnDescent = -rInfo.typoDescender * fScale;
+ mnExtLeading = rInfo.typoLineGap * fScale;
}
}
- mnAscent = round(fAscent);
- mnDescent = round(fDescent);
- mnExtLeading = round(fExtLeading);
-
if (mnAscent || mnDescent)
mnIntLeading = mnAscent + mnDescent - mnHeight;