From 973cd8d5e37dba2e15de3d3fd1965d2fbfc2cdab Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 19 Dec 2012 18:38:04 -0500 Subject: EN: Link the French translation to the interface. FR: Ajout de la traduction française à l'interface. EN: * bdf_font.c: Add support for having a main font, [0], of more than 128 characters. Refactor character width checks into a new function, BDF_width16_ucs. * bdf_font.h, draw.h, gui.c: Use UTF-8 for all strings to allow more translations. Use BDF_width16_ucs where possible. FR: * bdf_font.c: Prendre en charge une police principale, [0], de plus de 128 caractères. Diriger les vérifications de la largeur d'un caractère vers une nouvelle routine, BDF_width16_ucs. * bdf_font.h, draw.h, gui.c: Utiliser le codage UTF-8 pour toutes les chaînes pour permettre d'autres traductions. Utiliser BDF_width16_ucs là où c'est possible. --- source/font/Pictochat-16.bdf | 2682 ++++++++++++++++++++++++++++++++++++++++++ source/font/README.txt | 40 + source/nds/bdf_font.c | 300 ++--- source/nds/draw.h | 118 +- source/nds/gui.c | 38 +- source/nds/message.h | 2 +- 6 files changed, 2962 insertions(+), 218 deletions(-) create mode 100644 source/font/Pictochat-16.bdf create mode 100644 source/font/README.txt (limited to 'source') diff --git a/source/font/Pictochat-16.bdf b/source/font/Pictochat-16.bdf new file mode 100644 index 0000000..9749a85 --- /dev/null +++ b/source/font/Pictochat-16.bdf @@ -0,0 +1,2682 @@ +STARTFONT 2.1 +FONT -FontForge-Pictochat-Book-R-Normal--16-150-75-75-P-53-ISO10646-1 +SIZE 15 75 75 +FONTBOUNDINGBOX 9 13 0 -1 +COMMENT "Generated by fontforge, http://fontforge.sourceforge.net" +STARTPROPERTIES 37 +FAMILY_NAME "Pictochat" +WEIGHT_NAME "Book" +SLANT "R" +SETWIDTH_NAME "Normal" +ADD_STYLE_NAME "" +PIXEL_SIZE 16 +POINT_SIZE 150 +RESOLUTION_X 75 +RESOLUTION_Y 75 +SPACING "P" +AVERAGE_WIDTH 53 +CHARSET_REGISTRY "ISO10646" +CHARSET_ENCODING "1" +FONTNAME_REGISTRY "" +CHARSET_COLLECTIONS "ISO10646-1" +FONT_NAME "Pictochat" +FACE_NAME "Pictochat Regular" +FONT_VERSION "1.0" +FONT_ASCENT 13 +FONT_DESCENT 3 +UNDERLINE_POSITION 2 +UNDERLINE_THICKNESS 1 +X_HEIGHT 5 +CAP_HEIGHT 8 +RAW_ASCENT 799 +RAW_DESCENT 200 +NORM_SPACE 2 +RELATIVE_WEIGHT 40 +RELATIVE_SETWIDTH 50 +SUPERSCRIPT_X 0 +SUPERSCRIPT_Y 8 +SUPERSCRIPT_SIZE 8 +SUBSCRIPT_X 0 +SUBSCRIPT_Y 0 +SUBSCRIPT_SIZE 8 +AVG_LOWERCASE_WIDTH 55 +AVG_UPPERCASE_WIDTH 56 +ENDPROPERTIES +CHARS 176 +STARTCHAR space +ENCODING 32 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 1 0 0 +BITMAP +00 +ENDCHAR +STARTCHAR exclam +ENCODING 33 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 9 0 0 +BITMAP +80 +80 +80 +80 +80 +80 +00 +80 +80 +ENDCHAR +STARTCHAR quotedbl +ENCODING 34 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 3 0 6 +BITMAP +28 +50 +A0 +ENDCHAR +STARTCHAR numbersign +ENCODING 35 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 9 0 0 +BITMAP +14 +14 +7E +28 +28 +28 +FC +50 +50 +ENDCHAR +STARTCHAR dollar +ENCODING 36 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +70 +A8 +A0 +70 +28 +A8 +70 +20 +ENDCHAR +STARTCHAR percent +ENCODING 37 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 9 0 0 +BITMAP +44 +A4 +A8 +48 +10 +24 +2A +4A +44 +ENDCHAR +STARTCHAR ampersand +ENCODING 38 +SWIDTH 437 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +20 +50 +50 +50 +20 +54 +88 +88 +74 +ENDCHAR +STARTCHAR quotesingle +ENCODING 39 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 1 2 1 7 +BITMAP +80 +80 +ENDCHAR +STARTCHAR parenleft +ENCODING 40 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +20 +40 +40 +80 +80 +80 +40 +40 +20 +ENDCHAR +STARTCHAR parenright +ENCODING 41 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +80 +40 +40 +20 +20 +20 +40 +40 +80 +ENDCHAR +STARTCHAR asterisk +ENCODING 42 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 7 0 1 +BITMAP +10 +92 +54 +38 +54 +92 +10 +ENDCHAR +STARTCHAR plus +ENCODING 43 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 5 0 2 +BITMAP +20 +20 +F8 +20 +20 +ENDCHAR +STARTCHAR comma +ENCODING 44 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 2 2 0 -1 +BITMAP +40 +80 +ENDCHAR +STARTCHAR hyphen +ENCODING 45 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 1 0 4 +BITMAP +F8 +ENDCHAR +STARTCHAR period +ENCODING 46 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 1 1 0 0 +BITMAP +80 +ENDCHAR +STARTCHAR slash +ENCODING 47 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +20 +20 +20 +40 +40 +40 +80 +80 +80 +ENDCHAR +STARTCHAR zero +ENCODING 48 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +70 +88 +98 +98 +A8 +C8 +C8 +88 +70 +ENDCHAR +STARTCHAR one +ENCODING 49 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 2 9 0 0 +BITMAP +C0 +40 +40 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR two +ENCODING 50 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F0 +08 +08 +08 +70 +80 +80 +80 +F8 +ENDCHAR +STARTCHAR three +ENCODING 51 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F0 +08 +08 +08 +70 +08 +08 +08 +F0 +ENDCHAR +STARTCHAR four +ENCODING 52 +SWIDTH 437 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +88 +88 +88 +88 +88 +7C +08 +08 +08 +ENDCHAR +STARTCHAR five +ENCODING 53 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F8 +80 +80 +80 +F0 +08 +08 +08 +F0 +ENDCHAR +STARTCHAR six +ENCODING 54 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +70 +80 +80 +80 +F0 +88 +88 +88 +70 +ENDCHAR +STARTCHAR seven +ENCODING 55 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F8 +08 +08 +10 +20 +20 +20 +20 +20 +ENDCHAR +STARTCHAR eight +ENCODING 56 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +70 +88 +88 +88 +70 +88 +88 +88 +70 +ENDCHAR +STARTCHAR nine +ENCODING 57 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +70 +88 +88 +88 +78 +08 +08 +08 +70 +ENDCHAR +STARTCHAR colon +ENCODING 58 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 5 0 2 +BITMAP +80 +00 +00 +00 +80 +ENDCHAR +STARTCHAR semicolon +ENCODING 59 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 2 6 0 1 +BITMAP +40 +00 +00 +00 +40 +80 +ENDCHAR +STARTCHAR less +ENCODING 60 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 5 0 2 +BITMAP +20 +40 +80 +40 +20 +ENDCHAR +STARTCHAR equal +ENCODING 61 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 3 0 3 +BITMAP +F8 +00 +F8 +ENDCHAR +STARTCHAR greater +ENCODING 62 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 5 0 2 +BITMAP +80 +40 +20 +40 +80 +ENDCHAR +STARTCHAR question +ENCODING 63 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +E0 +10 +10 +20 +40 +40 +00 +40 +40 +ENDCHAR +STARTCHAR at +ENCODING 64 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 9 0 0 +BITMAP +38 +44 +9A +AA +AA +AA +9C +40 +3C +ENDCHAR +STARTCHAR A +ENCODING 65 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR B +ENCODING 66 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F0 +88 +88 +88 +F0 +88 +88 +88 +F0 +ENDCHAR +STARTCHAR C +ENCODING 67 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +78 +80 +80 +80 +80 +80 +80 +80 +78 +ENDCHAR +STARTCHAR D +ENCODING 68 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F0 +88 +88 +88 +88 +88 +88 +88 +F0 +ENDCHAR +STARTCHAR E +ENCODING 69 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +F0 +80 +80 +80 +F0 +80 +80 +80 +F0 +ENDCHAR +STARTCHAR F +ENCODING 70 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +F0 +80 +80 +80 +F0 +80 +80 +80 +80 +ENDCHAR +STARTCHAR G +ENCODING 71 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +78 +80 +80 +80 +B8 +88 +88 +88 +70 +ENDCHAR +STARTCHAR H +ENCODING 72 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +88 +88 +F8 +88 +88 +88 +88 +ENDCHAR +STARTCHAR I +ENCODING 73 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 9 0 0 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR J +ENCODING 74 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +10 +10 +10 +10 +10 +10 +10 +10 +E0 +ENDCHAR +STARTCHAR K +ENCODING 75 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +90 +90 +A0 +C0 +A0 +90 +90 +88 +ENDCHAR +STARTCHAR L +ENCODING 76 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +F0 +ENDCHAR +STARTCHAR M +ENCODING 77 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +D8 +D8 +A8 +A8 +88 +88 +88 +ENDCHAR +STARTCHAR N +ENCODING 78 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +C8 +C8 +A8 +A8 +98 +98 +88 +88 +ENDCHAR +STARTCHAR O +ENCODING 79 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +70 +88 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR P +ENCODING 80 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F0 +88 +88 +88 +F0 +80 +80 +80 +80 +ENDCHAR +STARTCHAR Q +ENCODING 81 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 10 0 -1 +BITMAP +70 +88 +88 +88 +88 +88 +88 +A8 +70 +18 +ENDCHAR +STARTCHAR R +ENCODING 82 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F0 +88 +88 +88 +F0 +90 +90 +88 +88 +ENDCHAR +STARTCHAR S +ENCODING 83 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +70 +80 +80 +80 +60 +10 +10 +10 +E0 +ENDCHAR +STARTCHAR T +ENCODING 84 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +F8 +20 +20 +20 +20 +20 +20 +20 +20 +ENDCHAR +STARTCHAR U +ENCODING 85 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR V +ENCODING 86 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +88 +50 +50 +50 +50 +20 +20 +ENDCHAR +STARTCHAR W +ENCODING 87 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +A8 +A8 +A8 +A8 +50 +50 +50 +ENDCHAR +STARTCHAR X +ENCODING 88 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +50 +50 +20 +50 +50 +88 +88 +ENDCHAR +STARTCHAR Y +ENCODING 89 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +50 +50 +20 +20 +20 +20 +20 +ENDCHAR +STARTCHAR Z +ENCODING 90 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +F0 +10 +20 +20 +60 +40 +40 +80 +F0 +ENDCHAR +STARTCHAR bracketleft +ENCODING 91 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +E0 +80 +80 +80 +80 +80 +80 +80 +E0 +ENDCHAR +STARTCHAR backslash +ENCODING 92 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +80 +80 +80 +40 +40 +40 +20 +20 +20 +ENDCHAR +STARTCHAR bracketright +ENCODING 93 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +E0 +20 +20 +20 +20 +20 +20 +20 +E0 +ENDCHAR +STARTCHAR asciicircum +ENCODING 94 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 2 0 7 +BITMAP +40 +A0 +ENDCHAR +STARTCHAR underscore +ENCODING 95 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 1 0 0 +BITMAP +F8 +ENDCHAR +STARTCHAR grave +ENCODING 96 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 2 2 0 7 +BITMAP +80 +40 +ENDCHAR +STARTCHAR a +ENCODING 97 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR b +ENCODING 98 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +80 +80 +80 +F0 +88 +88 +88 +88 +F0 +ENDCHAR +STARTCHAR c +ENCODING 99 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +78 +80 +80 +80 +80 +78 +ENDCHAR +STARTCHAR d +ENCODING 100 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +08 +08 +08 +78 +88 +88 +88 +88 +78 +ENDCHAR +STARTCHAR e +ENCODING 101 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +70 +88 +F8 +80 +80 +78 +ENDCHAR +STARTCHAR f +ENCODING 102 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +30 +40 +40 +F0 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR g +ENCODING 103 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 7 0 -1 +BITMAP +78 +88 +88 +88 +78 +08 +F0 +ENDCHAR +STARTCHAR h +ENCODING 104 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +80 +80 +80 +F0 +88 +88 +88 +88 +88 +ENDCHAR +STARTCHAR i +ENCODING 105 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 8 0 0 +BITMAP +80 +00 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR j +ENCODING 106 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 -1 +BITMAP +20 +00 +20 +20 +20 +20 +20 +20 +C0 +ENDCHAR +STARTCHAR k +ENCODING 107 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +80 +80 +80 +90 +A0 +C0 +A0 +90 +90 +ENDCHAR +STARTCHAR l +ENCODING 108 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 2 9 0 0 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +40 +ENDCHAR +STARTCHAR m +ENCODING 109 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 6 0 0 +BITMAP +FC +92 +92 +92 +92 +92 +ENDCHAR +STARTCHAR n +ENCODING 110 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +F0 +88 +88 +88 +88 +88 +ENDCHAR +STARTCHAR o +ENCODING 111 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR p +ENCODING 112 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 7 0 -1 +BITMAP +F0 +88 +88 +88 +F0 +80 +80 +ENDCHAR +STARTCHAR q +ENCODING 113 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 7 0 -1 +BITMAP +78 +88 +88 +88 +78 +08 +08 +ENDCHAR +STARTCHAR r +ENCODING 114 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 6 0 0 +BITMAP +B0 +C0 +80 +80 +80 +80 +ENDCHAR +STARTCHAR s +ENCODING 115 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 6 0 0 +BITMAP +70 +80 +60 +10 +10 +E0 +ENDCHAR +STARTCHAR t +ENCODING 116 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 8 0 0 +BITMAP +40 +40 +F0 +40 +40 +40 +40 +30 +ENDCHAR +STARTCHAR u +ENCODING 117 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +88 +88 +88 +88 +88 +78 +ENDCHAR +STARTCHAR v +ENCODING 118 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +88 +88 +50 +50 +20 +20 +ENDCHAR +STARTCHAR w +ENCODING 119 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +88 +A8 +A8 +A8 +50 +50 +ENDCHAR +STARTCHAR x +ENCODING 120 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +88 +50 +20 +20 +50 +88 +ENDCHAR +STARTCHAR y +ENCODING 121 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 7 0 -1 +BITMAP +88 +88 +50 +50 +20 +20 +C0 +ENDCHAR +STARTCHAR z +ENCODING 122 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 6 0 0 +BITMAP +F8 +10 +20 +40 +80 +F8 +ENDCHAR +STARTCHAR braceleft +ENCODING 123 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +30 +40 +40 +40 +80 +40 +40 +40 +30 +ENDCHAR +STARTCHAR bar +ENCODING 124 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 1 9 1 0 +BITMAP +80 +80 +80 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR braceright +ENCODING 125 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +C0 +20 +20 +20 +10 +20 +20 +20 +C0 +ENDCHAR +STARTCHAR asciitilde +ENCODING 126 +SWIDTH 625 0 +DWIDTH 10 0 +BBX 9 2 0 4 +BITMAP +7880 +8700 +ENDCHAR +STARTCHAR exclamdown +ENCODING 161 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 9 0 0 +BITMAP +80 +80 +00 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR cent +ENCODING 162 +SWIDTH 437 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +10 +78 +94 +A0 +A0 +A0 +C4 +78 +40 +ENDCHAR +STARTCHAR sterling +ENCODING 163 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +30 +48 +40 +20 +F8 +20 +40 +80 +F8 +ENDCHAR +STARTCHAR yen +ENCODING 165 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +88 +88 +50 +50 +F8 +20 +F8 +20 +20 +ENDCHAR +STARTCHAR brokenbar +ENCODING 166 +SWIDTH 125 0 +DWIDTH 2 0 +BBX 1 9 0 0 +BITMAP +80 +80 +80 +80 +00 +80 +80 +80 +80 +ENDCHAR +STARTCHAR copyright +ENCODING 169 +SWIDTH 625 0 +DWIDTH 10 0 +BBX 9 9 0 0 +BITMAP +3E00 +4100 +9C80 +A280 +A080 +A280 +9C80 +4100 +3E00 +ENDCHAR +STARTCHAR registered +ENCODING 174 +SWIDTH 625 0 +DWIDTH 10 0 +BBX 9 9 0 0 +BITMAP +3E00 +4100 +BC80 +A280 +BC80 +A480 +A280 +4100 +3E00 +ENDCHAR +STARTCHAR degree +ENCODING 176 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 3 0 6 +BITMAP +40 +A0 +40 +ENDCHAR +STARTCHAR plusminus +ENCODING 177 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 7 0 1 +BITMAP +20 +20 +F8 +20 +20 +00 +F8 +ENDCHAR +STARTCHAR acute +ENCODING 180 +SWIDTH 187 0 +DWIDTH 3 0 +BBX 2 2 0 7 +BITMAP +40 +80 +ENDCHAR +STARTCHAR periodcentered +ENCODING 183 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 2 2 1 3 +BITMAP +C0 +C0 +ENDCHAR +STARTCHAR questiondown +ENCODING 191 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 9 0 0 +BITMAP +20 +20 +00 +20 +20 +40 +80 +80 +70 +ENDCHAR +STARTCHAR Agrave +ENCODING 192 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +20 +10 +00 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR Aacute +ENCODING 193 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +20 +40 +00 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR Acircumflex +ENCODING 194 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 12 0 0 +BITMAP +20 +50 +00 +20 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR Atilde +ENCODING 195 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +28 +50 +00 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR Adieresis +ENCODING 196 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +50 +00 +20 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR Aring +ENCODING 197 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 12 0 0 +BITMAP +20 +50 +20 +00 +20 +50 +50 +50 +F8 +88 +88 +88 +ENDCHAR +STARTCHAR Ccedilla +ENCODING 199 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 10 0 -1 +BITMAP +70 +80 +80 +80 +80 +80 +80 +70 +20 +40 +ENDCHAR +STARTCHAR Egrave +ENCODING 200 +SWIDTH 1000 0 +DWIDTH 5 0 +BBX 4 11 0 0 +BITMAP +40 +20 +00 +F0 +80 +80 +F0 +80 +80 +80 +F0 +ENDCHAR +STARTCHAR Eacute +ENCODING 201 +SWIDTH 1000 0 +DWIDTH 5 0 +BBX 4 11 0 0 +BITMAP +20 +40 +00 +F0 +80 +80 +F0 +80 +80 +80 +F0 +ENDCHAR +STARTCHAR Ecircumflex +ENCODING 202 +SWIDTH 1000 0 +DWIDTH 5 0 +BBX 4 11 0 0 +BITMAP +20 +50 +00 +F0 +80 +80 +F0 +80 +80 +80 +F0 +ENDCHAR +STARTCHAR Edieresis +ENCODING 203 +SWIDTH 1000 0 +DWIDTH 5 0 +BBX 4 10 0 0 +BITMAP +50 +00 +F0 +80 +80 +F0 +80 +80 +80 +F0 +ENDCHAR +STARTCHAR Igrave +ENCODING 204 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 2 11 0 0 +BITMAP +80 +40 +00 +40 +40 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR Iacute +ENCODING 205 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 2 11 1 0 +BITMAP +40 +80 +00 +80 +80 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR Icircumflex +ENCODING 206 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 11 0 0 +BITMAP +40 +A0 +00 +40 +40 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR Idieresis +ENCODING 207 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 10 0 0 +BITMAP +A0 +00 +40 +40 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR Ntilde +ENCODING 209 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +28 +50 +00 +88 +C8 +C8 +A8 +A8 +98 +98 +88 +ENDCHAR +STARTCHAR Ograve +ENCODING 210 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +40 +20 +00 +70 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Oacute +ENCODING 211 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +10 +20 +00 +70 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Ocircumflex +ENCODING 212 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +20 +50 +00 +70 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Otilde +ENCODING 213 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +28 +50 +00 +70 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Odieresis +ENCODING 214 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +50 +00 +00 +70 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR multiply +ENCODING 215 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 5 0 2 +BITMAP +88 +50 +20 +50 +88 +ENDCHAR +STARTCHAR Ugrave +ENCODING 217 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +40 +20 +00 +88 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Uacute +ENCODING 218 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +10 +20 +00 +88 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Ucircumflex +ENCODING 219 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 11 0 0 +BITMAP +20 +50 +00 +88 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Udieresis +ENCODING 220 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 10 0 0 +BITMAP +50 +00 +88 +88 +88 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR Thorn +ENCODING 222 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +80 +80 +F0 +88 +88 +88 +F0 +80 +80 +ENDCHAR +STARTCHAR germandbls +ENCODING 223 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +70 +88 +88 +B0 +88 +88 +88 +B0 +80 +ENDCHAR +STARTCHAR agrave +ENCODING 224 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +10 +00 +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR aacute +ENCODING 225 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +10 +20 +00 +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR acircumflex +ENCODING 226 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +50 +00 +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR atilde +ENCODING 227 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +28 +50 +00 +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR adieresis +ENCODING 228 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 8 0 0 +BITMAP +50 +00 +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR aring +ENCODING 229 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 10 0 0 +BITMAP +20 +50 +20 +00 +F0 +08 +78 +88 +88 +78 +ENDCHAR +STARTCHAR ccedilla +ENCODING 231 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 7 0 -1 +BITMAP +70 +80 +80 +80 +70 +20 +40 +ENDCHAR +STARTCHAR egrave +ENCODING 232 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +40 +20 +00 +70 +88 +F8 +80 +80 +78 +ENDCHAR +STARTCHAR eacute +ENCODING 233 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +10 +20 +00 +70 +88 +F8 +80 +80 +78 +ENDCHAR +STARTCHAR ecircumflex +ENCODING 234 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +50 +00 +70 +88 +F8 +80 +80 +78 +ENDCHAR +STARTCHAR edieresis +ENCODING 235 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 8 0 0 +BITMAP +50 +00 +70 +88 +F8 +80 +80 +78 +ENDCHAR +STARTCHAR igrave +ENCODING 236 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 2 9 0 0 +BITMAP +80 +40 +00 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR iacute +ENCODING 237 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 2 9 1 0 +BITMAP +40 +80 +00 +80 +80 +80 +80 +80 +80 +ENDCHAR +STARTCHAR icircumflex +ENCODING 238 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 9 0 0 +BITMAP +40 +A0 +00 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR idieresis +ENCODING 239 +SWIDTH 250 0 +DWIDTH 4 0 +BBX 3 8 0 0 +BITMAP +A0 +00 +40 +40 +40 +40 +40 +40 +ENDCHAR +STARTCHAR ntilde +ENCODING 241 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +28 +50 +00 +F0 +88 +88 +88 +88 +88 +ENDCHAR +STARTCHAR ograve +ENCODING 242 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +40 +20 +00 +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR oacute +ENCODING 243 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +10 +20 +00 +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR ocircumflex +ENCODING 244 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +50 +00 +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR otilde +ENCODING 245 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +28 +50 +00 +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR odieresis +ENCODING 246 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 8 0 0 +BITMAP +50 +00 +70 +88 +88 +88 +88 +70 +ENDCHAR +STARTCHAR divide +ENCODING 247 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 5 0 2 +BITMAP +20 +00 +F8 +00 +20 +ENDCHAR +STARTCHAR ugrave +ENCODING 249 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 8 0 0 +BITMAP +40 +20 +88 +88 +88 +88 +88 +78 +ENDCHAR +STARTCHAR uacute +ENCODING 250 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 8 0 0 +BITMAP +10 +20 +88 +88 +88 +88 +88 +78 +ENDCHAR +STARTCHAR ucircumflex +ENCODING 251 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +50 +00 +88 +88 +88 +88 +88 +78 +ENDCHAR +STARTCHAR udieresis +ENCODING 252 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 8 0 0 +BITMAP +50 +00 +88 +88 +88 +88 +88 +78 +ENDCHAR +STARTCHAR yacute +ENCODING 253 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 10 0 -1 +BITMAP +10 +20 +00 +88 +88 +50 +50 +20 +20 +C0 +ENDCHAR +STARTCHAR thorn +ENCODING 254 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 -1 +BITMAP +80 +80 +F0 +88 +88 +88 +F0 +80 +80 +ENDCHAR +STARTCHAR ydieresis +ENCODING 255 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 -1 +BITMAP +50 +00 +88 +88 +50 +50 +20 +20 +C0 +ENDCHAR +STARTCHAR OE +ENCODING 338 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 9 0 0 +BITMAP +6E +90 +90 +90 +9E +90 +90 +90 +6E +ENDCHAR +STARTCHAR oe +ENCODING 339 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 7 6 0 0 +BITMAP +6C +92 +9E +90 +90 +6E +ENDCHAR +STARTCHAR quotedblleft +ENCODING 8220 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 2 0 7 +BITMAP +50 +A0 +ENDCHAR +STARTCHAR quotedblright +ENCODING 8221 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 2 0 7 +BITMAP +50 +A0 +ENDCHAR +STARTCHAR bullet +ENCODING 8226 +SWIDTH 312 0 +DWIDTH 5 0 +BBX 4 4 0 2 +BITMAP +60 +F0 +F0 +60 +ENDCHAR +STARTCHAR ellipsis +ENCODING 8230 +SWIDTH 500 0 +DWIDTH 8 0 +BBX 5 1 0 0 +BITMAP +A8 +ENDCHAR +STARTCHAR Euro +ENCODING 8364 +SWIDTH 437 0 +DWIDTH 7 0 +BBX 6 9 0 0 +BITMAP +18 +24 +40 +F0 +40 +F0 +40 +24 +18 +ENDCHAR +STARTCHAR trademark +ENCODING 8482 +SWIDTH 625 0 +DWIDTH 10 0 +BBX 9 4 0 5 +BITMAP +E880 +4D80 +4A80 +4880 +ENDCHAR +STARTCHAR arrowleft +ENCODING 8592 +SWIDTH 625 0 +DWIDTH 10 0 +BBX 9 5 0 2 +BITMAP +2000 +4000 +FF80 +4000 +2000 +ENDCHAR +STARTCHAR arrowup +ENCODING 8593 +SWIDTH 375 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +70 +A8 +20 +20 +20 +20 +20 +20 +ENDCHAR +STARTCHAR arrowright +ENCODING 8594 +SWIDTH 1000 0 +DWIDTH 10 0 +BBX 9 5 0 2 +BITMAP +0200 +0100 +FF80 +0100 +0200 +ENDCHAR +STARTCHAR arrowdown +ENCODING 8595 +SWIDTH 1000 0 +DWIDTH 6 0 +BBX 5 9 0 0 +BITMAP +20 +20 +20 +20 +20 +20 +A8 +70 +20 +ENDCHAR +ENDFONT diff --git a/source/font/README.txt b/source/font/README.txt new file mode 100644 index 0000000..c417cb8 --- /dev/null +++ b/source/font/README.txt @@ -0,0 +1,40 @@ +In this directory, you will find the source file for the main font used by +CATSFC. It's an Adobe BDF file, which is fed into the emulator when running +in "font dump" mode to produce a more efficient representation in an "ODF" +format. The font is based on the one used by Pictochat, with a few more +characters that Pictochat does not have (but no Japanese characters). + +You can edit the font in an application that reads BDF bitmap fonts, such as +FontForge. Open the font in the application then export it again as BDF. +One case where you would want to do this is to add new glyphs to support a +new language. + +To include the more efficient representation (ODF) in CATSFC/system after +editing the BDF file: + + 1. If your font added characters beyond U+2193 DOWNWARDS ARROW, adjust the + maximum codepoint in source/nds/bdf_font.c, after the first instance of + > #ifndef HAVE_ODF + 2. In source/nds/bdf_font.c, + > #define DUMP_ODF + and + > // #define HAVE_ODF + This will make the plugin read the BDF source and write an ODF file. + 3. make + 4. Copy the new plugin to your card, under /_dstwoplug. + 5. Copy the .bdf file to your card, under /CATSFC/system, as Pictochat-16.bdf. + 6. Run the plugin on the Supercard DSTWO. It will briefly load, then display + "Font library initialisation error -1, press any key to exit". This is + because it tries to load the Chinese font's source, Song.bdf, which you + don't have. Regardless, it does dump an ODF file for Pictochat-16.bdf. + 7. Copy the .odf font somewhere on your hard drive if you want to keep a copy + of it. Delete the .bdf file from your card. + 8. Reverse the changes made in step 2. + 9. make +10. Copy the new plugin to your card, under /_dstwoplug. + +And you can use your new font! + +Finally, you may want to send your .bdf source file to a CATSFC developer +or commit it to a fork on Github, for inclusion in the plugin. You may also +want to send your changes to CATSFC/system/language.msg for the same reason. \ No newline at end of file diff --git a/source/nds/bdf_font.c b/source/nds/bdf_font.c index 5da57e3..b1e7ccd 100644 --- a/source/nds/bdf_font.c +++ b/source/nds/bdf_font.c @@ -27,13 +27,13 @@ #include "gui.h" -#define BDF_VERDANA "SYSTEM/verdana.bdf" +#define BDF_PICTOCHAT "SYSTEM/Pictochat-16.bdf" #define BDF_SONG "SYSTEM/song.bdf" -#define ODF_VERDANA "SYSTEM/verdana.odf" +#define ODF_PICTOCHAT "SYSTEM/Pictochat-16.odf" #define ODF_SONG "SYSTEM/song.odf" -#define HAVE_ODF -//#define DUMP_ODF +#define HAVE_ODF // Define this if you have generated Pictochat-16.odf [Neb] +// #define DUMP_ODF // Define this if you want to regenerate Pictochat-16.odf [Neb] #define BDF_LIB_NUM 2 #define ODF_VERSION "1.0" @@ -49,21 +49,24 @@ static u32 fonts_max_height; static u32 bitmap_code(unsigned char *code, unsigned char *bitmap) { unsigned char *map; - u32 a, b, len; + u8 a, b; + u32 len; len= 0; map= (unsigned char*)bitmap; while(*map) { - //character to number, we assume the character can convert to number! + // One hex character represents the state of 4 successive pixels if(*map != 0x0A) { - if(*map <= 0x39) a= *map - 0x30; - else a= *map - 0x37; + if (*map <= '9') a= *map - '0'; + else if (*map <= 'F') a= *map - 'A' + 10; + else if (*map <= 'f') a= *map - 'a' + 10; map++; - if(*map <= 0x39) b= *map - 0x30; - else b= *map - 0x37; + if (*map <= '9') b= *map - '0'; + else if (*map <= 'F') b= *map - 'A' + 10; + else if (*map <= 'f') b= *map - 'a' + 10; *code++ = (a << 4) | b; len++; @@ -108,7 +111,7 @@ static u32 hatoi(char *string) /* * example * -* STARTCHAR 2264 +* STARTCHAR * ENCODING 8804 * SWIDTH 840 0 * DWIDTH 14 0 @@ -202,8 +205,17 @@ static int parse_bdf(char *filename, u32 start, u32 span, struct bdflibinfo *bdf pt += 6; ret= atoi(pt); - bdflibinfop -> start= start; - bdflibinfop -> span= span; + if (method == 1) + bdflibinfop -> start= start; + switch (method) { + case 0: + default: + bdflibinfop -> span= span + start; + break; + case 1: + bdflibinfop -> span= span; + break; + } //construct bdf font information bdffontp= (struct bdffont*)malloc(span * sizeof(struct bdffont)); @@ -241,14 +253,7 @@ static int parse_bdf(char *filename, u32 start, u32 span, struct bdflibinfo *bdf } if(!(strncasecmp(string, "STARTCHAR ", 10))) { - i= hatoi(pt +10); - if(i < start) continue; - else if(i < end) break; - else //Not found the start - { - ret= -7; - goto parse_bdf_error; - } + break; } } @@ -266,7 +271,7 @@ static int parse_bdf(char *filename, u32 start, u32 span, struct bdflibinfo *bdf pt= string + 9; index= atoi(pt); - if(index >= end) break; + if(index < start || index >= end) break; if(method == 0) i= index; else if(method == 1) i= index-start; @@ -534,15 +539,15 @@ int BDF_font_init(void) fonts_max_height= 0; #ifndef HAVE_ODF - sprintf(tmp_path, "%s/%s", main_path, BDF_VERDANA); - err= parse_bdf(tmp_path, 0, 128, &bdflib_info[0], 0); + sprintf(tmp_path, "%s/%s", main_path, BDF_PICTOCHAT); + err= parse_bdf(tmp_path, 32 /* from SPACE */, 8564 /* to one past the last character, "DOWNWARDS ARROW" */, &bdflib_info[0], 1); if(err < 0) { printf("BDF 0 initial error: %d\n", err); return -1; } #else - sprintf(tmp_path, "%s/%s", main_path, ODF_VERDANA); + sprintf(tmp_path, "%s/%s", main_path, ODF_PICTOCHAT); err= init_from_odf(tmp_path, &bdflib_info[0]); if(err < 0) { @@ -556,7 +561,7 @@ int BDF_font_init(void) fonts_max_height = bdflib_info[0].height; #ifdef DUMP_ODF - sprintf(tmp_path, "%s/%s", main_path, BDF_VERDANA); + sprintf(tmp_path, "%s/%s", main_path, BDF_PICTOCHAT); err= dump2odf(tmp_path, &bdflib_info[0]); if(err < 0) { @@ -613,7 +618,7 @@ void BDF_font_release(void) } } -/*----------------------------------------------------------------------------- +/*---------------------------------------------------------------------------- //16-bit color // Unicode Character // back is background, 0x8000 is transparence, other are visable colors @@ -626,26 +631,25 @@ u32 BDF_render16_ucs(void* screen_address, u32 screen_w, u32 v_align, u32 back, unsigned char cc; struct bdffont *bdffontp; - if(ch < 128) - { - bdffontp= bdflib_info[0].fonts; - fonts_height= bdflib_info[0].height; - } - else if(bdflib_info[1].fonts != NULL) - { - k= bdflib_info[1].start; - m= k + bdflib_info[1].span; - if(ch >= k && ch < m) - { + int font_num; + bool found = 0; + for (font_num = 0; font_num < BDF_LIB_NUM && !found; font_num++) { + if(bdflib_info[font_num].fonts != NULL) + { + k = bdflib_info[font_num].start; + if (ch < k) + continue; + m = k + bdflib_info[font_num].span; + if (ch >= m) + continue; ch -= k; - bdffontp= bdflib_info[1].fonts; - fonts_height= bdflib_info[0].height; - } - else - return 8; - } - else - return 8; + bdffontp= bdflib_info[font_num].fonts; + fonts_height= bdflib_info[font_num].height; + found = 1; + } + } + if (!found) + return 8; // the width of an undefined character, not an error code width= bdffontp[ch].dwidth >> 16; ret= width; @@ -715,6 +719,27 @@ u32 BDF_render16_ucs(void* screen_address, u32 screen_w, u32 v_align, u32 back, return ret; } +/* Returns the width, in pixels, of a character given its UCS-16 codepoint. */ +u32 BDF_width16_ucs(u16 ch) +{ + u32 k, ret; + + int font_num; + for (font_num = 0; font_num < BDF_LIB_NUM; font_num++) { + if(bdflib_info[font_num].fonts != NULL) + { + k = bdflib_info[font_num].start; + if (ch < k) + continue; + if (ch > k + bdflib_info[font_num].span) + continue; + ch -= k; + return bdflib_info[font_num].fonts[ch].dwidth >> 16; + } + } + return 8; // the width of an undefined character, not an error code +} + /*----------------------------------------------------------------------------- //16-bit color // ASCII Character @@ -837,101 +862,101 @@ void BDF_render_string(void* screen_address, u32 x, u32 y, u32 back, u32 front, /*----------------------------------------------------------------------------- ------------------------------------------------------------------------------*/ -char* utf8decode(char *utf8, u16 *ucs) -{ - unsigned char c = *utf8++; - unsigned long code; - int tail = 0; - - if ((c <= 0x7f) || (c >= 0xc2)) { - /* Start of new character. */ - if (c < 0x80) { /* U-00000000 - U-0000007F, 1 byte */ - code = c; - } else if (c < 0xe0) { /* U-00000080 - U-000007FF, 2 bytes */ - tail = 1; - code = c & 0x1f; - } else if (c < 0xf0) { /* U-00000800 - U-0000FFFF, 3 bytes */ - tail = 2; - code = c & 0x0f; - } else if (c < 0xf5) { /* U-00010000 - U-001FFFFF, 4 bytes */ - tail = 3; - code = c & 0x07; - } else { - /* Invalid size. */ - code = 0; - } - - while (tail-- && ((c = *utf8++) != 0)) { - if ((c & 0xc0) == 0x80) { - /* Valid continuation character. */ - code = (code << 6) | (c & 0x3f); - - } else { - /* Invalid continuation char */ - code = 0xfffd; - utf8--; - break; - } - } - } else { - /* Invalid UTF-8 char */ - code = 0; - } - /* currently we don't support chars above U-FFFF */ - *ucs = (code < 0x10000) ? code : 0; - return utf8; -} - -static u8 utf8_ucs2(const char *utf8, u16 *ucs) +char* utf8decode(char *utf8, u16 *ucs) +{ + unsigned char c = *utf8++; + unsigned long code; + int tail = 0; + + if ((c <= 0x7f) || (c >= 0xc2)) { + /* Start of new character. */ + if (c < 0x80) { /* U-00000000 - U-0000007F, 1 byte */ + code = c; + } else if (c < 0xe0) { /* U-00000080 - U-000007FF, 2 bytes */ + tail = 1; + code = c & 0x1f; + } else if (c < 0xf0) { /* U-00000800 - U-0000FFFF, 3 bytes */ + tail = 2; + code = c & 0x0f; + } else if (c < 0xf5) { /* U-00010000 - U-001FFFFF, 4 bytes */ + tail = 3; + code = c & 0x07; + } else { + /* Invalid size. */ + code = 0; + } + + while (tail-- && ((c = *utf8++) != 0)) { + if ((c & 0xc0) == 0x80) { + /* Valid continuation character. */ + code = (code << 6) | (c & 0x3f); + + } else { + /* Invalid continuation char */ + code = 0xfffd; + utf8--; + break; + } + } + } else { + /* Invalid UTF-8 char */ + code = 0; + } + /* currently we don't support chars above U-FFFF */ + *ucs = (code < 0x10000) ? code : 0; + return utf8; +} + +static u8 utf8_ucs2(const char *utf8, u16 *ucs) { char *pt = (char*)utf8; - - while(*pt !='\0') - { - pt = utf8decode(pt, ucs++); - } - *ucs = '\0'; - return 0; -} - -static u32 ucslen(const u16 *ucs) -{ + + while(*pt !='\0') + { + pt = utf8decode(pt, ucs++); + } + *ucs = '\0'; + return 0; +} + +static u32 ucslen(const u16 *ucs) +{ u32 len = 0; - - while(ucs[len] != '\0') - len++; - return len; + + while(ucs[len] != '\0') + len++; + return len; } unsigned char* skip_utf8_unit(unsigned char* utf8, unsigned int num) { while(num--) { - unsigned char c = *utf8++; - int tail = 0; - if ((c <= 0x7f) || (c >= 0xc2)) { - /* Start of new character. */ - if (c < 0x80) { /* U-00000000 - U-0000007F, 1 byte */ - } else if (c < 0xe0) { /* U-00000080 - U-000007FF, 2 bytes */ - tail = 1; - } else if (c < 0xf0) { /* U-00000800 - U-0000FFFF, 3 bytes */ - tail = 2; - } else if (c < 0xf5) { /* U-00010000 - U-001FFFFF, 4 bytes */ - tail = 3; - } else { /* Invalid size. */ - } - - while (tail-- && ((c = *utf8++) != 0)) { - if ((c & 0xc0) != 0x80) { - /* Invalid continuation char */ - utf8--; - break; - } - } + unsigned char c = *utf8++; + int tail = 0; + if ((c <= 0x7f) || (c >= 0xc2)) { + /* Start of new character. */ + if (c < 0x80) { /* U-00000000 - U-0000007F, 1 byte */ + } else if (c < 0xe0) { /* U-00000080 - U-000007FF, 2 bytes */ + tail = 1; + } else if (c < 0xf0) { /* U-00000800 - U-0000FFFF, 3 bytes */ + tail = 2; + } else if (c < 0xf5) { /* U-00010000 - U-001FFFFF, 4 bytes */ + tail = 3; + } else { /* Invalid size. */ + } + + while (tail-- && ((c = *utf8++) != 0)) { + if ((c & 0xc0) != 0x80) { + /* Invalid continuation char */ + utf8--; + break; + } + } } } - /* currently we don't support chars above U-FFFF */ + /* currently we don't support chars above U-FFFF */ return utf8; } @@ -971,10 +996,9 @@ void BDF_render_mix(void* screen_address, u32 screen_w, u32 x, u32 y, u32 v_alig continue; } - if(unicode < 128) - cmp = bdf_fontp[0][unicode].dwidth>>16; - else if(unicode >= start && unicode < end) - cmp = bdf_fontp[1][unicode -start].dwidth>>16; + /* If the text would go beyond the end of the line, go back to the + * start instead. */ + cmp = BDF_width16_ucs(unicode); if((screenp+cmp) >= line_start) { @@ -1074,10 +1098,7 @@ u32 BDF_cut_unicode(u16 *unicodes, u32 len, u32 width, u32 direction) while(len > 0) { unicode= unicodes[i]; - if(unicode < 128) - xw += bdf_fontp[0][unicode].dwidth>>16; - else if(unicode >= start && unicode < end) - xw += bdf_fontp[1][unicode -start].dwidth>>16; + xw += BDF_width16_ucs(unicode); if(xw >= width) break; i += direction; @@ -1096,10 +1117,7 @@ u32 BDF_cut_unicode(u16 *unicodes, u32 len, u32 width, u32 direction) while(len-- > 0) { unicode= unicodes[i]; - if(unicode < 128) - xw += bdf_fontp[0][unicode].dwidth>>16; - else if(unicode >= start && unicode < end) - xw += bdf_fontp[1][unicode -start].dwidth>>16; + xw += BDF_width16_ucs(unicode); i += direction; } diff --git a/source/nds/draw.h b/source/nds/draw.h index 3bdf5be..f40aa23 100644 --- a/source/nds/draw.h +++ b/source/nds/draw.h @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __DRAW_H__ -#define __DRAW_H__ +#ifndef __DRAW_H__ +#define __DRAW_H__ #include "ds2_types.h" #include "ds2io.h" @@ -27,12 +27,12 @@ #define NDS_SCREEN_WIDTH 256 #define NDS_SCREEN_HEIGHT 192 #define NDS_SCREEN_SIZE (NDS_SCREEN_WIDTH*NDS_SCREEN_HEIGHT) - -#define COLOR16(red, green, blue) ((blue << 10) | (green << 5) | red) -#define GET_R16(color) (color & 0x1f) -#define GET_G16(color) ((color >> 5) & 0x1f) -#define GET_B16(color) ((color >> 10)& 0x1f) -#define COLOR32(red, green, blue) (0xff000000 | ((blue & 0xff) << 16) | ((green & 0xff) << 8) | (red & 0xff)) + +#define COLOR16(red, green, blue) ((blue << 10) | (green << 5) | red) +#define GET_R16(color) (color & 0x1f) +#define GET_G16(color) ((color >> 5) & 0x1f) +#define GET_B16(color) ((color >> 10)& 0x1f) +#define COLOR32(red, green, blue) (0xff000000 | ((blue & 0xff) << 16) | ((green & 0xff) << 8) | (red & 0xff)) #define RGB24_15(pixel) ((((*pixel) & 0xF8) << 7) |\ (((*(pixel+1)) & 0xF8) << 2) |\ @@ -44,36 +44,36 @@ #define PRINT_STRING(screen, str, fg_color, x, y) \ - BDF_render_string(screen, x, y, COLOR_TRANS, fg_color, str) \ + BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, COLOR_TRANS, fg_color, str) \ #define PRINT_STRING_SHADOW(screen, str, fg_color, x, y) \ - BDF_render_string(screen, x+1, y+1, 0, 0, str); \ - BDF_render_string(screen, x, y, 0, 0, str) \ + BDF_render_mix(screen, SCREEN_WIDTH, x+1, y+1, 0, 0, 0, str); \ + BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, 0, 0, str) \ #define PRINT_STRING_BG(screen, str, fg_color, bg_color, x, y) \ - BDF_render_string(screen, x, y, bg_color, fg_color, str) \ + BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, bg_color, fg_color, str) \ + +// #define PRINT_STRING_BG_UTF8(screen, utf8, fg_color, bg_color, x, y) \ +// BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, bg_color, fg_color, utf8) \ -#define PRINT_STRING_BG_UTF8(screen, utf8, fg_color, bg_color, x, y) \ - BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, bg_color, fg_color, utf8) \ - //colors -#define COLOR_TRANS COLOR16(31, 31, 63) -#define COLOR_WHITE COLOR16(31, 31, 31) -#define COLOR_BLACK COLOR16( 0, 0, 0) -#define COLOR_TEXT COLOR16(31, 31, 31) -#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0) -#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15) -#define COLOR_ERROR COLOR16(31, 0, 0) -#define COLOR_BG COLOR16(2, 4, 10) -#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8) -#define COLOR_ROM_INFO COLOR16(22, 18, 26) -#define COLOR_ACTIVE_ITEM COLOR16(31, 31, 31) -#define COLOR_INACTIVE_ITEM COLOR16(13, 20, 18) -#define COLOR_HELP_TEXT COLOR16(16, 20, 24) -#define COLOR_DIALOG COLOR16(31, 31, 31) -#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8) -#define COLOR_FRAME COLOR16( 0, 0, 0) +#define COLOR_TRANS COLOR16(31, 31, 63) +#define COLOR_WHITE COLOR16(31, 31, 31) +#define COLOR_BLACK COLOR16( 0, 0, 0) +#define COLOR_TEXT COLOR16(31, 31, 31) +#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0) +#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15) +#define COLOR_ERROR COLOR16(31, 0, 0) +#define COLOR_BG COLOR16(2, 4, 10) +#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8) +#define COLOR_ROM_INFO COLOR16(22, 18, 26) +#define COLOR_ACTIVE_ITEM COLOR16(31, 31, 31) +#define COLOR_INACTIVE_ITEM COLOR16(13, 20, 18) +#define COLOR_HELP_TEXT COLOR16(16, 20, 24) +#define COLOR_DIALOG COLOR16(31, 31, 31) +#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8) +#define COLOR_FRAME COLOR16( 0, 0, 0) #define COLOR_YESNO_TEXT COLOR16( 0, 0, 0) #define COLOR_GREEN COLOR16( 0, 31, 0 ) #define COLOR_GREEN1 COLOR16( 0, 24, 0 ) @@ -81,14 +81,14 @@ #define COLOR_GREEN3 COLOR16( 0, 12, 0 ) #define COLOR_GREEN4 COLOR16( 0, 6, 0 ) #define COLOR_RED COLOR16( 31, 0, 0 ) -#define COLOR_MSSG COLOR16( 16, 8, 29) -/****************************************************************************** - * +#define COLOR_MSSG COLOR16( 16, 8, 29) +/****************************************************************************** + * ******************************************************************************/ #ifdef __cplusplus extern "C" { #endif - + struct background{ char bgname[128]; char bgbuffer[256*192*2]; @@ -151,17 +151,17 @@ extern struct gui_iconlist gui_icon_list[]; #define ICON_CHTFILE gui_icon_list[38] #define ICON_MSG gui_icon_list[39] #define ICON_BUTTON gui_icon_list[40] - -/****************************************************************************** - * - ******************************************************************************/ + +/****************************************************************************** + * + ******************************************************************************/ extern void print_string_center(void* screen_addr, u32 sy, u32 color, u32 bg_color, char *str); -extern void print_string_shadow_center(void* screen_addr, u32 sy, u32 color, char *str); -extern void hline(u32 sx, u32 ex, u32 y, u32 color); -extern void hline_alpha(u32 sx, u32 ex, u32 y, u32 color, u32 alpha); -extern void vline(u32 x, u32 sy, u32 ey, u32 color); -extern void vline_alpha(u32 x, u32 sy, u32 ey, u32 color, u32 alpha); -extern void drawbox(void* screen_address, u32 sx, u32 sy, u32 ex, u32 ey, u32 color); +extern void print_string_shadow_center(void* screen_addr, u32 sy, u32 color, char *str); +extern void hline(u32 sx, u32 ex, u32 y, u32 color); +extern void hline_alpha(u32 sx, u32 ex, u32 y, u32 color, u32 alpha); +extern void vline(u32 x, u32 sy, u32 ey, u32 color); +extern void vline_alpha(u32 x, u32 sy, u32 ey, u32 color, u32 alpha); +extern void drawbox(void* screen_address, u32 sx, u32 sy, u32 ex, u32 ey, u32 color); extern void drawboxfill(void* screen_address, u32 sx, u32 sy, u32 ex, u32 ey, u32 color); extern void draw_selitem(void* screen_address, u32 x, u32 y, u32 color, u32 active); extern void draw_message(void* screen_address, u16 *screen_bg, u32 sx, u32 sy, u32 ex, u32 ey, @@ -173,19 +173,19 @@ extern void draw_string_vcenter(void* screen_address, u32 sx, u32 sy, u32 width, extern u32 draw_hscroll_init(void* screen_address, u32 sx, u32 sy, u32 width, u32 color_bg, u32 color_fg, char *string); extern u32 draw_hscroll(u32 index, s32 scroll_val); -extern void draw_hscroll_over(u32 index); -extern void boxfill_alpha(u32 sx, u32 sy, u32 ex, u32 ey, u32 color, u32 alpha); -extern void init_progress(enum SCREEN_ID screen, u32 total, char *text); -extern void update_progress(void); -extern void show_progress(char *text); -extern void scrollbar(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey, u32 all, u32 view, u32 now); +extern void draw_hscroll_over(u32 index); +extern void boxfill_alpha(u32 sx, u32 sy, u32 ex, u32 ey, u32 color, u32 alpha); +extern void init_progress(enum SCREEN_ID screen, u32 total, char *text); +extern void update_progress(void); +extern void show_progress(char *text); +extern void scrollbar(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey, u32 all, u32 view, u32 now); extern u32 yesno_dialog(char *text); -extern u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no); -extern void msg_screen_init(const char *title); -extern void msg_screen_draw(); -extern void msg_printf(const char *text, ...); -extern void msg_screen_clear(void); -extern void msg_set_text_color(u32 color); +extern u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no); +extern void msg_screen_init(const char *title); +extern void msg_screen_draw(); +extern void msg_printf(const char *text, ...); +extern void msg_screen_clear(void); +extern void msg_set_text_color(u32 color); extern int icon_init(u32 language_id); extern int gui_change_icon(u32 language_id); @@ -203,5 +203,5 @@ extern void blit_to_screen(void* screen_addr, u16 *src, u32 w, u32 h, u32 dest_x } #endif -#endif //__DRAW_H__ - +#endif //__DRAW_H__ + diff --git a/source/nds/gui.c b/source/nds/gui.c index af04c74..b1b9ce5 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -40,10 +40,11 @@ char rom_path[MAX_PATH]; char gamepak_name[MAX_PATH]; char gcheat_filename[MAX_PATH]; -char *lang[2] = +char *lang[3] = { "English", // 0 "简体中文", // 1 + "Français", // 2 }; /****************************************************************************** @@ -1937,7 +1938,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); } int slot_index; @@ -1948,7 +1949,7 @@ u32 menu(u16 *screen) slot_index= get_savestate_slot(); sprintf(line_buffer, "%d", (slot_index+2) > SAVE_STATE_SLOT_NUM ? SAVE_STATE_SLOT_NUM : (slot_index+2)); - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 146, 40 + 0*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 146, 40 + 0*27); if(current_option_num == 1) selected = slot_index+1; @@ -2006,7 +2007,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + line[i]*27); } if(current_option_num == 2) @@ -2578,7 +2579,7 @@ u32 menu(u16 *screen) pt = strrchr(tmp_buf, ')'); strcat(line_buffer, pt); - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 40 + display_option-> line_number*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 40 + display_option-> line_number*27); } void dynamic_cheat_menu_end() @@ -2801,7 +2802,7 @@ u32 menu(u16 *screen) mm = *(display_option->current_option); sprintf(line_buffer, *(display_option->display_string), str[mm]); - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 27, + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 27, 38 + (display_option-> line_number)*32); } @@ -2913,7 +2914,7 @@ u32 menu(u16 *screen) strcpy(line_buffer, *(display_option->display_string)); line_num= display_option-> line_number; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 27, + PRINT_STRING_BG(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 27, 40 + (display_option->line_number)*27); num_byte = freespace; @@ -2945,7 +2946,7 @@ u32 menu(u16 *screen) strcat(line_buffer, ".0 GB"); } - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 147, + PRINT_STRING_BG(down_screen_addr, line_buffer, COLOR_INACTIVE_ITEM, COLOR_TRANS, 147, 40 + (display_option->line_number)*27); } @@ -2965,7 +2966,7 @@ u32 menu(u16 *screen) char *enable_disable_options[] = { (char*)&msg[MSG_EN_DIS_ABLE_0], (char*)&msg[MSG_EN_DIS_ABLE_1] }; - char *language_options[] = { (char*)&lang[0], (char*)&lang[1] }; + char *language_options[] = { (char*) &lang[0], (char*) &lang[1], (char*) &lang[2] }; char *keyremap_options[] = {(char*)&msg[MSG_KEY_MAP_NONE], (char*)&msg[MSG_KEY_MAP_A], (char*)&msg[MSG_KEY_MAP_B], (char*)&msg[MSG_KEY_MAP_SL], (char*)&msg[MSG_KEY_MAP_ST], (char*)&msg[MSG_KEY_MAP_RT], @@ -3124,7 +3125,7 @@ u32 menu(u16 *screen) /* 01 */ NUMERIC_SELECTION_OPTION(NULL, &msg[MSG_SUB_MENU_42], &clock_speed_number, 6, NULL, 1), /* 02 */ STRING_SELECTION_OPTION(language_set, NULL, &msg[MSG_SUB_MENU_41], language_options, - &emu_config.language, 2, NULL, ACTION_TYPE, 2), + &emu_config.language, 3 /* number of possibilities */, NULL, ACTION_TYPE, 2), /* 03 */ STRING_SELECTION_OPTION(NULL, show_card_space, &msg[MSG_SUB_MENU_43], NULL, &desert, 2, NULL, PASSIVE_TYPE | HIDEN_TYPE, 3), @@ -3582,7 +3583,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 37 + line_num*32); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 26, 37 + line_num*32); } void game_fastforward() @@ -3758,7 +3759,7 @@ u32 menu(u16 *screen) else color= COLOR_INACTIVE_ITEM; - PRINT_STRING_BG_UTF8(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + i*27); + PRINT_STRING_BG(down_screen_addr, line_buffer, color, COLOR_TRANS, 23, 40 + i*27); } } } @@ -4204,6 +4205,7 @@ int load_language_msg(char *filename, u32 language) switch(language) { case ENGLISH: + default: strcpy(start, "STARTENGLISH"); strcpy(end, "ENDENGLISH"); cmplen= 12; @@ -4213,10 +4215,10 @@ int load_language_msg(char *filename, u32 language) strcpy(end, "ENDCHINESESIM"); cmplen= 15; break; - default: - strcpy(start, "STARTENGLISH"); - strcpy(end, "ENDENGLISH"); - cmplen= 12; + case FRENCH: + strcpy(start, "STARTFRENCH"); + strcpy(end, "ENDFRENCH"); + cmplen= 11; break; } //find the start flag @@ -4898,7 +4900,9 @@ void gui_init(u32 lang_id) flag = load_font(); if(0 != flag) { - err_msg(DOWN_SCREEN, "initial font library error, press any key to exit\n"); + char message[128]; + sprintf(message, "Font library initialisation error %d, press any key to exit\n", flag); + err_msg(DOWN_SCREEN, message); goto gui_init_err; } diff --git a/source/nds/message.h b/source/nds/message.h index fc6bd33..9292d3f 100644 --- a/source/nds/message.h +++ b/source/nds/message.h @@ -165,7 +165,7 @@ enum MSG enum LANGUAGE{ ENGLISH, CHINESE_SIMPLIFIED, - CHINESE_TRADITIONAL + FRENCH }; char *msg[MSG_END+1]; -- cgit v1.2.3