タグ: markdown

  • pandoc による epub へのフォント埋め込み

    pandoc 用 defaults.yaml (フォントファイルを同階層に置く場合)

    epub-fonts:
          - texgyrepagella-regular.otf
          - texgyrepagella-bold.otf
          - texgyrepagella-italic.otf
          - texgyrepagella-bolditalic.otf

    style.css パスに小文字で ../fonts/フォント名 と書くのがポイント。欧文書体を活かすには font-family の指定で 欧文書体、和文書体の順で指定すること。

    @font-face {
    font-family: "TeX Gyre Pagella";
    font-style: normal;
    font-weight: normal;
    src: url("../fonts/texgyrepagella-regular.otf");
    }
    @font-face {
    font-family: "TeX Gyre Pagella";
    font-style: normal;
    font-weight: bold;
    src: url("../fonts/texgyrepagella-bold.otf");
    }
    @font-face {
    font-family: "TeX Gyre Pagella";
    font-style: italic;
    font-weight: normal;
    src: url("../fonts/texgyrepagella-italic.otf");
    }
    @font-face {
    font-family: "TeX Gyre Pagella";
    font-style: italic;
    font-weight: bold;
    src: url("../fonts/texgyrepagella-bolditalic.otf");
    }
    
    body, p {
        font-family: "TeX Gyre Pagella", "ヒラギノ明朝 ProN", "HiraMinProN-W3", "游明朝体", "Yu Mincho", serif;
    }

    分数は数式なので注意。