diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-16 12:03:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-16 21:29:45 +0100 |
commit | ca1ed645036cab9ba5e94a9d2e22ef8110e852e0 (patch) | |
tree | 4f5978e837111a395f7f974ee65e73ea270b78a2 /vcl/source/outdev | |
parent | d416fa9a212e0421a7c925507ddee07132f3cab3 (diff) |
use digit width instead of char width
its the same across backends
Change-Id: I37c83cbf1139babcd014c7cfdee06a13bea845c7
Reviewed-on: https://gerrit.libreoffice.org/51423
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r-- | vcl/source/outdev/text.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index f51dbabc558c..204feccc9da6 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -935,9 +935,17 @@ long OutputDevice::GetTextHeight() const float OutputDevice::approximate_char_width() const { + //note pango uses "The quick brown fox jumps over the lazy dog." for english + //and has a bunch of per-language strings which corresponds somewhat with + //makeRepresentativeText in include/svtools/sampletext.hxx return GetTextWidth("aemnnxEM") / 8.0; } +float OutputDevice::approximate_digit_width() const +{ + return GetTextWidth("0123456789") / 10.0; +} + void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr, const long* pDXAry, sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags ) |