This class assists PdfDocument with caching font information.
More...
#include <PdfFontManager.h>
|
| PdfFont * | SearchFont (const std::string_view &fontPattern, const PdfFontSearchParams &searchParams={ }, const PdfFontCreateParams &createParams={ }) |
| | Get a font from the cache.
|
| |
| PdfFont * | SearchFont (const std::string_view &fontPattern, const PdfFontCreateParams &createParams) |
| | Get a font from the cache.
|
| |
| PdfFont & | GetStandard14Font (PdfStandard14FontType stdFont, const PdfFontCreateParams ¶ms={ }) |
| | Get a Standard 14 font.
|
| |
| PdfFont & | GetOrCreateFont (const std::string_view &fontPath, unsigned faceIndex, const PdfFontCreateParams ¶ms={ }) |
| | Get or create a font from a file path.
|
| |
| PdfFont & | GetOrCreateFontFromBuffer (const bufferview &buffer, unsigned faceIndex, const PdfFontCreateParams ¶ms={ }) |
| | Get or create a font from a buffer.
|
| |
| PdfFont & | GetOrCreateFont (const std::string_view &fontPath, const PdfFontCreateParams ¶ms={ }) |
| | Get or create a font from a file path.
|
| |
| PdfFont & | GetOrCreateFontFromBuffer (const bufferview &buffer, const PdfFontCreateParams ¶ms={ }) |
| | Get or create a font from a buffer.
|
| |
| PdfFont & | GetOrCreateFont (PdfFontMetricsConstPtr metrics, const PdfFontCreateParams ¶ms={ }) |
| | Get or create a font from existing metrics.
|
| |
| PdfFont * | GetCachedFont (const PdfReference &ref) |
| | Try getting the font from the cached font map.
|
| |
| void | EmbedFonts () |
| | Embed all imported fonts.
|
| |
This class assists PdfDocument with caching font information.
Additional to font caching, this class is also responsible for font matching.
PdfFont is an actual font that can be used in a PDF file (i.e. it does also font embedding) and PdfFontMetrics provides only metrics information.
- See also
- PdfDocument
◆ EmbedFonts()
| void PdfFontManager::EmbedFonts |
( |
| ) |
|
Embed all imported fonts.
◆ GetCachedFont()
Try getting the font from the cached font map.
- Parameters
-
| ref | the reference of the font |
- Returns
- the cached font or nullptr
◆ GetOrCreateFont() [1/3]
| PdfFont & PoDoFo::PdfFontManager::GetOrCreateFont |
( |
const std::string_view & |
fontPath, |
|
|
const PdfFontCreateParams & |
params = { } |
|
) |
| |
Get or create a font from a file path.
- Parameters
-
| fontPath | the path to the font file |
| params | font creation params |
- Returns
- a PdfFont object
◆ GetOrCreateFont() [2/3]
| PdfFont & PoDoFo::PdfFontManager::GetOrCreateFont |
( |
const std::string_view & |
fontPath, |
|
|
unsigned |
faceIndex, |
|
|
const PdfFontCreateParams & |
params = { } |
|
) |
| |
Get or create a font from a file path.
- Parameters
-
| fontPath | the path to the font file |
| faceIndex | the index of the face within the font file |
| params | font creation params |
- Returns
- a PdfFont object
◆ GetOrCreateFont() [3/3]
Get or create a font from existing metrics.
- Parameters
-
| metrics | the font metrics |
| params | font creation params |
- Returns
- a PdfFont object
◆ GetOrCreateFontFromBuffer() [1/2]
Get or create a font from a buffer.
- Parameters
-
| buffer | the buffer containing the font data |
| params | font creation params |
- Returns
- a PdfFont object
◆ GetOrCreateFontFromBuffer() [2/2]
Get or create a font from a buffer.
- Parameters
-
| buffer | the buffer containing the font data |
| faceIndex | the index of the face within the font file |
| params | font creation params |
- Returns
- a PdfFont object
◆ GetStandard14Font()
| PdfFont & PdfFontManager::GetStandard14Font |
( |
PdfStandard14FontType |
stdFont, |
|
|
const PdfFontCreateParams & |
params = { } |
|
) |
| |
Get a Standard 14 font.
- Parameters
-
| stdFont | the standard 14 font type |
| params | font creation params |
- Returns
- a PdfFont object
◆ SearchFont() [1/2]
| PdfFont * PoDoFo::PdfFontManager::SearchFont |
( |
const std::string_view & |
fontPattern, |
|
|
const PdfFontCreateParams & |
createParams |
|
) |
| |
Get a font from the cache.
If the font does not yet exist, add it to the cache.
- Parameters
-
| fontPattern | a search font pattern |
| createParams | font creation params |
- Returns
- a PdfFont object or nullptr if the font could not be created or found.
◆ SearchFont() [2/2]
| PdfFont * PoDoFo::PdfFontManager::SearchFont |
( |
const std::string_view & |
fontPattern, |
|
|
const PdfFontSearchParams & |
searchParams = { }, |
|
|
const PdfFontCreateParams & |
createParams = { } |
|
) |
| |
Get a font from the cache.
If the font does not yet exist, add it to the cache.
- Parameters
-
| fontPattern | a search font pattern |
| searchParams | font search params |
| createParams | font creation params |
- Returns
- a PdfFont object or nullptr if the font could not be created or found.
◆ SearchFontMetrics()
Try to search for fontmetrics from the given fontname and parameters.
- Parameters
-
| fontPattern | a search font pattern |
| params | font search params |
- Returns
- the found metrics. Null if not found
The documentation for this class was generated from the following files: