• Alex Nguyen

    (@nguyen-hoang-huy)


    My blog is in Vietnamese and the Open Sans font just doesn’t display Vietnamese characters properly. How do I change it back to just Arial font. I’ve been searching on google for many hours but have yet to find a solution.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Browsers nowadays allow custom style sheets (to override the appearance of any website element). I don’t know what your browser is, but search on the internet for “custom style sheet <your browser>” and you’ll find how it’s done. Usually you create a .css file (a text file with a .css extension) and in the preferences of your browser you specify this .css file. (If you have trouble configuring your browser, you can even install a style sheet plug-in, like “Stylish” for Firefox and Chrome.) In your case, the custom style sheet should contain the following text:

    .wp-admin #wpcontent {
        font-family: "Arial" !important;
    }

    Don’t forget to quit and reopen the browser so that the changes take effect.

    Thread Starter Alex Nguyen

    (@nguyen-hoang-huy)

    Can I just change the style directly in the core files? Because my blog has many authors, not just me.

    OK, if you want a server-side solution, you can actually make Open Sans include the vietnamese font subset (by default, it’s not included, to save bandwith I suppose). You edit file:

    /wp-includes/script-loader.php

    And you replace line:

    $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );

    with:

    $subset = 'vietnamese';

    (There is a second and better way to specify the font subset. If you use a .PO translation file, you translate “no-subset” with “vietnamese”. This allows you to avoid editing the core files. But if you’ve never used .PO translation files, it might be hard for you.)

    Thread Starter Alex Nguyen

    (@nguyen-hoang-huy)

    Yes, we do use a .po translation file, can you show me that way too? Thank you very much for such fast respond. I don’t know why this thread doesn’t notify me when someone replies eventhough I ticked the “Notify me of follow-up posts via email.”

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Can I just change the style directly in the core files? Because my blog has many authors, not just me.

    Namibia? That’s a really bad idea. Modifying the core can easily lead to your WordPress installation becoming broken or even compromised. Also you’ll lose your edits when the next release comes out.

    Thread Starter Alex Nguyen

    (@nguyen-hoang-huy)

    Modifying the core can easily lead to your WordPress installation becoming broken or even compromised.

    Depends on what we’re modifying. In this case, I think it won’t do any harm.

    Also you’ll lose your edits when the next release comes out.

    I don’t really care about this, cuz it only takes like 5 seconds to fix stuff like this.

    OK, here is the second and better way of specifying the font subset. The .PO translation file (and its corresponding .MO file) are found in:

    /wp-content/languages/[your-language-code].po
    /wp-content/languages/[your-language-code].mo

    In your case, “vi.po” and “vi.mo” I suppose. Open “vi.po” with a text editor, and add at the end of the file:

    #: wp-includes/script-loader.php:570
    msgctxt "Open Sans font: add new subset (greek, cyrillic, vietnamese)"
    msgid "no-subset"
    msgstr "vietnamese"

    Save the file in the text editor. Next, open the same file with the Poedit program (if you don’t have Poedit, download it from the Internet). Save the file (even though you haven’t made changes), so that Poedit automatically generates a corresponding .MO file. Upload “vi.po” and “vi.mo” to “/wp-content/languages/”.

    Thread Starter Alex Nguyen

    (@nguyen-hoang-huy)

    Do you care to explain a little bit why this is a better way?

    Jan Dembowski already explained the downsides of the first method (the core files method). The second method (the translation method) doesn’t have downsides, because:

    1. You don’t edit core files, just the .PO file.
    2. The .PO file remains valid for future WordPress releases.

    Thread Starter Alex Nguyen

    (@nguyen-hoang-huy)

    I guess, the point is not to touche the core file. Anyway, thank you so much for the answer. I’ve tried both ways and they both works flawlessly, this is exactly what i was looking for.

    Hi everybody !

    I just made the upgrade to WP3.8 and i HATE the fat and evil font used in administration panel.

    Is there a way to change it back to the old and neutral arial, using the .po files as mentioned below? I’m french so perhaps it’s possible?

    Please let me know for the well-being of my eyes 🙂
    Regards!

    I have had the same problem: Russian wouldn’t show up in the administrative pages, because the corresponding parts of the Open Sans font weren’t loaded. The easy solution for me was the plugin “Disable Google Fonts”

    Namibia was getting closer.

    If you’re familiar with translation and have a .po file already you can translate the context “Open Sans font: on or off” to “off” and it will be excluded. This is because in the script-loader.php WordPress is employing _x() like this:
    if ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) { ... }

    Here’s a full rundown:
    http://www.webdevelopmentgroup.com/2014/01/replace-open-sans-in-wordpress-3-8/

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to change the new 3.8 admin dashboard Open Sans font?’ is closed to new replies.