RAMSES Documentation  27.0.130
Information for RAMSES users and developers
FontRegistry.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2018 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_FONTREGISTRY_H
10 #define RAMSES_FONTREGISTRY_H
11 
14 
15 namespace ramses
16 {
22  {
23  public:
28 
32  virtual ~FontRegistry() override;
33 
40  virtual IFontInstance* getFontInstance(FontInstanceId fontInstanceId) const override;
41 
48  FontId createFreetype2Font(const char* fontPath);
49 
66  FontId createFreetype2FontFromFileDescriptor(int fd, size_t offset, size_t length);
67 
76  FontInstanceId createFreetype2FontInstance(FontId fontId, uint32_t size, bool forceAutohinting = false);
77 
86  FontInstanceId createFreetype2FontInstanceWithHarfBuzz(FontId fontId, uint32_t size, bool forceAutohinting = false);
87 
94  bool deleteFont(FontId fontId);
95 
102  bool deleteFontInstance(FontInstanceId fontInstance);
103 
107  class FontRegistryImpl& impl;
108 
113  FontRegistry(const FontRegistry& other) = delete;
114 
120  FontRegistry& operator=(const FontRegistry& other) = delete;
121  };
122 }
123 
124 #endif
#define RAMSES_API
Definition: APIExport.h:35
Font registry can be used to load Freetype2 fonts and create font instances (optionally with Harfbuzz...
Definition: FontRegistry.h:22
virtual ~FontRegistry() override
Destructor for FontRegistry. Destroys all created fonts.
bool deleteFont(FontId fontId)
Delete an existing font.
FontRegistry()
Constructor for FontRegistry.
bool deleteFontInstance(FontInstanceId fontInstance)
Delete an existing font instance.
virtual IFontInstance * getFontInstance(FontInstanceId fontInstanceId) const override
Get font instance object corresponding to given id.
FontId createFreetype2FontFromFileDescriptor(int fd, size_t offset, size_t length)
Load Freetype2 font from an open file descriptor.
FontInstanceId createFreetype2FontInstance(FontId fontId, uint32_t size, bool forceAutohinting=false)
Create Freetype2 font instance.
FontInstanceId createFreetype2FontInstanceWithHarfBuzz(FontId fontId, uint32_t size, bool forceAutohinting=false)
Create Freetype2 font instance with Harfbuzz shaping.
FontRegistry & operator=(const FontRegistry &other)=delete
Deleted copy assignment.
class FontRegistryImpl & impl
Definition: FontRegistry.h:107
FontRegistry(const FontRegistry &other)=delete
Deleted copy constructor.
FontId createFreetype2Font(const char *fontPath)
Load Freetype2 font from file.
Interface for getting font instances using font instance ids.
Definition: IFontAccessor.h:27
Interface for font instance that can be used to query glyph metadata and bitmaps.
Definition: IFontInstance.h:23
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15