博客

  • JavaScript 浮点数计算问题

    JavaScript 浮点数神坑当属 0.1 + 0.2 == 0.3false

    > 0.1 + 0.2 == 0.3
    false
    > 0.1 + 0.2
    0.30000000000000004
    >
    

    还有一些比较隐蔽的问题,比如 Math.roundNumber.prototype.toFixed 也都不是能完全正常工作的。

    > Math.round(1.105 * 100)
    111
    > Math.round(1.015 * 100)
    101
    > Math.round(1.025 * 100)
    102
    > 0.25.toFixed(1)
    '0.3'
    > 0.35.toFixed(1)
    '0.3'
    

    Math.round、toFixed 计算出错主要因为浮点数不能精确表示。

    在这里 0.35 和 1.015 的值都不准确,一个办法是转换成整数计算再除以对应的十百千;另一个办法是采用现有的 lib,比如 accounting

    > 1.015 * 100
    101.49999999999999
    

    代码运行环境

    D:\node -v
    v8.1.0
    
  • 安装 Nginx、Lua,使用 Lua 扩展 Nginx

    使用 lua-nginx-module 可以让 Nginx 通过一些指令如 content_by_lua、content_by_lua_file 运行 Lua 脚本,非常方便。

    先下载所需文件

    1. 安装 luajit,官网 http://luajit.org/install.html

    解压之后直接 make

    make PREFIX=/usr/local/luajit
    

    2. 下载 ngx_devel_kit(github)、nginx_lua_module(github

    3. 进入 nginx 源码目录准备 configure

    如果已经安装 nginx,也可以再次 configure,但一定要涵盖上次使用的参数。

    4. 导出 LUAJIT_LIB、LUAJIT_INC 环境变量

    export LUAJIT_LIB=/usr/local/luajit/lib
    export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
    
    LUAJIT_LIB 对应 libluajit-5.1.so 文件所在目录
    LUAJIT_INC 对应 lua.h 文件所在目录
    

    目录可能不一样,但参考 LUAJIT_LIB、LUAJIT_INC 含义。

    5. 在 nginx-1.10.2 目录执行 ./configure

    ./configure \
    --prefix=/usr/local/nginx \
    --with-http_flv_module \
    --with-http_gzip_static_module \
    --with-http_realip_module \
    --with-http_ssl_module \
    --with-http_stub_status_module \
    --with-http_v2_module \
    --with-ipv6 \
    --with-ld-opt="-ljemalloc,-Wl,-rpath,/usr/local/luajit/lib" \
    --with-openssl=/opt/src/openssl-1.0.2l \
    --with-pcre=/opt/src/pcre-8.40 \
    --with-pcre-jit \
    --add-module=/opt/src/ngx_devel_kit-0.3.0 \
    --add-module=/opt/src/lua-nginx-module-0.10.8
    

    这里用到了 ljemalloc、openssl、pcre 可以预先安装

    安装 jemalloc,进入 jemalloc-4.2.1
    
    ./configure
    make
    make install
    
    安装 openssl pcre,或者进入源码目录安装
    
    yum install openssl openssl-devel
    yum install pcre pcre-devel
    

    6. 测试执行 lua

    在 Nginx 某个 server 下增加

    location /hello { 
        content_by_lua 'ngx.say("Hello, Lua")'; 
    }
    

    尝试访问

    [root@CentOS-58 06]# curl lua.zhengxianjun.com/hello
    Hello, Lua!
    

    安装成功并且正常运行。

    如果对 nginx 安装目录进行版本管理,会发现 make install 完成之后只有 nginx/sbin/nginx 文件有改动。

    安装完成之后切记要执行 sbin/ngxin -t 检查语法是否正确。
    一定要安装正确才能执行 sbin/ngxin -s reload 。

    因为对于已经安装的 nginx,如果 ./configure 没有覆盖上一次的参数,会导致某些功能失效。
    第一次 configure 时没有添加 –with-http_ssl_module 导致 nginx 提示 unknown directive “ssl”。

  • JavaScript const、let、var 对比

    ECMAScript 6 新增 const 和 let 命令,用来声明变量。

    声明方式 变量提升 作用域 初始值 重复定义
    const 块级 需要 不允许
    let 块级 不需要 不允许
    var 函数级 不需要 允许

    变量提升:const 和 let 必须先声明再使用,不支持变量提升

    console.log(c1, l1, v1);
    // 报错
    // Uncaught ReferenceError: c1 is not defined
    
    const c1 = 'c1';
    let l1 = 'l1';
    var v1 = 'v1';
    

    作用域:const,let 支持块级作用域,有效避免变量覆盖

    const c21 = 'c21';
    let l21 = 'l21';
    var v21 = 'v21';
    
    if (0.1 + 0.2 != 0.3) {
        const c21 = 'c22';
        let l21 = 'l22';
        var v21 = 'v22';
    
        console.log(c21, l21, v21);
        // 输出 c22 l22 v22
    }
    
    console.log(c21, l21, v21);
    // 输出 c21 l21 v22
    

    块级作用域,在外层不能直接访问内层变量

    if (0.1 + 0.2 != 0.3) {
        const c22 = 'c22';
        let l22 = 'l22';
        var v22 = 'v22';
    
        console.log(c22, l22, v22);
        // 输出 c22 l22 v22
    }
    
    console.log(c22, l22, v22);
    // 报错
    // Uncaught ReferenceError: c22 is not defined
    // 同样地, l22 is not defined
    

    const 定义常量,该常量不能赋值,但该常量的属性可以赋值

    const c231 = {};
    const c232 = [];
    
    c231.name = 'seven';
    c232.push(27);
    
    console.log(c231, c232);
    // 输出 {name: "seven"} [27]
    
    // 禁止给对象赋值,应该使用 Object.freeze
    
    const c233 = Object.freeze({});
    const c234 = Object.freeze([]);
    
    c233.name = 'seven';
    // 普通模式下不报错
    // 严格模式下报错
    // Uncaught TypeError: Cannot add property name, object is not extensible
        
    c234.push(27);
    // 普通模式下就会报错
    // Uncaught TypeError: Cannot add property 0, object is not extensible
    
    console.log(c233, c234);
    // 输出 {} []
    

    全局变量不再设置为顶层对象(window)的属性,有效避免全局变量污染

    const c24 = 'c24';
    let l24 = 'l24';
    
    console.log(c24, l24);
    // 输出 c24 l24
    
    console.log(window.c24, window.l24);
    // 输出 undefined undefined
    

    符合预期的 for 循环

    for (var i = 0; i != 3; i++) {
        setTimeout(function() {
            console.log(i);
        },10);
    }
    // 依次打印
    3
    3
    3
    
    for (let i = 0; i != 3; i++) {
        setTimeout(function() {
            console.log(i);
        },10);
    }
    // 依次打印,为啥呢
    0
    1
    2
    

    可以看到在 for 循环中使用 let 方式声明变量才是符合预期。
    在 for 中每一次循环,let 都是重新声明变量,并且因为 JavaScript 引擎会记住上一次循环的值,初始化 i 时在上一轮的基础上计算。

    可以看到在 for 循环中至少有两层作用域,看下面的例子更容易理解。

    for (let i = 0; i != 3; i++) {
        let i = 'seven';
        console.log(i);
    }
    console.log('eight');
    // 依次打印
    seven
    seven
    seven
    eight
    

    初始值:const 声明的变量必须设置初始值,且不能重复赋值。

    const c3 = 'c3';
    let l3 = 'l3';
    var v3 = 'v3';
    
    console.log(c3, l3, v3);
    // 输出 c3 l3 v3
    
    c3 = 2; // Uncaught TypeError: Assignment to constant variable
    l3 = 2;
    v3 = 2;
    
    console.log(c3, l3, v3);
    // 输出 c3 2 2
    
    const c32;
    // 报错
    // Uncaught SyntaxError: Missing initializer in const declaration
    

    重复定义:const 和 let 不支持重复定义

    const、let 缩小了变量作用域,完美避免变量污染;const 固定变量(即固定变量类型),对于弱类型 JavaScript 来说,可以明显提升性能。推荐在应用中使用 const、let 声明变量。

  • babel-loader 生成多处 /******/ 前缀

    使用 babel-loader 处理 .js 文件之后会在公共文件里多处行首添加 /******/,不明白为什么要这样做。

    难道仅仅是为了区别框架代码和用户代码?

    /******/ (function(modules) { // webpackBootstrap
    /******/    // install a JSONP callback for chunk loading
    /******/    var parentJsonpFunction = window["webpackJsonp"];
    /******/    window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
    /******/        // add "moreModules" to the modules object,
    /******/        // then flag all "chunkIds" as loaded and fire callback
    /******/        var moduleId, chunkId, i = 0, callbacks = [];
    /******/        for(;i < chunkIds.length; i++) {
    /******/            chunkId = chunkIds[i];
    /******/            if(installedChunks[chunkId])
    /******/                callbacks.push.apply(callbacks, installedChunks[chunkId]);
    /******/            installedChunks[chunkId] = 0;
    /******/        }
    /******/        for(moduleId in moreModules) {
    /******/            modules[moduleId] = moreModules[moduleId];
    /******/        }
    /******/        if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);
    /******/        while(callbacks.length)
    /******/            callbacks.shift().call(null, __webpack_require__);
    /******/        if(moreModules[0]) {
    /******/            installedModules[0] = 0;
    /******/            return __webpack_require__(0);
    /******/        }
    /******/    };
    

    目前应该没有参数可以控制移除,因为在文件 ./node_modules/webpack/lib/MainTemplate.js 中硬编码了这一段前缀

    this.plugin("render", function(bootstrapSource, chunk, hash, moduleTemplate, dependencyTemplates) {
        var source = new ConcatSource();
        source.add("/******/ (function(modules) { // webpackBootstrap\n");
        source.add(new PrefixSource("/******/", bootstrapSource));
        source.add("/******/ })\n");
        source.add("/************************************************************************/\n");
        source.add("/******/ (");
        var modules = this.renderChunkModules(chunk, moduleTemplate, dependencyTemplates, "/******/ ");
        source.add(this.applyPluginsWaterfall("modules", modules, chunk, hash, moduleTemplate, dependencyTemplates));
        source.add(")");
        return source;
    });
    

    babel-loader 配置参考: API · Babel

  • PHP Bcrypt 更安全的密码加密机制

    为了避免在服务器受到攻击,数据库被拖库时,用户的明文密码不被泄露,一般会对密码进行单向不可逆加密——哈希

    常见的方式是:

    哈希方式 加密密码
    md5(‘123456’) e10adc3949ba59abbe56e057f20f883e
    md5(‘123456’ . ($salt = ‘salt’)) 207acd61a3c1bd506d7e9a4535359f8a
    sha1(‘123456’) 40位密文
    hash(‘sha256’, ‘123456’) 64位密文
    hash(‘sha512’, ‘123456’) 128位密文

    密文越长,在相同机器上,进行撞库消耗的时间越长,相对越安全。

    比较常见的哈希方式是 md5 + 盐,避免用户设置简单密码,被轻松破解。

    password_hash

    但是,现在要推荐的是 password_hash() 函数,可以轻松对密码实现加盐加密,而且几乎不能破解。

    $password = '123456';
    
    var_dump(password_hash($password, PASSWORD_DEFAULT));
    var_dump(password_hash($password, PASSWORD_DEFAULT));
    

    password_hash 生成的哈希长度是 PASSWORD_BCRYPT —— 60位,PASSWORD_DEFAULT —— 60位 ~ 255位。PASSWORD_DEFAULT 取值跟 php 版本有关系,会等于其他值,但不影响使用。

    每一次 password_hash 运行结果都不一样,因此需要使用 password_verify 函数进行验证。

    $password = '123456';
    
    $hash = password_hash($password, PASSWORD_DEFAULT);
    var_dump(password_verify($password, $hash));
    

    password_hash 会把计算 hash 的所有参数都存储在 hash 结果中,可以使用 password_get_info 获取相关信息。

    $password = '123456';
    $hash = password_hash($password, PASSWORD_DEFAULT);
    var_dump(password_get_info($hash));
    
    输出
    array(3) {
      ["algo"]=>
      int(1)
      ["algoName"]=>
      string(6) "bcrypt"
      ["options"]=>
      array(1) {
        ["cost"]=>
        int(10)
      }
    }
    注意不包含 salt
    

    可以看出我当前版本的 PHP 使用 PASSWORD_DEFAULT 实际是使用 PASSWORD_BCRYPT。

    password_hash($password, $algo, $options) 的第三个参数 $options 支持设置至少 22 位的 salt。但仍然强烈推荐使用 PHP 默认生成的 salt,不要主动设置 salt。

    当要更新加密算法和加密选项时,可以通过 password_needs_rehash 判断是否需要重新加密,下面的代码是一段官方示例

    $options = array('cost' => 11);
    // Verify stored hash against plain-text password
    if (password_verify($password, $hash))
    {
        // Check if a newer hashing algorithm is available
        // or the cost has changed
        if (password_needs_rehash($hash, PASSWORD_DEFAULT, $options))
        {
            // If so, create a new hash, and replace the old one
            $newHash = password_hash($password, PASSWORD_DEFAULT, $options);
        }
        // Log user in
    }
    

    password_needs_rehash 可以理解为比较 $algo + $option 和 password_get_info($hash) 返回值。

    password_hash 运算慢

    password_hash 是出了名的运行慢,也就意味着在相同时间内,密码重试次数少,泄露风险降低。

    $password = '123456';
    var_dump(microtime(true));
    var_dump(password_hash($password, PASSWORD_DEFAULT));
    var_dump(microtime(true));
    
    echo "\n";
    
    var_dump(microtime(true));
    var_dump(md5($password));
    for ($i = 0; $i < 999; $i++)
    {
        md5($password);
    }
    var_dump(microtime(true));
    
    输出
    float(1495594920.7034)
    string(60) "$2y$10$9ZLvgzqmiZPEkYiIUchT6eUJqebekOAjFQO8/jW/Q6DMrmWNn0PDm"
    float(1495594920.7818)
    
    float(1495594920.7818)
    string(32) "e10adc3949ba59abbe56e057f20f883e"
    float(1495594920.7823)
    

    password_hash 运行一次耗时 784 毫秒, md5 运行 1000 次耗时 5 毫秒。这是一个非常粗略的比较,跟运行机器有关,但也可以看出 password_hash 运行确实非常慢。

  • 使用 JavaScript 对中文进行排序

    在网页上展示列表时经常需要对列表进行排序:按照修改/访问时间排序、按照地区、按照名称排序。

    对于中文列表按照名称排序就是按照拼音排序,不能简单通过字符串比较—— ‘a’ > ‘b’——这种方式来实现。

    比如比较 ‘北京’ vs ‘上海’,实际是比较 ‘běijīng’ vs ‘shànghǎi’;比较 ‘北京’ vs ‘背景’,实际是比较 ‘běijīng’ vs ‘bèijǐng’。
    一般需要获取到字符串的拼音,再比较各自的拼音。

    JavaScript 提供本地化文字排序,比如对中文按照拼音排序,不需要程序显示比较字符串拼音。

    String.prototype.localeCompare 在不考虑多音字的前提下,基本可以完美实现按照拼音排序。

    在没有出现意外的情况下,各个支持 localeCompare 的浏览器都很正常。最近将 Chrome 更新到 58.0.3029.110,突然发现中文排序不正常。

    // 正常应该返回 1, 拼音 jia 在前, kai 在后
    '开'.localeCompare('驾');
    // 得到
    -1;
    
    // Chrome 58.0.3029.110 下返回 -1, 其他浏览器正常
    
    // 确认之后是 localeCompare 需要明确指定 locales 参数
    '开'.localeCompare('驾', 'zh');
    // 得到
    1
    

    在 Chrome 下传递 locales 参数才能获得正常预期结果

    Edge 浏览器支持 localeCompare

    Firefox 浏览器支持 localeCompare

    IE 11 浏览器支持 localeCompare

    其他浏览器对 localeCompare 支持也很友好,目前也不需要明确传递 locales,浏览器支持参考 developer.mozilla.org

  • 使用CSS变量提高代码复用率

    CSS 支持通过 ––variable-name: variable-value 声明变量,并通过 var(––variable-name) 使用变量。

    CSS 使用变量示例

    .parent {
        --color-red: red;
    }
    
    .child {
        color: var(--color-red);
    }
    

    Less 和 Sass 已分别使用 $ 和 @ 声明变量,CSS 则采用双划线声明变量。

    Less / Sass 变量示例

    /* Less 变量示例 */
    
    @blue: #f938ab;
    
    .blue {
        color: @blue;
    }
    
    /* Sass 变量示例 */
    
    $blue: #1875e7;
    
    .blue {
        color: $blue;
    }
    

    不同于 Less/Sass 在最外层声明, CSS Variable 需要在具体 selector 下声明变量,因此可以在子元素下覆盖父元素定义的变量

    一般将 CSS Variable 定义在伪类 :root 下,让所有子元素都可以继承。

    定义在伪类 :root 下

    :root {
      --base-color: #333;
      --base-size: 14px;
    }
    
    .btn {
        color: var(--base-color);
        font-size: var(--base-size);
    }
    

    变量继承与重写

    div {
        padding: 2px;
    }
    
    .one {
        --border: 1px solid red;
        border: var(--border);
    }
    
    .two {
        border: var(--border);
        --border: 2px solid green;
    }
    
    .three {
        border: var(--border);
    }
    
    <div class="one">
        1
        <div class="two">
            2-1
            <div class="three">3</div>
        </div>
        <div class="two">2-2</div>
    </div>
    

    解析到 .two selector 会优先解析 .two 拥有的变量,再应用。因此 .two 应用的 --border2px solid green
    .three 也会应用 .two 定义的变量。

    动态修改 CSS Variable

    网页渲染完成之后,再修改变量值,会重新应用 CSS。

    因为 val(variable-name) 返回的是 variable-value,所以当 variable-value 不包含单位是,某些样式需要明确指定单位。

    :root {
        --line-height: 20;
    }
    
    p {
        line-height: var(--line-height)px;
    }
    

    这点不像 jQuery 自动检测浏览器设置的默认单位。需要显示设置单位

  • JavaScript Proxy 代理

    Proxy 对象可以捕获源对象(对象、数组、函数)的操作,包括增删改查(获取、赋值、枚举、删除)以及函数调用,可以更加全面地控制源对象。

    代理对象

    // 源对象 必须是复杂数据类型,如 对象、数组、函数
    var target = {age: 27};
    
    var handler = {
        get: function(target, key) {
            // 代理 target[key]
            console.log('get');
            if (key in target) {
                return target[key];
            }
        },
        set: function(target, key, value) {
            // 代理 target[key] = value
            console.log('set');
            target[key] = value;
        },
        deleteProperty: function(target, key) {
            // 代理 delete target[key]
            console.log('deleteProperty');
            return key in target ? delete target[key] : false;
        },
        enumerate: function(target, key) {
            console.log('enumerate');
            return Object.keys(target);
        },
        ownKeys: function(target, key) {
            // 代理 Object.getOwnPropertyNames(target)
            // 代理 Object.getOwnPropertySymbols(target)
            console.log('ownKeys');
            return Object.keys(target);
        },
        has: function(target, key) {
            // 代理 key in target
            console.log('has');
            return key in target;
        },
        defineProperty: function(target, key, desc) {
            // 代理 Object.defineProperty(proxy, key, desc)
            console.log('defineProperty');
            Object.defineProperty(target, key, desc);
            return target;
        },
        getOwnPropertyDescriptor: function(target, key) {
            console.log('getOwnPropertyDescriptor');
            return key in target ? {
                value: target[key],
                writable: true,
                enumerable: false,
                configurable: true
            } : undefined;    
        }
    };
    
    // 新建代理
    var proxy = new Proxy(target, handler);
    
    proxy.age;
    
    proxy.age = 28;
    
    Object.defineProperty(proxy, 'name', {value: 'seven'});
    
    proxy.name;
    target.name;
    

    Object.keys(proxy),会分别调用 handler.ownKeys 和 getOwnPropertyDescriptor,前者用于获取 target 的 key 列表,后者用于依次判断每个 key 是否可以迭代。
    若 getOwnPropertyDescriptor 返回值得 enumerate 为 false,则该 key 不会出现在 Object.keys(proxy) 返回结果中。

    Object.getOwnPropertyDescriptors(proxy) 和 Object.keys(proxy) 一样,会分别调用 handler.ownKeys 和 getOwnPropertyDescriptor,但不会根据 getOwnPropertyDescriptor 返回结果过滤 key。


    代理数组

    var target = [1, 2, 3];
    
    var handler = {
        set: function(target, key, value) {
            // 代理 target[key] = value
            console.log('set');
            target[key] = value;
            // 代理数组 set,需要 返回源对象
            // 代理对象不需要
            return target;
        }
    };
    
    var proxy = new Proxy(target, handler);
    
    proxy.push(4);
    proxy.pop();
    proxy.unshift(5);
    proxy.shift();
    

    代理数组 handler.set 需要返回源对象,其余与代理对象一致。


    代理函数

    var target = function (name) {
        this.name = name;
    
        this.sayHello = function() {
            return 'Hi, I am ' + this.name;
        };
    
        return 'Hi, I am ' + name;
    };
    
    var handler = {
        construct: function(target, args) {
            console.log('construct');
            var inst = Object.create(target.prototype);
            target.apply(inst, args);
            return inst;
        },
        apply: function(target, args)  {
            console.log('apply');
            return target.apply(target, args);
        }
    };
    
    var proxy = new Proxy(target, handler);
    
    proxy();
    
    var inst = new proxy('seven');
    inst.sayHello();
    

    代理函数可以设置 handler.construct 和 handler.apply,其余与代理对象一致。


    创建可以撤销的代理

    var target = {age: 27};
    
    var handler = {
        get: function(target, key) {
            // 代理 target[key]
            console.log('get');
            if (key in target) {
                return target[key];
            }
        }
    };
    
    var revocable = Proxy.revocable(target, handler);
    var proxy = revocable.proxy;
    
    proxy.age;
    
    // 执行撤销
    revocable.revoke();
    
    // 撤销之后再执行任何代理操作都会报错
    
    // TypeError
    proxy.age;
    
  • 推荐HTTP站点使用CSP禁止网页被注入的未知JS脚本执行

    无意间发现站点 ua.zhengxianjun.com 的 Network 中出现两条未知的 js 请求。

    未知的 js 请求

    这两个域名跟 ua.zhengxianjun.com 没有任何关系,查看源码发现网页被注入了一个 script 标签。

    注入的 script 标签,来自 i.fcy6.cc

    刚开始以为网站被黑了,可是黑我的小网站没意思呀。

    在服务器上访问 ua.zhengxianjun.com 发现一切正常,感觉可能是被运营商注入了广告。

    通过 curl 访问,显示正常

    在 Network 中看到第二条脚本没有加载成功,可能是这个原因网页没有出现异常。试了多次也没出现广告。

    网页被插入一个 script 标签,第1个创建了第2个

    查了一下域名 fcy6.cc,但对方开启了隐私保护。

    从另外一个域名 sho9wbox.com 的 whois 信息可以看到,它属于 veryci.com,跟电驴(verycd.com)非常接近。

    veryci.com 官网大部分是图片,而且用词不清。最主要是启信宝上的公司地址跟官网的地址不一样。(如下图)

    当然这些都不是重点。

    重点是:推荐 HTTP 站点启用 CSP,尽量保证即使网页被注入脚本,也不会出现危害。

    如何使用 CSP,参考 https://blog.zhengxianjun.com/2015/04/web-security-csp/

  • 选择合适的字体区分 1Il、0Oo

    为了能够清晰区分 1Il 0Oo、准确识别相似字符,测试了 70+ 种 Windows 系统下使用的字体,得到 3 种能清晰区分 1Il 0Oo 的字体,效果如下:

    # 字体 1, i, l, 零和欧, 全角
    1 Consolas 1iIl 0Oo0Oo ø
    2 Tahoma 1iIl 0Oo0Oo ø
    3 Verdana 1iIl 0Oo0Oo ø

     

    在这 3 种字体中,Verdana 和 Tahoma 效果最好,Consolas 次之,在 Excel 中也常用到 Tahoma。

    最终采取的方案是:

    .input {
        font-family: Verdana, Tahoma, Consolas, monospace;
    }
    

    全部对比效果如下:

    # 字体 1, i, l, 零和欧, 全角
    1 Consolas 1iIl 0Oo0Oo ø
    2 Tahoma 1iIl 0Oo0Oo ø
    3 Verdana 1iIl 0Oo0Oo ø
    4 ‘Angsana New’ 1iIl 0Oo0Oo ø
    5 Arial 1iIl 0Oo0Oo ø
    6 ‘Arial Black’ 1iIl 0Oo0Oo ø
    7 Basemic 1iIl 0Oo0Oo ø
    8 Batang 1iIl 0Oo0Oo ø
    9 ‘Book Antiqua’ 1iIl 0Oo0Oo ø
    10 ‘Browallia New’ 1iIl 0Oo0Oo ø
    11 Calibri 1iIl 0Oo0Oo ø
    12 Cambria 1iIl 0Oo0Oo ø
    13 Candara 1iIl 0Oo0Oo ø
    14 Century 1iIl 0Oo0Oo ø
    15 ‘Comic Sans MS’ 1iIl 0Oo0Oo ø
    16 Constantia 1iIl 0Oo0Oo ø
    17 Corbel 1iIl 0Oo0Oo ø
    18 ‘Cordia New’ 1iIl 0Oo0Oo ø
    19 Courier 1iIl 0Oo0Oo ø
    20 ‘Courier New’ 1iIl 0Oo0Oo ø
    21 DilleniaUPC 1iIl 0Oo0Oo ø
    22 Dotum 1iIl 0Oo0Oo ø
    23 Garamond 1iIl 0Oo0Oo ø
    24 Geneva 1iIl 0Oo0Oo ø
    25 Georgia 1iIl 0Oo0Oo ø
    26 Gulim 1iIl 0Oo0Oo ø
    27 GungSuh 1iIl 0Oo0Oo ø
    28 Impact 1iIl 0Oo0Oo ø
    29 JasmineUPC 1iIl 0Oo0Oo ø
    30 ‘Lucida Console’ 1iIl 0Oo0Oo ø
    31 ‘Lucida Sans Unicode’ 1iIl 0Oo0Oo ø
    32 ‘Malgun Gothic’ 1iIl 0Oo0Oo ø
    33 Mangal 1iIl 0Oo0Oo ø
    34 Marlett 1iIl 0Oo0Oo ø
    35 Meiryo 1iIl 0Oo0Oo ø
    36 ‘Microsoft JhengHei’ 1iIl 0Oo0Oo ø
    37 MingLiu 1iIl 0Oo0Oo ø
    38 MingLiU_HKSCS 1iIl 0Oo0Oo ø
    39 monospace 1iIl 0Oo0Oo ø
    40 Modern 1iIl 0Oo0Oo ø
    41 ‘MS Gothic’ 1iIl 0Oo0Oo ø
    42 ‘MS Mincho’ 1iIl 0Oo0Oo ø
    43 ‘MS PGothic’ 1iIl 0Oo0Oo ø
    44 ‘MS PMincho’ 1iIl 0Oo0Oo ø
    45 ‘MS Sans Serif’ 1iIl 0Oo0Oo ø
    46 ‘MS Serif’ 1iIl 0Oo0Oo ø
    47 ‘Palatino Linotype’ 1iIl 0Oo0Oo ø
    48 PMingliU 1iIl 0Oo0Oo ø
    49 PMingLiU-ExtB 1iIl 0Oo0Oo ø
    50 serif 1iIl 0Oo0Oo ø
    51 Symbol 1iIl 0Oo0Oo ø
    52 Times 1iIl 0Oo0Oo ø
    53 ‘Times New Roman’ 1iIl 0Oo0Oo ø
    54 ‘Trebuchet MS’ 1iIl 0Oo0Oo ø
    55 Wingdings 1iIl 0Oo0Oo ø
    56 ‘Yu Gothic’ 1iIl 0Oo0Oo ø
    57 ‘Yu Mincho’ 1iIl 0Oo0Oo ø
    58 方正舒体 1iIl 0Oo0Oo ø
    59 方正姚体 1iIl 0Oo0Oo ø
    60 仿宋 1iIl 0Oo0Oo ø
    61 黑体 1iIl 0Oo0Oo ø
    62 华文彩云 1iIl 0Oo0Oo ø
    63 华文仿宋 1iIl 0Oo0Oo ø
    64 华文行楷 1iIl 0Oo0Oo ø
    65 华文琥珀 1iIl 0Oo0Oo ø
    66 华文楷体 1iIl 0Oo0Oo ø
    67 华文隶书 1iIl 0Oo0Oo ø
    68 华文宋体 1iIl 0Oo0Oo ø
    69 华文细黑 1iIl 0Oo0Oo ø
    70 华文新魏 1iIl 0Oo0Oo ø
    71 华文中宋 1iIl 0Oo0Oo ø
    72 楷体 1iIl 0Oo0Oo ø
    73 隶书 1iIl 0Oo0Oo ø
    74 宋体 1iIl 0Oo0Oo ø
    75 宋体-ExtB 1iIl 0Oo0Oo ø
    76 微软雅黑 1iIl 0Oo0Oo ø
    77 新宋体 1iIl 0Oo0Oo ø
    78 幼圆 1iIl 0Oo0Oo ø