summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2021-09-08 12:07:48 +1000
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-18 11:51:52 +0200
commitc2e6a068c112f4c5866b6371d02362bd71f903a3 (patch)
treefcfdccb4ded2c743a39ed466d825326743d2f165 /vcl/workben
parent9c289cfde6891eebac46270774ac5c16af093622 (diff)
vcl: create FontMetric from PhysicalFontFace
A FontMetric can be created from a PhysicalFontFace, so setup a constructor that takes a PhysicalFontFace object to instantiate the FontMetric. The OutputDevice functions GetDevFont() and GetDevFontCount() don't necessarily make much sense, so have changed GetDevFont() to GetFontMetricFromCollection() and GetDevFontCount() to GetFontFaceCollectionCount(). Change-Id: I1577679b949a49a7cf1248838786d0f5e84a5245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121796 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/svptest.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index 988b0d9d164f..2bc3ad4adb7c 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -226,12 +226,12 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rR
Size(aPaperSize.Width() - 600,
aPaperSize.Height() - 600)));
- const int nFontCount = rRenderContext.GetDevFontCount();
+ const int nFontCount = rRenderContext.GetFontFaceCollectionCount();
const int nFontSamples = (nFontCount < 15) ? nFontCount : 15;
for (int i = 0; i < nFontSamples; ++i)
{
- FontMetric aFont = rRenderContext.GetDevFont((i * nFontCount) / nFontSamples);
+ FontMetric aFont(rRenderContext.GetFontMetricFromCollection((i * nFontCount) / nFontSamples));
aFont.SetFontHeight(400 + (i % 7) * 100);
aFont.SetOrientation(Degree10(i * (3600 / nFontSamples)));
rRenderContext.SetFont(aFont);