MCPcopy Create free account
hub / github.com/MapServer/MapServer / font

Method font

renderers/agg/include/agg_font_cache_manager.h:157–185  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

155
156 //--------------------------------------------------------------------
157 void font(const char* font_signature, bool reset_cache = false)
158 {
159 int idx = find_font(font_signature);
160 if(idx >= 0)
161 {
162 if(reset_cache)
163 {
164 obj_allocator<font_cache>::deallocate(m_fonts[idx]);
165 m_fonts[idx] = obj_allocator<font_cache>::allocate();
166 m_fonts[idx]->signature(font_signature);
167 }
168 m_cur_font = m_fonts[idx];
169 }
170 else
171 {
172 if(m_num_fonts >= m_max_fonts)
173 {
174 obj_allocator<font_cache>::deallocate(m_fonts[0]);
175 memcpy(m_fonts,
176 m_fonts + 1,
177 (m_max_fonts - 1) * sizeof(font_cache*));
178 m_num_fonts = m_max_fonts - 1;
179 }
180 m_fonts[m_num_fonts] = obj_allocator<font_cache>::allocate();
181 m_fonts[m_num_fonts]->signature(font_signature);
182 m_cur_font = m_fonts[m_num_fonts];
183 ++m_num_fonts;
184 }
185 }
186
187 //--------------------------------------------------------------------
188 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