From 2fa1bb084e54af7134b44d3ee7512056e28de67e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 30 Sep 2019 14:06:46 +0300 Subject: [PATCH] Initialize members of Font::Glyph It's not safe to assume that font files contain all of the values for every glyph. --- source/font.cpp | 14 ++++++++++++++ source/font.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/source/font.cpp b/source/font.cpp index 3fd24d8e..fba9f331 100644 --- a/source/font.cpp +++ b/source/font.cpp @@ -140,6 +140,20 @@ unsigned Font::get_ligature(unsigned code, unsigned next) const } +Font::Glyph::Glyph(): + code(0), + x1(0), + y1(0), + x2(1), + y2(1), + w(1), + h(1), + off_x(0), + off_y(0), + advance(1) +{ } + + Font::Loader::Loader(Font &f): DataFile::CollectionObjectLoader(f, 0) { diff --git a/source/font.h b/source/font.h index dab09fa4..a4fc71ae 100644 --- a/source/font.h +++ b/source/font.h @@ -50,6 +50,8 @@ public: float w, h; float off_x, off_y; float advance; + + Glyph(); }; private: -- 2.45.2