bahamut/tools/font-encoder.hpp
//loads icons from the Japanese 8x8 menu font into character slots 0x70-0x7c.
//this is used to allow the list editor to render icons in the English preview area.
loads icons from the Japanese 8x8 menu font into character slots 0x70-0x7c.
this is used to allow the list editor to render icons in the English preview area.
loads icons from the Japanese 8x8 menu font into character slots 0x70 - 0x7c . this is used to allow the list editor to render icons in the English preview area .
auto FontEncoder::loadMenuIcons() -> void {
  FontExtractor font;
  font.extractMenu();
  for(u32 index : range(13)) {
    characters[0x70 + index].width = 9;
    memory::fill<u8>(characters[0x70 + index].kerning, 192);
    memory::fill<u8>(characters[0x70 + index].data,    272);
    if(index == 0) continue;
    for(u32 py : range(8)) {
      for(u32 px : range(8)) {
        u8 color = font.character(0xd4 + index)[py * 8 + px];
        switch(color) {
        case 1: color = 1; break;
        case 2: color = 2; break;
        case 3: color = 3; break;
        }
        characters[0x70 + index].data[py * 8 + px] = color;
      }
    }
  }
}
auto FontEncoder :: loadMenuIcons ( ) -> void { FontExtractor font ; font . extractMenu ( ) ; for ( u32 index : range ( 13 ) ) { characters [ 0x70 + index ] . width = 9 ; memory :: fill < u8 > ( characters [ 0x70 + index ] . kerning , 192 ) ; memory :: fill < u8 > ( characters [ 0x70 + index ] . data , 272 ) ; if ( index == 0 ) continue ; for ( u32 py : range ( 8 ) ) { for ( u32 px : range ( 8 ) ) { u8 color = font . character ( 0xd4 + index ) [ py * 8 + px ] ; switch ( color ) { case 1 : color = 1 ; break ; case 2 : color = 2 ; break ; case 3 : color = 3 ; break ; } characters [ 0x70 + index ] . data [ py * 8 + px ] = color ; } } } }
loads icons from the Japanese 8x8 menu font into character slots 0x70-0x7c.
loads icons from the Japanese 8x8 menu font into character slots 0x70 - 0x7c .