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 #ifndef INCLUDED_VCL_SOURCE_PDF_BUILDIN_FONTS_HXX
20 #define INCLUDED_VCL_SOURCE_PDF_BUILDIN_FONTS_HXX
21 
22 #include <PhysicalFontFace.hxx>
23 #include <fontinstance.hxx>
24 
25 namespace vcl
26 {
27 namespace 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];
43 
44  OString getNameObject() const;
46 };
47 
49 {
50  bool ImplGetGlyphBoundRect(sal_GlyphId nID, tools::Rectangle& rRect, bool) const override;
51 
52 public:
54 
55  bool GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& rPoly, bool) const override;
56 };
57 
58 class BuildinFontFace final : public PhysicalFontFace
59 {
60 private:
61  static const BuildinFont m_aBuildinFonts[14];
63 
65  CreateFontInstance(const FontSelectPattern& rFSD) const override;
66 
67 public:
68  explicit BuildinFontFace(int nId);
69 
70  const BuildinFont& GetBuildinFont() const { return mrBuildin; }
71  sal_IntPtr GetFontId() const override { return reinterpret_cast<sal_IntPtr>(&mrBuildin); }
72 
73  static const BuildinFont& Get(int nId) { return m_aBuildinFonts[nId]; }
74 };
75 
76 } // namespace pdf
77 } // namespace vcl
78 
79 #endif // INCLUDED_VCL_SOURCE_PDF_BUILDIN_FONTS_HXX
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
sal_uInt16 sal_GlyphId
Definition: glyphitem.hxx:26
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
FontItalic const m_eItalic
FontAttributes GetFontAttributes() const
FontItalic