Skip to content

Instantly share code, notes, and snippets.

@jutememo jutememo/min_font_size.js
Last active Dec 18, 2015

Embed
What would you like to do?
function (ev, arg) {
const MIN_FONT_SIZE = 14, // 最小フォントサイズ
CONFIG_PREFIX = "font.minimum-size.",
COUNTRY_CODES = ["ar", "el", "he", "ja", "ko" , "th", "tr",
"x-armn", "x-baltic", "x-beng", "x-cans", "x-central-euro",
"x-cyrillic", "x-devanagari", "x-ethi", "x-geor", "x-gujr",
"x-guru", "x-khmr", "x-knda", "x-mlym", "x-orya", "x-sinh",
"x-tamil", "x-telu", "x-tibt",
"x-unicode", "x-user-def", "x-western",
"zh-CN", "zh-HK", "zh-TW" ];
var minFontSizeNow = util.getIntPref(CONFIG_PREFIX + "ja"),
setMinFontSize = function(fontSize){
COUNTRY_CODES.forEach(function(countryCode){
util.setIntPref(CONFIG_PREFIX + countryCode, fontSize);
});
};
minFontSizeNow == MIN_FONT_SIZE ?
setMinFontSize(0) :
setMinFontSize(MIN_FONT_SIZE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.