bump product version to 7.2.5.1
[LibreOffice.git] / vcl / source / gdi / pdfbuildin_fonts.hxx
blob6c3c03ffc7ea520b271203d29928002ff4022b76
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_VCL_SOURCE_PDF_BUILDIN_FONTS_HXX
20 #define INCLUDED_VCL_SOURCE_PDF_BUILDIN_FONTS_HXX
22 #include <PhysicalFontFace.hxx>
23 #include <fontinstance.hxx>
25 namespace vcl::pdf
27 struct BuildinFont
29 const char* m_pName;
30 const char* m_pStyleName;
31 const char* m_pPSName;
32 int const m_nAscent;
33 int const m_nDescent;
34 FontFamily const m_eFamily;
35 rtl_TextEncoding const m_eCharSet;
36 FontPitch const m_ePitch;
37 FontWidth const m_eWidthType;
38 FontWeight const m_eWeight;
39 FontItalic const m_eItalic;
40 int const m_aWidths[256];
41 mutable FontCharMapRef m_xFontCharMap;
43 OString getNameObject() const;
44 const FontCharMapRef& GetFontCharMap() const;
45 FontAttributes GetFontAttributes() const;
48 class BuildinFontInstance final : public LogicalFontInstance
50 bool ImplGetGlyphBoundRect(sal_GlyphId nID, tools::Rectangle& rRect, bool) const override;
52 public:
53 BuildinFontInstance(const PhysicalFontFace&, const FontSelectPattern&);
55 bool GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& rPoly, bool) const override;
58 class BuildinFontFace final : public PhysicalFontFace
60 static const BuildinFont m_aBuildinFonts[14];
61 const BuildinFont& mrBuildin;
63 rtl::Reference<LogicalFontInstance>
64 CreateFontInstance(const FontSelectPattern& rFSD) const override;
66 public:
67 explicit BuildinFontFace(int nId);
69 const BuildinFont& GetBuildinFont() const { return mrBuildin; }
70 sal_IntPtr GetFontId() const override { return reinterpret_cast<sal_IntPtr>(&mrBuildin); }
71 FontCharMapRef GetFontCharMap() const override { return mrBuildin.GetFontCharMap(); }
72 bool GetFontCapabilities(vcl::FontCapabilities&) const override { return false; }
74 static const BuildinFont& Get(int nId) { return m_aBuildinFonts[nId]; }
77 } // namespace vcl::pdf
79 #endif // INCLUDED_VCL_SOURCE_PDF_BUILDIN_FONTS_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */