LibreOffice Module vcl (master)
1
vcl
inc
font
PhysicalFontCollection.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 <
vcl/dllapi.h
>
25
26
#include <
font/LogicalFontInstance.hxx
>
27
28
#include "
PhysicalFontFamily.hxx
"
29
30
#include <array>
31
#include <string_view>
32
33
#define MAX_GLYPHFALLBACK 16
34
35
namespace
vcl::font
36
{
37
class
GlyphFallbackFontSubstitution;
38
class
PreMatchFontSubstitution;
39
}
40
41
// TODO: merge with ImplFontCache
42
// TODO: rename to LogicalFontManager
43
44
namespace
vcl::font
45
{
46
47
class
VCL_PLUGIN_PUBLIC
PhysicalFontCollection
final
48
{
49
public
:
50
explicit
PhysicalFontCollection
();
51
~PhysicalFontCollection
();
52
53
// fill the list with device font faces
54
void
Add
(
vcl::font::PhysicalFontFace
* );
55
void
Clear
();
56
int
Count
()
const
{
return
maPhysicalFontFamilies.size(); }
57
58
// find the device font family
59
vcl::font::PhysicalFontFamily
* FindFontFamily( std::u16string_view rFontName )
const
;
60
vcl::font::PhysicalFontFamily
* FindOrCreateFontFamily(
const
OUString &rFamilyName );
61
vcl::font::PhysicalFontFamily
* FindFontFamily(
vcl::font::FontSelectPattern
& )
const
;
62
vcl::font::PhysicalFontFamily
* FindFontFamilyByTokenNames(std::u16string_view rTokenStr)
const
;
63
vcl::font::PhysicalFontFamily
* FindFontFamilyByAttributes(
ImplFontAttrs
nSearchType,
FontWeight
,
FontWidth
,
64
FontItalic
, std::u16string_view rSearchFamily)
const
;
65
66
// suggest fonts for glyph fallback
67
vcl::font::PhysicalFontFamily
* GetGlyphFallbackFont(
vcl::font::FontSelectPattern
&,
68
LogicalFontInstance
* pLogicalFont,
69
OUString& rMissingCodes,
int
nFallbackLevel )
const
;
70
71
// prepare platform specific font substitutions
72
void
SetPreMatchHook(
vcl::font::PreMatchFontSubstitution
* );
73
void
SetFallbackHook(
vcl::font::GlyphFallbackFontSubstitution
* );
74
75
// misc utilities
76
std::shared_ptr<PhysicalFontCollection>
Clone
()
const
;
77
std::unique_ptr<vcl::font::PhysicalFontFaceCollection> GetFontFaceCollection()
const
;
78
79
private
:
80
mutable
bool
mbMatchData
;
// true if matching attributes are initialized
81
82
typedef
std::unordered_map<OUString, std::unique_ptr<vcl::font::PhysicalFontFamily>>
PhysicalFontFamilies
;
83
PhysicalFontFamilies
maPhysicalFontFamilies
;
84
85
vcl::font::PreMatchFontSubstitution
*
mpPreMatchHook
;
// device specific prematch substitution
86
vcl::font::GlyphFallbackFontSubstitution
*
mpFallbackHook
;
// device specific glyph fallback substitution
87
88
mutable
std::unique_ptr<std::array<vcl::font::PhysicalFontFamily*,MAX_GLYPHFALLBACK>>
mpFallbackList
;
89
mutable
int
mnFallbackCount
;
90
91
void
ImplInitMatchData()
const
;
92
void
ImplInitGenericGlyphFallback()
const
;
93
94
vcl::font::PhysicalFontFamily
* ImplFindFontFamilyBySearchName(
const
OUString& )
const
;
95
vcl::font::PhysicalFontFamily
* ImplFindFontFamilyBySubstFontAttr(
const
utl::FontNameAttr
& )
const
;
96
97
vcl::font::PhysicalFontFamily
* ImplFindFontFamilyOfDefaultFont()
const
;
98
99
};
100
101
}
102
103
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
LogicalFontInstance.hxx
PhysicalFontFamily.hxx
LogicalFontInstance
Definition:
LogicalFontInstance.hxx:68
vcl::font::FontSelectPattern
Definition:
FontSelectPattern.hxx:41
vcl::font::GlyphFallbackFontSubstitution
Abstracts the concept of finding the best font to support an incomplete font.
Definition:
fontsubstitution.hxx:51
vcl::font::PhysicalFontCollection
Definition:
PhysicalFontCollection.hxx:48
vcl::font::PhysicalFontCollection::mbMatchData
bool mbMatchData
Definition:
PhysicalFontCollection.hxx:80
vcl::font::PhysicalFontCollection::mpPreMatchHook
vcl::font::PreMatchFontSubstitution * mpPreMatchHook
Definition:
PhysicalFontCollection.hxx:85
vcl::font::PhysicalFontCollection::mpFallbackHook
vcl::font::GlyphFallbackFontSubstitution * mpFallbackHook
Definition:
PhysicalFontCollection.hxx:86
vcl::font::PhysicalFontCollection::mnFallbackCount
int mnFallbackCount
Definition:
PhysicalFontCollection.hxx:89
vcl::font::PhysicalFontCollection::PhysicalFontFamilies
std::unordered_map< OUString, std::unique_ptr< vcl::font::PhysicalFontFamily > > PhysicalFontFamilies
Definition:
PhysicalFontCollection.hxx:82
vcl::font::PhysicalFontCollection::mpFallbackList
std::unique_ptr< std::array< vcl::font::PhysicalFontFamily *, MAX_GLYPHFALLBACK > > mpFallbackList
Definition:
PhysicalFontCollection.hxx:88
vcl::font::PhysicalFontCollection::Count
int Count() const
Definition:
PhysicalFontCollection.hxx:56
vcl::font::PhysicalFontCollection::maPhysicalFontFamilies
PhysicalFontFamilies maPhysicalFontFamilies
Definition:
PhysicalFontCollection.hxx:83
vcl::font::PhysicalFontFace
abstract base class for physical font faces
Definition:
PhysicalFontFace.hxx:145
vcl::font::PhysicalFontFamily
Definition:
PhysicalFontFamily.hxx:63
vcl::font::PreMatchFontSubstitution
Abstracts the concept of a configured font substitution before the availability of the originally sel...
Definition:
fontsubstitution.hxx:62
config.h
dllapi.h
VCL_PLUGIN_PUBLIC
#define VCL_PLUGIN_PUBLIC
Definition:
dllapi.h:40
RedlineNotification::Add
@ Add
ImplFontAttrs
ImplFontAttrs
FontItalic
FontItalic
FontWidth
FontWidth
Clear
void Clear(EHistoryType eHistory)
Clone
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
FontWeight
FontWeight
vcl::font
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
Definition:
DirectFontSubstitution.cxx:30
utl::FontNameAttr
Generated on Sun Jul 30 2023 04:34:57 for LibreOffice Module vcl (master) by
1.9.3