LibreOffice Module vcl (master) 1
fontsubstitution.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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// nowadays these substitutions are needed for backward compatibility and tight platform integration:
21// - substitutions from configuration entries (Tools->Options->FontReplacement and/or fontconfig)
22// - device specific substitutions (e.g. for PS printer builtin fonts)
23// - substitutions for missing fonts defined by configuration entries (generic and/or platform dependent fallbacks)
24// - substitutions for missing fonts defined by multi-token fontnames (e.g. fontname="SpecialFont;FallbackA;FallbackB")
25// - substitutions for incomplete fonts (implicit, generic, EUDC and/or platform dependent fallbacks)
26// - substitutions for missing symbol fonts by translating code points into other symbol fonts
27
28#pragma once
29
30#include <sal/config.h>
31
32#include <rtl/ustring.hxx>
33
35
37
38namespace vcl::font
39{
40class FontSelectPattern;
41
43{
44 // TODO: there is more commonality between the different substitutions
45protected:
46 virtual ~FontSubstitution() {}
47};
48
51{
52public:
54 LogicalFontInstance* pLogicalFont,
55 OUString& rMissingCodes) const = 0;
56};
57
62{
63public:
65};
66
67void ImplFontSubstitute(OUString& rFontName);
68}
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
Abstracts the concept of finding the best font to support an incomplete font.
virtual bool FindFontSubstitute(vcl::font::FontSelectPattern &, LogicalFontInstance *pLogicalFont, OUString &rMissingCodes) const =0
Abstracts the concept of a configured font substitution before the availability of the originally sel...
virtual bool FindFontSubstitute(vcl::font::FontSelectPattern &) const =0
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
void ImplFontSubstitute(OUString &rFontName)