--------------------------------------------------------------------
| 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 |
no test coverage detected