メインコンテンツへスキップ

検索

Custom Font

コメント

3件のコメント

  • Baz コミュニティモデレーター

    The font selection come from the fonts installed on the OS, so to add a new font you can simple download a font, right click the .ttf and install the font. If RMU was already opened when you installed it, you will need to exit and reopen project.

    Also as info (for you or future readers), these are the locations where you will need to change the font. All separately, which is good and bad sometimes:

    0
  • Lee from Raguthra

    Hey @Baz thanks for replying and first of all THANK YOU so much for your tutorial videos - they have been a life saver!!!  I picked up your tile tool this morning and will put it to some good use.

    Yeah as far as the system fonts, this doesn't appear to be the case for me, it didn't pick up any custom fonts from my system.  I wonder if this is because my RMU is installed on a different drive to my Windows folder. 

    Since it is supposed to do this I think that might narrow down my trouble shooting - maybe Unity is looking for new fonts in the wrong place or something like that.

    Again thanks for the reply and all the work you've doe to make the transition over a lot smoother!!!!

    0
  • Baz コミュニティモデレーター

    Hey @Baz thanks for replying and first of all THANK YOU so much for your tutorial videos - they have been a life saver!!!  I picked up your tile tool this morning and will put it to some good use.

    No problem at all, thanks for the kind words!

    I wonder if this is because my RMU is installed on a different drive to my Windows folder. 

    I looked at this script a bit:
    Assets\RPGMaker\Codebase\Editor\Common\FontManager.cs

    The code relies on Unity's Font.GetPathsToOSFonts() method to detect system fonts
    This method typically only checks default Windows font locations:

    • C:\Windows\Fonts
    • C:\Users[Username]\AppData\Local\Microsoft\Windows\Fonts

    There could possibly be a solution if you replace these lines of code:

    With this:

    static FontManager() {
        _fontList = new List<string>();
        _pathList = new List<string>();

        // Default settings and available fonts
        _pathList.Add(DEFAULT_FONT + ".ttf");
        _pathList.AddRange(Font.GetPathsToOSFonts().ToList());
        
        // Add fonts from all drives
        foreach (var drive in Directory.GetLogicalDrives()) {
            var windowsFontPath = Path.Combine(drive, "Windows", "Fonts");
            if (Directory.Exists(windowsFontPath)) {
                _pathList.AddRange(Directory.GetFiles(windowsFontPath, "*.ttf"));
                _pathList.AddRange(Directory.GetFiles(windowsFontPath, "*.otf"));
            }
        }

        // Extract filenames
        foreach(var path in _pathList)
            _fontList.Add(Path.GetFileName(path).Split('.')[0]);
    }

    I have no way to confirm this because I have just one drive, but if you do try it make a back up first. 

    0

サインインしてコメントを残してください。