Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
FontLoader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <Windows.h>
6 #include <dwrite.h>
7 
8 #include <Strings/components/utils/saferelease/saferelease.h>
9 
10 #ifndef BLAM
11 #define BLAM
12 #endif
13 
17 typedef std::vector<std::wstring> MFFontList;
18 
45 {
49  namespace MFFontGlobals
50  {
61  BLAM int push(MFFontList &collection);
62 
68  BLAM std::vector<MFFontList>& getFontFileLists();
69 
76  BLAM void addFontCollection(std::string id, IDWriteFontCollection* collection);
77 
85  BLAM IDWriteFontCollection* getFontCollection(std::string id);
86 
91  }
92 
101  BLAM HRESULT CreateFontCollection(MFFontList &newCollection, std::string font_id);
102 
106  class MFFontCollectionLoader : public IDWriteFontCollectionLoader
107  {
108  public:
113  {
114  reference_count = 0;
115  }
116 
118  // IUnknown Methods //
120 
126  virtual HRESULT __stdcall QueryInterface(REFIID iid, void** ppvObject);
127 
131  virtual ULONG __stdcall AddRef();
132 
136  virtual ULONG __stdcall Release();
137 
139  // IDWriteFontCollectionLoader Methods //
141 
152  virtual HRESULT __stdcall CreateEnumeratorFromKey(IDWriteFactory* factory, void const* collectionKey, UINT32 collectionKeySize, IDWriteFontFileEnumerator** fontFileEnumerator);
153 
154  private:
155  ULONG reference_count;
156  };
157 
163  class MFFontFileEnumerator : public IDWriteFontFileEnumerator
164  {
165  public:
169  MFFontFileEnumerator(IDWriteFactory* factory);
170 
179  HRESULT Initialize(UINT const* collectionKey, UINT32 keySize);
180 
185  {
186  SafeRelease(&current_file);
187  }
188 
190  // IUnknown Methods //
192 
198  virtual HRESULT __stdcall QueryInterface(REFIID iid, void** ppvObject);
199 
203  virtual ULONG __stdcall AddRef();
204 
208  virtual ULONG __stdcall Release();
209 
211  // IDWriteFontFileEnumerator Methods //
213 
221  virtual HRESULT __stdcall MoveNext(BOOL* hasCurrentFile);
222 
230  virtual HRESULT __stdcall GetCurrentFontFile(IDWriteFontFile** fontFile);
231 
232  private:
233  ULONG reference_count;
234 
235  IDWriteFontFile* current_file;
236  std::vector<std::wstring> file_paths;
237  size_t next_index;
238  };
239 
240 }
BlamRendering::RenderStack::StackObjectBase::draw_mode
StackItemDrawMode draw_mode
The drawing mode of the object.
Definition: render_stack.h:373
BlamUIWidget_BasicLine::thickness
int thickness
Definition: ui.h:249
BlamRendering::RenderStack::Text::shadow_color
D2D1_COLOR_F shadow_color
The color to use for the drop shadow.
Definition: render_stack.h:963
BlamUIWidget::hidden
bool hidden
Definition: ui.h:94
BlamRendering::DirectX::Drawing::DrawEllipse
BLAM HRESULT DrawEllipse(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_ELLIPSE ellipse, float thickness, StackItemDrawMode mode)
Draws an ellipse.
Definition: ellipse.cpp:10
BlamRendering::DirectX::WIC::ConvertWICBitmapToD2D
BLAM HRESULT ConvertWICBitmapToD2D(IWICBitmap *wic_bitmap, ID2D1Bitmap **d2d_bitmap)
Converts a WIC bitmap to a D2D bitmap.
Definition: wic.cpp:91
BlamRendering::RenderStack::Text::Draw
void Draw()
Draws the stack object.
Definition: Text.cpp:163
ui.h
BlamRendering::RenderStack::BitmapText::shadow_color
D2D1_COLOR_F shadow_color
The color to use for the drop shadow.
Definition: render_stack.h:851
BlamUIWidget_BasicLine::end
BlamVector2 end
Definition: ui.h:252
BlamRendering::OGRE::Materials::CreateDefaultUnlitDatablockForPrimitives
BLAM Ogre::HlmsUnlitDatablock * CreateDefaultUnlitDatablockForPrimitives(std::string id)
Definition: materials.cpp:916
BlamRendering::RenderStack::StackObjectBase::visible
bool visible
Whether or not the object is visible.
Definition: render_stack.h:375
BlamRendering::RenderStack::Text::SetText
void SetText(std::string text)
Sets the text to display.
Definition: Text.cpp:39
Blam::DebugUI::Widgets::ShowHelpMarker
BLAM void ShowHelpMarker(const char *desc)
Shows a help indicator.
Definition: widgets.cpp:7
BlamUIWidget_BasicEllipse::thickness
int thickness
Definition: ui.h:222
BlamRendering::RenderStack::DWText::font_size
float font_size
The size of the text.
Definition: render_stack.h:753
BlamRendering::RenderStack::BitmapText::zone_color
D2D1_COLOR_F zone_color
The color to use for the zone border.
Definition: render_stack.h:855
recolor_bitmap
HRESULT recolor_bitmap(ID2D1Bitmap **bitmap, D2D1_COLOR_F color, Font *font, FontGlyph *current_glyph, char current_char, ID2D1RenderTarget *target)
Recolors the specified glyph.
Definition: text.cpp:48
Pixel::r
BYTE * r
The Red value of the pixel.
Definition: render_utils.h:16
BlamRendering::RenderStack::DWText::Draw
void Draw()
Draws the stack object.
Definition: DWText.cpp:12
BlamRendering::RenderStack::BitmapText::text_area
D2D1_RECT_F text_area
The area to use for the text bitmap.
Definition: render_stack.h:859
BlamRendering::RenderStack::Line::show_zone
bool show_zone
Whether or not to show the line area.
Definition: render_stack.h:648
BlamUIWidget_Text::BlamUIWidget_Text
BlamUIWidget_Text(BlamUIWidget_Group *_parent, bool _new_render_method=true)
Definition: text.cpp:30
BlamRendering::DirectX::D2D::MF::MFFontCollectionLoader::MFFontCollectionLoader
MFFontCollectionLoader()
Sets the reference count to 0.
Definition: FontLoader.h:112
BlamUIWidget::update
bool update
Definition: ui.h:93
BlamUIWidget_BasicLine::SetHidden
void SetHidden(bool new_hidden) override
Definition: line.cpp:195
BlamRendering::DirectX::Utils::GetPixelData
BLAM Pixel GetPixelData(BYTE *origin, int x, int y, int width, int height)
Retrieves a pixel from the specified memory address.
Definition: bitmap_utils.cpp:152
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:142
FontLoader.h
BlamUIWidget_Text::font_name
std::string font_name
Definition: ui.h:325
font
io.Fonts->AddFontFromMemoryCompressedTTF(compressed_data, compressed_data_size, size_pixels,...) font
Definition: README.txt:86
BlamRendering::RenderStack::BitmapText::font_id
std::string font_id
The ID of the font.
Definition: render_stack.h:844
width
int width
Definition: bgfx.cpp:19
BlamUIWidget_Text::RebuildDatablocks
void RebuildDatablocks()
Definition: text.cpp:580
BlamRendering::RenderStack::BitmapText::bitmap_height
int bitmap_height
The height of the bitmap.
Definition: render_stack.h:862
BlamRendering::DirectX::WIC::ConvertWICBitmapTo32bppPBGRA
BLAM HRESULT ConvertWICBitmapTo32bppPBGRA(IWICBitmap *source, IWICBitmap **destination)
Converts a WIC bitmap to a WIC bitmap, with the 32 bits-per-pixe, PBGRA format.
Definition: wic.cpp:58
BlamUIWidget_Group
Definition: ui.h:141
BLAM
#define BLAM
Definition: FontLoader.h:11
BlamUIWidget_BasicLine::UpdateMetrics
void UpdateMetrics() override
Definition: line.cpp:150
render_stack.h
BlamRendering::RenderStack::DWText::auto_calculate_area
bool auto_calculate_area
Whether or not to automatically calculate the area for the text.
Definition: render_stack.h:767
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:359
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::Initialize
HRESULT Initialize(UINT const *collectionKey, UINT32 keySize)
Initializes a the enumerator.
Definition: MFFontFileEnumerator.cpp:16
BlamRendering::RenderStack::BitmapText::text_bitmap
ID2D1Bitmap * text_bitmap
The bitmap containing the fully rendered representation of the object.
Definition: render_stack.h:858
BlamFontPackageType::TrueType
@ TrueType
BlamRendering::RenderStack::Text::UpdateAllProperties
void UpdateAllProperties()
Applies any modified parent properties to the appropriate child object.
Definition: Text.cpp:74
ImGui::Checkbox
IMGUI_API bool Checkbox(const char *label, bool *v)
Definition: imgui_widgets.cpp:974
logger.h
BlamRendering::RenderStack::Line::start_point
D2D1_POINT_2F start_point
The starting point of the line.
Definition: render_stack.h:643
BlamRendering::GetCurrentRenderingEngine
BLAM BlamRenderingEngine GetCurrentRenderingEngine()
Retrieves the current rendering engine being used.
Definition: rendering_abstraction.cpp:104
BlamRendering::RenderStack::Text::GetFont
std::string GetFont()
Retrieves the ID of the active font.
Definition: Text.cpp:151
BlamRendering::RenderStack::Ellipse::Draw
void Draw()
Draws the stack object.
Definition: ellipse.cpp:10
glyph
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying glyph
Definition: ARPHICPL.TXT:16
BlamUIWidget::parent
BlamUIWidget_Group * parent
Definition: ui.h:111
BlamRendering::RenderStack::DWText::zone_color
D2D1_COLOR_F zone_color
The color to use for the zone border.
Definition: render_stack.h:756
BlamUIWidget::rotation
float rotation
Definition: ui.h:104
BlamUIWidget_Text::font_package
BlamFontPackage * font_package
Definition: ui.h:326
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::GetCurrentFontFile
virtual HRESULT __stdcall GetCurrentFontFile(IDWriteFontFile **fontFile)
Retrieves the current font file.
Definition: MFFontFileEnumerator.cpp:91
BlamUIWidget_Text::character_height
int character_height
Definition: ui.h:321
BlamUIWidget_Text::shadow_offset
BlamVector2 shadow_offset
Definition: ui.h:322
imgui.h
BlamRendering::DirectX::D2D::GetDWriteFactory
BLAM IDWriteFactory * GetDWriteFactory()
Retrieves the DirectWrite factory.
Definition: render_manage.cpp:573
BlamUIWidget_BasicEllipse::resolution
int resolution
Definition: ui.h:223
BlamRendering::DirectX::D2D::MF
Namespace containing things relating to the MF font loader.
Definition: FontLoader.h:44
OGRE
@ OGRE
Definition: rendering.h:41
BlamWidgetType::Basic_Ellipse
@ Basic_Ellipse
A basic filled or outline ellipse.
ImGui::InputText
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition: imgui_widgets.cpp:3068
BitmapText
@ BitmapText
Bitmap-based text, uses Blamite font system.
Definition: render_stack.h:72
BlamRendering::RenderStack::Text::font_buffer
char font_buffer[256]
Font name buffer for ImGUI editor.
Definition: render_stack.h:977
BlamRendering::RenderStack::Text::RefreshTranslation
void RefreshTranslation()
Refreshes any translation data and applies them to the child objects.
Definition: Text.cpp:55
BlamRendering::DirectX::D2D::GetD2DRenderTarget
BLAM ID2D1DeviceContext * GetD2DRenderTarget()
Retrieves the Direct2D render target.
Definition: render_manage.cpp:598
Blam::Content::Fonts::GetFontList
BLAM std::map< std::string, Font > * GetFontList()
Retrieves the list of loaded fonts.
Definition: fonts.cpp:835
BlamRendering::RenderStack::StackObjectBase::type_label
StackType type_label
The type of the object.
Definition: render_stack.h:372
BlamUIWidget::z_size
float z_size
Definition: ui.h:107
Blam::Globals::GetGlobalAsFloat
BLAM float * GetGlobalAsFloat(std::string name)
Retrieves a global's value as a float.
Definition: globals.cpp:407
font_file_lists
std::vector< MFFontList > font_file_lists
The list of font lists.
Definition: FontLoader.cpp:12
BlamUIWidget_Text::SetHidden
void SetHidden(bool new_hidden) override
Definition: text.cpp:588
BlamRendering::RenderStack::Line::zone_thickness
float zone_thickness
The thickness of the line area border.
Definition: render_stack.h:650
BlamRendering::RenderStack::GetDrawModesList
BLAM std::vector< StackItemDrawMode > GetDrawModesList()
Retrieves a list of all available drawing modes.
Definition: render_stack.cpp:216
BlamRendering::RenderStack::Line::end_point
D2D1_POINT_2F end_point
The ending point of the line.
Definition: render_stack.h:644
BlamUIWidget_BasicLine::Draw
void Draw() override
Definition: line.cpp:89
BlamRendering::RenderStack
Namespace containing things relating to the Render Stack.
Definition: drawing.h:14
BlamRendering::RenderStack::BitmapText::shadow_y
int shadow_y
The Y offset of the drop shadow.
Definition: render_stack.h:850
BlamUIWidget::GetAdjustedZIndex
int GetAdjustedZIndex()
Definition: BlamUIWidget.cpp:359
BlamRendering::RenderStack::DWText::SetFontSize
void SetFontSize(float new_size)
Sets the size to use for the font.
Definition: DWText.cpp:91
Blam::Content::Fonts::GetFont
BLAM Font * GetFont(std::string id)
Retrieves a font from the list of loaded fonts.
Definition: fonts.cpp:806
imgui_stdlib.h
y
font DisplayOffset y
Definition: README.txt:68
BlamRendering::RenderStack::Ellipse::thickness
float thickness
The current border thickness.
Definition: render_stack.h:565
BlamFontPackage::glyphs
BlamMap< char, BlamFontGlyph * > glyphs
Definition: fonts.h:63
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::Release
virtual ULONG __stdcall Release()
Releases the object.
Definition: MFFontFileEnumerator.cpp:56
rendering.h
ImGui::DragInt
IMGUI_API bool DragInt(const char *label, int *v, float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
Definition: imgui_widgets.cpp:2209
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::QueryInterface
virtual HRESULT __stdcall QueryInterface(REFIID iid, void **ppvObject)
Queries the interface.
Definition: MFFontFileEnumerator.cpp:36
BlamUIWidget_Text::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Definition: text.cpp:168
ImGui::SameLine
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition: imgui.cpp:7147
drawing.h
BlamRendering::RenderStack::DWText::font_name
std::wstring font_name
The current font name. Defaults to Comic Sans MS. :lmao:
Definition: render_stack.h:752
BlamRendering::RenderStack::Text::zone_thickness
float zone_thickness
The thickness of the zone border.
Definition: render_stack.h:969
BlamRendering::RenderStack::BitmapText::force_regenerate
bool force_regenerate
If enabled, will force the bitmap to regenerate on the next frame.
Definition: render_stack.h:864
BlamRendering::RenderStack::Text::shadow_x
int shadow_x
The X offset of the drop shadow.
Definition: render_stack.h:961
Blam::Content::Fonts::New::GetFont
BLAM BlamFontPackage * GetFont(std::string id)
Definition: fonts_new.cpp:662
BlamRendering::DirectX::D2D::MF::MFFontCollectionLoader::QueryInterface
virtual HRESULT __stdcall QueryInterface(REFIID iid, void **ppvObject)
Queries the interface.
Definition: MFFontCollectionLoader.cpp:5
BlamRendering::RenderStack::Ellipse::ellipse
D2D1_ELLIPSE ellipse
The data for the ellipse.
Definition: render_stack.h:567
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::~MFFontFileEnumerator
~MFFontFileEnumerator()
Releases the current file in the enumerator.
Definition: FontLoader.h:184
DRAWMODE_BOTH
#define DRAWMODE_BOTH
Definition: render_stack.h:35
BlamRendering::RenderStack::BitmapText::zone_thickness
float zone_thickness
The thickness of the zone border.
Definition: render_stack.h:856
NULL
Add a fourth parameter to bake specific font ranges NULL
Definition: README.txt:57
BlamRendering::RenderStack::Line::zone_color
D2D1_COLOR_F zone_color
The color of the line area border.
Definition: render_stack.h:649
Pixel::b
BYTE * b
The Blue value of the pixel.
Definition: render_utils.h:18
Blam::Content::Fonts::FontGlyph
Structure to contain data for a Font Glyph.
Definition: fonts.h:111
BlamRendering::OGRE::Get2DSceneManager
BLAM Ogre::SceneManager * Get2DSceneManager()
Definition: ogre.cpp:395
BlamFontPackage::monospace_width
int monospace_width
Definition: fonts.h:66
BlamRendering::DirectX::D2D::MF::MFFontCollectionLoader::CreateEnumeratorFromKey
virtual HRESULT __stdcall CreateEnumeratorFromKey(IDWriteFactory *factory, void const *collectionKey, UINT32 collectionKeySize, IDWriteFontFileEnumerator **fontFileEnumerator)
Creates a new Font File Enumerator.
Definition: MFFontCollectionLoader.cpp:37
BlamRendering::RenderStack::Text::use_background
bool use_background
Whether or not to draw a background behind the text.
Definition: render_stack.h:972
BlamRendering::RenderStack::DWText::SetFont
void SetFont(std::string new_font_name)
Sets the font to use for the text.
Definition: DWText.cpp:51
BlamFontPackage::CreateCopiedDatablock
Ogre::HlmsDatablock * CreateCopiedDatablock()
Definition: BlamFontPackage.cpp:35
BlamUIWidget_Text::~BlamUIWidget_Text
~BlamUIWidget_Text()
Definition: text.cpp:76
ImGui::DragFloat
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2164
BlamUIWidget::ShowImGuiPropertyEditor
virtual void ShowImGuiPropertyEditor()
Definition: BlamUIWidget.cpp:57
BlamFontGlyph
Definition: fonts.h:35
BlamRendering::RenderStack::BitmapText::text
std::string text
The text to display.
Definition: render_stack.h:846
errors.h
BlamRendering::DirectX::Drawing
Namespace containing functions to handle the drawing of Direct2D primitives.
Definition: drawing.h:28
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::MFFontFileEnumerator
MFFontFileEnumerator(IDWriteFactory *factory)
Sets reference counts and indexes to 0.
Definition: MFFontFileEnumerator.cpp:9
BlamRendering::RenderStack::StackObjectBase::color
D2D1_COLOR_F color
The color of the object.
Definition: render_stack.h:370
BlamUIWidget_Text::UpdateMetrics
void UpdateMetrics() override
Definition: text.cpp:194
ImGui::DragFloat2
IMGUI_API bool DragFloat2(const char *label, float v[2], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2169
ImGui::CollapsingHeader
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
Definition: imgui_widgets.cpp:5422
BlamRendering::RenderStack::Text::zone_color
D2D1_COLOR_F zone_color
The color to use for the zone border.
Definition: render_stack.h:968
BlamRendering::RenderStack::DWText::SetText
void SetText(std::string new_text)
Sets the text to display.
Definition: DWText.cpp:46
BlamUIWidget_Text::Draw
void Draw() override
Definition: text.cpp:115
Blam::Utils::Color::TranslateTextColorCode
BLAM BlamColor TranslateTextColorCode(char character)
Converts a character to its equivalent color code for use in multi-colored text.
Definition: color.cpp:5
BlamRendering::RenderStack::StackObjectBase::y
float y
The Y coordinate of the object.
Definition: render_stack.h:378
BlamUIWidget_BasicLine::~BlamUIWidget_BasicLine
~BlamUIWidget_BasicLine()
Definition: line.cpp:64
color.h
BlamRendering::RenderStack::Text::Text
Text()
Sets the stack type, creates the needed resources, and sets some default colors.
Definition: Text.cpp:12
BlamUIWidget::display_name
std::string display_name
Definition: ui.h:99
BlamRendering::RenderStack::DWText::SetZoneColor
void SetZoneColor(float new_color[3])
Sets the color to use for the zone edge.
Definition: DWText.cpp:63
BlamRendering::RenderStack::Text::SetFont
void SetFont(std::string new_font_id)
Sets the font to use for the text.
Definition: Text.cpp:134
DRAWMODE_OUTLINE
#define DRAWMODE_OUTLINE
Definition: render_stack.h:34
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::MoveNext
virtual HRESULT __stdcall MoveNext(BOOL *hasCurrentFile)
Moves to the next item in the enumerator.
Definition: MFFontFileEnumerator.cpp:68
BlamUIWidget_Text::color
BlamColor color
Definition: ui.h:323
BlamUIWidget::SetHidden
virtual void SetHidden(bool new_hidden)
Definition: BlamUIWidget.cpp:377
log_bitmap_error
void log_bitmap_error(std::string message, Font *font, char current_char, BlamLogLevel severity)
Logs a message to file, and adds information about the font and character that errored.
Definition: text.cpp:31
widgets.h
BlamFontPackageType::XMLBitmapAtlas
@ XMLBitmapAtlas
BlamFontPackage::type
BlamFontPackageType type
Definition: fonts.h:62
BlamRendering::RenderStack::BitmapText::Draw
void Draw()
Draws the stack object.
Definition: BitmapText.cpp:13
a
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1249
BlamRendering::DirectX::D2D::GetD2DFactory
BLAM ID2D1Factory * GetD2DFactory()
Retrieves the Direct2D factory.
Definition: render_manage.cpp:603
BlamFontPackage::line_height
int line_height
Definition: fonts.h:68
ImGui::BeginCombo
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
Definition: imgui_widgets.cpp:1416
ImGui::Selectable
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:5469
BlamRendering::DirectX::Drawing::DrawRect
BLAM HRESULT DrawRect(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_RECT_F rect, float thickness, StackItemDrawMode mode)
Draws a rectangle.
Definition: rect.cpp:9
DEFAULT_DRAWMODE
#define DEFAULT_DRAWMODE
Definition: render_stack.h:37
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator::AddRef
virtual ULONG __stdcall AddRef()
Acquires a new reference to the object.
Definition: MFFontFileEnumerator.cpp:51
BlamRendering::DirectX::D2D::MF::MFFontGlobals::getFontFileLists
BLAM std::vector< MFFontList > & getFontFileLists()
Retrieves the list of font lists.
Definition: FontLoader.cpp:95
translate_speed
float translate_speed
Definition: Line.cpp:11
render_utils.h
BlamRendering::OGRE::GetRenderHeight
BLAM int GetRenderHeight()
Definition: ogre.cpp:375
BlamFontPackageType::XMLBitmap
@ XMLBitmap
BlamRendering::RenderStack::BitmapText::bitmap_width
int bitmap_width
The width of the bitmap.
Definition: render_stack.h:861
material
Definition: material.h:53
BlamRendering::RenderStack::Ellipse::fill_color
D2D1_COLOR_F fill_color
The current fill color.
Definition: render_stack.h:566
BlamRendering::RenderStack::DWText::zone_thickness
float zone_thickness
The thickness of the zone border.
Definition: render_stack.h:757
globals.h
BlamRendering::RenderStack::Ellipse::SetThickness
void SetThickness(float new_thickness)
Sets the thickness of the ellipse's border.
Definition: ellipse.cpp:29
BlamUIWidget_BasicEllipse::Draw
void Draw() override
Definition: ellipse.cpp:177
STACKTYPE_TEXT
#define STACKTYPE_TEXT
Definition: render_stack.h:29
BlamRendering::RenderStack::BitmapText::use_shadow
bool use_shadow
Whether or not to draw the text with a drop shadow.
Definition: render_stack.h:852
BlamRendering::RenderStack::DWText::show_zone
bool show_zone
Whether or not to show the text zone.
Definition: render_stack.h:755
BlamRendering::RenderStack::Text::shadow_y
int shadow_y
The Y offset of the drop shadow.
Definition: render_stack.h:962
rect_limit_to_window
bool rect_limit_to_window
Definition: Line.cpp:10
BlamFontPackage::monospace
bool monospace
Definition: fonts.h:65
BlamRendering::RenderStack::DWText::ShowZoneEdge
void ShowZoneEdge(bool show)
Enables or disables the display of the text area bounds.
Definition: DWText.cpp:56
it
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause it
Definition: ARPHICPL.TXT:36
Blam::Content::Fonts::Font
Structure to contain data for a Font.
Definition: fonts.h:134
BlamWidgetType::Basic_Triangle
@ Basic_Triangle
A basic filled or outline triangle.
IM_ARRAYSIZE
#define IM_ARRAYSIZE(_ARR)
Definition: imgui.h:75
BlamRendering::RenderStack::DWText::ShowImPropertyEditor
void ShowImPropertyEditor()
Shows a set of ImGUI properties associated with the object.
Definition: DWText.cpp:96
BlamRendering::RenderStack::StackObjectBase::ValidateSizeAndTranslation
void ValidateSizeAndTranslation()
Validates X/Y coordinates and Width/Height sizes after the area has been modified.
Definition: StackObjectBase.cpp:135
BlamRendering::DirectX::Drawing::DrawBitmapText
BLAM HRESULT DrawBitmapText(BlamRendering::RenderStack::BitmapText *text_object, Blam::Content::Fonts::Font *font, bool replace_color_codes)
Draws the specified text using a Bitmap-based Blamite Font.
Definition: text.cpp:550
BlamUIWidget
Definition: ui.h:82
BlamRendering::RenderStack::StackObjectBase::PokeTranslation
void PokeTranslation()
Updates the area of the object to account for any x/y coordinate changes.
Definition: StackObjectBase.cpp:97
BlamUIWidget_BasicEllipse::~BlamUIWidget_BasicEllipse
~BlamUIWidget_BasicEllipse()
Definition: ellipse.cpp:152
BlamUIWidget_BasicLine::BlamUIWidget_BasicLine
BlamUIWidget_BasicLine(BlamUIWidget_Group *_parent)
Definition: line.cpp:53
ImGui::EndCombo
IMGUI_API void EndCombo()
Definition: imgui_widgets.cpp:1522
BlamRendering::RenderStack::StackObjectBase::area
D2D1_RECT_F area
The area of the object.
Definition: render_stack.h:369
BlamUIWidget_BasicEllipse::SetHidden
void SetHidden(bool new_hidden) override
Definition: ellipse.cpp:288
BlamRendering::RenderStack::DWText::use_engine_font
bool use_engine_font
Whether to use a font within the engine or a system font.
Definition: render_stack.h:759
BlamUIWidget_BasicEllipse::solid
bool solid
Definition: ui.h:225
MFFontList
std::vector< std::wstring > MFFontList
Somewhat pointless font list type definition, but it does make things slightly easier to read.
Definition: FontLoader.h:17
BlamUIWidget_Text::text
std::string text
Definition: ui.h:327
Blam::Content::Fonts::FontGlyph::width
short width
The width of the glyph image, in pixels.
Definition: fonts.h:121
BlamRendering::RenderStack::StackObjectBase::width
float width
The width of the object.
Definition: render_stack.h:379
height
int height
Definition: bgfx.cpp:20
BlamUIWidget::RefreshRelativePosition
virtual void RefreshRelativePosition()
Definition: BlamUIWidget.cpp:185
BlamRendering::RenderStack::BitmapText::show_zone
bool show_zone
Whether or not to show the text zone.
Definition: render_stack.h:854
BlamRendering::DirectX::D2D::MF::MFFontCollectionLoader::AddRef
virtual ULONG __stdcall AddRef()
Acquires a new reference to the object.
Definition: MFFontCollectionLoader.cpp:20
ImGui::ColorEdit4
IMGUI_API bool ColorEdit4(const char *label, float col[4], ImGuiColorEditFlags flags=0)
Definition: imgui_widgets.cpp:4154
x
config GlyphExtraSpacing x
Definition: README.txt:30
BlamUIWidget_Text::shadow_color
BlamColor shadow_color
Definition: ui.h:324
BlamRendering::OGRE::GetRenderWidth
BLAM int GetRenderWidth()
Definition: ogre.cpp:370
BlamRendering::DirectX::D2D::MF::MFFontGlobals::addFontCollection
BLAM void addFontCollection(std::string id, IDWriteFontCollection *collection)
Adds a font collection to the list of font collections.
Definition: FontLoader.cpp:65
BlamRendering::DirectX::D2D::MF::MFFontCollectionLoader::Release
virtual ULONG __stdcall Release()
Releases the object.
Definition: MFFontCollectionLoader.cpp:25
BlamRendering::DirectX::Utils::GetWICBitmapPixelData
BLAM HRESULT GetWICBitmapPixelData(IWICBitmap **bitmap, UINT *width, UINT *height, IWICBitmapLock **bitmap_lock, UINT *buffer_size, BYTE **start_address)
Retrieves the pixel data from a WIC bitmap.
Definition: bitmap_utils.cpp:182
BlamRendering::RenderStack::GetDrawModeLabel
BLAM std::string GetDrawModeLabel(StackItemDrawMode type)
Retrieves a string representation of the specified drawing mode.
Definition: render_stack.cpp:176
BlamRendering::RenderStack::Text::auto_calculate_area
bool auto_calculate_area
Whether or not to automatically calculate the text area.
Definition: render_stack.h:979
BlamRendering::RenderStack::DWText::SetZoneThickness
void SetZoneThickness(float new_thickness)
Sets the thickness of the zone edge.
Definition: DWText.cpp:86
BlamRendering::RenderStack::BitmapText::shadow_x
int shadow_x
The X offset of the drop shadow.
Definition: render_stack.h:849
BlamRendering::DirectX::WIC::GetWICFactory
BLAM IWICImagingFactory * GetWICFactory()
Retrieves the WIC Imaging Factory.
Definition: wic.cpp:53
BlamFontPackageType::XMLTruetype
@ XMLTruetype
Pixel::a
BYTE * a
The Alpha value of the pixel.
Definition: render_utils.h:19
font_collections
std::map< std::string, IDWriteFontCollection * > font_collections
The list of font collections.
Definition: FontLoader.cpp:20
BlamUIWidget_BasicLine::start
BlamVector2 start
Definition: ui.h:251
BlamRendering::RenderStack::Text::use_shadow
bool use_shadow
Whether or not to draw the text with a drop shadow.
Definition: render_stack.h:964
Blam::Utils::Color::D2DColorFromBlamColor
BLAM D2D1_COLOR_F D2DColorFromBlamColor(BlamColor color)
Converts a BlamColor object into its equivalent D2D1_COLOR_F object.
Definition: color.cpp:46
BlamRendering::RenderStack::Text::bg_color
D2D1_COLOR_F bg_color
The color to use for the text background.
Definition: render_stack.h:973
BlamUIWidget::IsHidden
bool IsHidden()
Definition: BlamUIWidget.cpp:382
BlamRendering::DirectX::Utils::IntegerBitmapScale
BLAM HRESULT IntegerBitmapScale(IWICBitmap *source, int scale_factor, ID2D1Bitmap **destination, ID2D1RenderTarget *target)
Scales a bitmap using integer scaling.
Definition: bitmap_utils.cpp:10
DRAWMODE_FILL
#define DRAWMODE_FILL
Definition: render_stack.h:33
BlamRendering::RenderStack::Text::ShowImPropertyEditor
void ShowImPropertyEditor()
Shows a set of ImGUI properties associated with the object.
Definition: Text.cpp:188
bitmap
Definition: bitmap.h:33
ImGui::Separator
IMGUI_API void Separator()
Definition: imgui_widgets.cpp:1284
Pixel::g
BYTE * g
The Green value of the pixel.
Definition: render_utils.h:17
BlamFontPackageType::Bitmap
@ Bitmap
BlamWidgetType
BlamWidgetType
Enumerator listing possible UI widget types.
Definition: ui.h:60
draw_text_main
HRESULT draw_text_main(int origin_x, int origin_y, ID2D1RenderTarget *target, int text_length, const char *text_cstr, Font *font, D2D1_COLOR_F color, bool ignore_color_codes)
Main function to draw text data.
Definition: text.cpp:143
BlamRendering::DirectX::D2D::MF::CreateFontCollection
BLAM HRESULT CreateFontCollection(MFFontList &newCollection, std::string font_id)
Creates a new font collection.
Definition: FontLoader.cpp:26
BlamRendering::RenderStack::StackObjectBase::height
float height
The height of the object.
Definition: render_stack.h:380
Blam::Error::GetStringFromHResult
BLAM std::string GetStringFromHResult(HRESULT hr)
Converts a result handle to a string.
Definition: errors.cpp:120
BlamRendering::RenderStack::Ellipse::PokeEllipseTranslation
void PokeEllipseTranslation()
Updates the ellipse origin point based on the x/y coordinates.
Definition: ellipse.cpp:23
BlamRendering::RenderStack::DWText::text
std::wstring text
The current text to display.
Definition: render_stack.h:751
BlamFontPackage::ttf_font
Ogre::FontPtr ttf_font
Definition: fonts.h:77
BlamRendering::RenderStack::BitmapText
Class representing text drawn using a Bitmap-based engine font.
Definition: render_stack.h:794
resolve_font_uv
BlamVector4 resolve_font_uv(int coord_x, int coord_y, int tex_width, int tex_height, int slots_x, int slots_y)
Definition: text.cpp:17
BlamRendering::RenderStack::Line::ShowImPropertyEditor
void ShowImPropertyEditor()
Shows a set of ImGUI properties associated with the object.
Definition: Line.cpp:53
BlamRendering::DirectX::D2D::MF::MFFontFileEnumerator
Class to implement the DirectWrite Font File Enumerator interface.
Definition: FontLoader.h:163
BlamRendering::DirectX::D2D::MF::MFFontGlobals::push
BLAM int push(MFFontList &collection)
Inserts a font list into the list of font lists.
Definition: FontLoader.cpp:56
BlamRendering::RenderStack::Text::~Text
~Text()
Deletes any used resources.
Definition: Text.cpp:32
BlamRendering::DirectX::Drawing::DrawRoundedRect
BLAM HRESULT DrawRoundedRect(D2D1_COLOR_F outline_color, D2D1_COLOR_F fill_color, D2D1_ROUNDED_RECT rounded_rect, float thickness, StackItemDrawMode mode)
Draws a rounded rectangle.
Definition: rounded_rect.cpp:10
BlamRendering::DirectX::D2D::MF::MFFontCollectionLoader
Class to assist in the loading of font collections.
Definition: FontLoader.h:106
BlamUIWidget::auto_update
bool auto_update
Definition: ui.h:108
Blam::Content::Fonts::GetFontGlyph
BLAM FontGlyph * GetFontGlyph(Font *font, char glyph)
Retrieves a glyph from a font.
Definition: fonts.cpp:820
BlamUIWidget::position_absolute
BlamVector2 position_absolute
Definition: ui.h:91
BlamRendering::RenderStack::BitmapText::updateCachedProperties
void updateCachedProperties()
Updates the currently cached properties.
Definition: BitmapText.cpp:50
BlamRendering::DirectX::Drawing::Widgets::DrawInvalidBitmapArea
BLAM void DrawInvalidBitmapArea(D2D1_RECT_F area)
A widget used to represent an invalid bitmap.
Definition: invalid_bitmap.cpp:7
BlamUIWidget_BasicEllipse::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Definition: ellipse.cpp:205
BlamRendering::DirectX::D2D::MF::MFFontGlobals::getFontCollection
BLAM IDWriteFontCollection * getFontCollection(std::string id)
Retrieves a font collection from the list of font collections.
Definition: FontLoader.cpp:70
Blam::Content::Fonts
Definition: fonts.h:99
BlamUIWidget_Text::RebuildTextObject
void RebuildTextObject()
Definition: text.cpp:310
BlamRendering::RenderStack::Ellipse::ShowImPropertyEditor
void ShowImPropertyEditor()
Shows a set of ImGUI properties associated with the object.
Definition: ellipse.cpp:34
StackItemDrawMode
StackItemDrawMode
Enumerator to specify the stack item draw mode.
Definition: render_stack.h:85
Text
@ Text
Master text object that wraps around both BitmapText and DWText.
Definition: render_stack.h:73
BlamUIWidget_BasicEllipse::BlamUIWidget_BasicEllipse
BlamUIWidget_BasicEllipse(BlamUIWidget_Group *_parent)
Definition: ellipse.cpp:141
BlamUIWidget::size_absolute
BlamVector2 size_absolute
Definition: ui.h:92
BlamUIWidget_BasicEllipse::radius
BlamVector2 radius
Definition: ui.h:224
BlamRendering::RenderStack::Text::text_buffer
char text_buffer[1024]
Text buffer for ImGUI editor.
Definition: render_stack.h:976
BlamRendering::RenderStack::Line::SetThickness
void SetThickness(float new_thickness)
Sets the thickness of the line.
Definition: Line.cpp:48
BlamFontPackage::charspacing
int charspacing
Definition: fonts.h:67
BlamUIWidget_Text::auto_scale_shadow
bool auto_scale_shadow
Definition: ui.h:320
DWText
@ DWText
DirectWrite Text, does not utilize our font system - probably dont use this.
Definition: render_stack.h:63
ImGui::InputFloat
IMGUI_API bool InputFloat(const char *label, float *v, float step=0.0f, float step_fast=0.0f, const char *format="%.3f", ImGuiInputTextFlags flags=0)
Definition: imgui_widgets.cpp:2975
Blam::Content::Fonts::FontGlyph::height
short height
The height of the glyph image, in pixels.
Definition: fonts.h:122
BlamRendering::RenderStack::DWText::engine_font_id
std::string engine_font_id
The ID of the font collection to use.
Definition: render_stack.h:760
generate_bitmap
HRESULT generate_bitmap(Font *font, std::string text, float x, float y, D2D1_COLOR_F color, bool use_shadow, int shadow_x, int shadow_y, D2D1_COLOR_F shadow_color, bool show_zone, D2D1_COLOR_F zone_color, float zone_thickness, ID2D1Bitmap **text_bitmap, D2D1_RECT_F *area)
Generates a bitmap containing the full text object to display.
Definition: text.cpp:331
BlamRendering::DirectX::Drawing::DWDrawText
BLAM HRESULT DWDrawText(std::wstring text, std::wstring font, float size, D2D1_RECT_F area, D2D1_COLOR_F color)
Draws a string using DirectWrite.
Definition: dwtext.cpp:16
BlamRendering::RenderStack::BitmapText::hasAnyPropertyChanged
bool hasAnyPropertyChanged()
Determines if any current properties differ from their cached copies.
Definition: BitmapText.cpp:71
BlamRendering::DirectX::D2D::MF::MFFontGlobals::cleanupCollectionList
BLAM void cleanupCollectionList()
Cleans up the font collection list.
Definition: FontLoader.cpp:85
BlamUIWidget_BasicEllipse::UpdateMetrics
void UpdateMetrics() override
Definition: ellipse.cpp:243
BlamFontPackage::space_width
int space_width
Definition: fonts.h:69
Blam::Content::Fonts::FontGlyph::bitmap
IWICBitmap * bitmap
The WIC bitmap for this glyph.
Definition: fonts.h:127
BlamUIWidget_BasicLine::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Definition: line.cpp:117
BlamRendering::RenderStack::Line::thickness
float thickness
The line thickness.
Definition: render_stack.h:646
BlamFontPackageType::BitmapAtlas
@ BitmapAtlas
BlamRendering::RenderStack::Line::Draw
void Draw()
Draws the stack object.
Definition: Line.cpp:14
BlamRendering::RenderStack::StackObjectBase::x
float x
The X coordinate of the object.
Definition: render_stack.h:377
BlamRendering::RenderStack::Line::PokeLineTranslation
void PokeLineTranslation()
Pokes the line start/end points to match the coordinates/area.
Definition: Line.cpp:37
Pixel
Structure representing a single pixel.
Definition: render_utils.h:14
BlamRendering::RenderStack::Text::font_size
float font_size
The size of the font. Only used with TrueType fonts.
Definition: render_stack.h:957
BlamRendering::RenderStack::Text::show_zone
bool show_zone
Whether or not to show the text zone.
Definition: render_stack.h:967
BlamRendering::RenderStack::Text::text
std::string text
The text to display.
Definition: render_stack.h:956
collection_keys
std::vector< unsigned int > collection_keys
The list of collection keys. (?)
Definition: FontLoader.cpp:22
BlamRendering::DirectX::Drawing::DrawLine
BLAM HRESULT DrawLine(D2D1_COLOR_F color, D2D1_POINT_2F start_point, D2D1_POINT_2F end_point, float thickness)
Draws a line.
Definition: line.cpp:10