Is it possible to create Font_bold.xnb from a scratch, or just editing the current one to add more characters? Not latin characters... Because the .yaml created by xnbnode in unusable in this font unlike spritefont
Same... To be clear, i can edit the .png, but .yaml doesn't have glyph info to edit or add new ones as the spritefont
Unlike the files under Content\Fonts, that one isn't actually a sprite font. The game has special logic to calculate the position of an given character. In theory you can add support for new characters by extending the bottom (without changing the width), but I haven't tried it. Here's the logic if you want to try adding new characters: Code: let index = ASCII_CODE_OF_CHARACTER - 32 let pixelPosition = ( x: index * 8 % spritesheetWidth, y: index * 8 / spritesheetWidth * 16 + (if is_junimo_text: 224, else: 0) )
Nope, the index is based on the UTF-16 code point. I don't think anyone has tried doing this though, so I don't know how well it will work.
Here's a combined formula for the pixel position of a character in that spritesheet. The spritesheet width is 128px, so I'll put that in now: Code: (x: (charCode - 32) * 8 % 128, y: (charCode - 32) * 8 / 128 * 16 + (if is_junimo_text: 224, else: 0)) Let's say you want to add the A character. The UTF-16 (and ASCII) code for A is 65, so let's plug that into the formula: Code: (x: (charCode - 32) * 8 % 128, y: (charCode - 32) * 8 / 128 * 16 + (if is_junimo_text: 224, else: 0)) = (x: (65 - 32) * 8 % 128, y: (65 - 32) * 8 / 128 * 16 + (if is_junimo_text: 224, else: 0)) = (x: 8, y: 33 + (if is_junimo_text: 224, else: 0)) In other words: if you can read Junimo text, A is at position (8, 33): Otherwise it's at position (x: 8, y: 257):
Still didn't know how to deal with this part of the equation Code: (x: (charCode - 32) * 8 % 128 how to deal with the number 128 ? in the last? no matter what I do I get wrong answer
Code: ((65 - 32) * 8) % 128 = (33 * 8) % 128 = 264 % 128 = 8 You can also enter the whole thing in the Google search box, and it'll give you the answer.
It seems impossible to do, because the image file would be too big and cannot be read by the game.. So I moved to another option, Modding language other than English, luckily the other languages doesn't have "font_bold.xnb" kind of file, it have a native font created by BMfont application that can be recreated easily. The problem is that there is one file that cannot be extracted by xnb_node which is these files Code: Chinese.xnb Japanese.xnb Russian.xnb all of them have the same format and when I try to show its content by GXView, it shows this error Code: Can't find type reader 'BmFont.XmlSourceReader'.
The rest of the files can be unpacked, but these Code: Chinese.xnb Japanese.xnb Russian.xnb Cannot be unpacked