MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / font

Method font

dep/agg/include/agg_font_cache_manager.h:149–177  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

147
148 //--------------------------------------------------------------------
149 void font(const char* font_signature, bool reset_cache = false)
150 {
151 int idx = find_font(font_signature);
152 if (idx >= 0)
153 {
154 if (reset_cache)
155 {
156 obj_allocator<font_cache>::deallocate(m_fonts[idx]);
157 m_fonts[idx] = obj_allocator<font_cache>::allocate();
158 m_fonts[idx]->signature(font_signature);
159 }
160 m_cur_font = m_fonts[idx];
161 }
162 else
163 {
164 if (m_num_fonts >= m_max_fonts)
165 {
166 obj_allocator<font_cache>::deallocate(m_fonts[0]);
167 std::memcpy(m_fonts,
168 m_fonts + 1,
169 (m_max_fonts - 1) * sizeof(font_cache*));
170 m_num_fonts = m_max_fonts - 1;
171 }
172 m_fonts[m_num_fonts] = obj_allocator<font_cache>::allocate();
173 m_fonts[m_num_fonts]->signature(font_signature);
174 m_cur_font = m_fonts[m_num_fonts];
175 ++m_num_fonts;
176 }
177 }
178
179 //--------------------------------------------------------------------
180 const font_cache* font() const

Callers 2

reset_cacheMethod · 0.45
synchronizeMethod · 0.45

Calls 1

signatureMethod · 0.80

Tested by

no test coverage detected