LibreOffice Module vcl (master)  1
pdfbuildin_fonts.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <sal/config.h>
23 
24 #include <PhysicalFontFace.hxx>
25 #include <fontinstance.hxx>
26 
27 namespace vcl::pdf
28 {
30 {
31  const char* m_pName;
32  const char* m_pStyleName;
33  const char* m_pPSName;
34  int const m_nAscent;
35  int const m_nDescent;
37  rtl_TextEncoding const m_eCharSet;
42  int const m_aWidths[256];
44 
45  OString getNameObject() const;
46  const FontCharMapRef& GetFontCharMap() const;
48 };
49 
51 {
52  bool ImplGetGlyphBoundRect(sal_GlyphId nID, tools::Rectangle& rRect, bool) const override;
53 
54 public:
56 
57  bool GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& rPoly, bool) const override;
58 };
59 
60 class BuildinFontFace final : public PhysicalFontFace
61 {
62  static const BuildinFont m_aBuildinFonts[14];
64 
66  CreateFontInstance(const FontSelectPattern& rFSD) const override;
67 
68 public:
69  explicit BuildinFontFace(int nId);
70 
71  const BuildinFont& GetBuildinFont() const { return mrBuildin; }
72  sal_IntPtr GetFontId() const override { return reinterpret_cast<sal_IntPtr>(&mrBuildin); }
73  FontCharMapRef GetFontCharMap() const override { return mrBuildin.GetFontCharMap(); }
74  bool GetFontCapabilities(vcl::FontCapabilities&) const override { return false; }
75 
76  static const BuildinFont& Get(int nId) { return m_aBuildinFonts[nId]; }
77 };
78 
79 } // namespace vcl::pdf
80 
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FontWeight const m_eWeight
FontWidth
const BuildinFont & mrBuildin
sal_Int16 nId
rtl::Reference< LogicalFontInstance > CreateFontInstance(const FontSelectPattern &rFSD) const override
static const BuildinFont m_aBuildinFonts[14]
FontFamily const m_eFamily
const FontCharMapRef & GetFontCharMap() const
sal_uInt16 sal_GlyphId
Definition: glyphitem.hxx:29
FontCharMapRef GetFontCharMap() const override
bool ImplGetGlyphBoundRect(sal_GlyphId nID, tools::Rectangle &rRect, bool) const override
abstract base class for physical font faces
FontPitch const m_ePitch
BuildinFontInstance(const PhysicalFontFace &, const FontSelectPattern &)
bool GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon &rPoly, bool) const override
sal_IntPtr GetFontId() const override
FontPitch
rtl_TextEncoding const m_eCharSet
const BuildinFont & GetBuildinFont() const
OString getNameObject() const
static const BuildinFont & Get(int nId)
FontFamily
FontWeight
FontWidth const m_eWidthType
FontCharMapRef m_xFontCharMap
FontItalic const m_eItalic
FontAttributes GetFontAttributes() const
bool GetFontCapabilities(vcl::FontCapabilities &) const override
FontItalic