Notion-MW
タグ: 差し戻し済み
Notion-MW
 
(同じ利用者による、間の2版が非表示)
32行目: 32行目:
いよいよ名前の変更を行う。ttfやotfのデータはいくつかの「テーブル」に分かれているが、今回使用するのはそのうちの「name」というテーブルである。ttxでこれを取り出すには
いよいよ名前の変更を行う。ttfやotfのデータはいくつかの「テーブル」に分かれているが、今回使用するのはそのうちの「name」というテーブルである。ttxでこれを取り出すには


<pre class="visual">ttx -t name fontfile.ttf</pre>
<syntaxhighlight lang="vb.net">ttx -t name fontfile.ttf</syntaxhighlight>
とする。tはtableの頭文字である。これで、fontfile.ttxというXMLが出力される。
とする。tはtableの頭文字である。これで、fontfile.ttxというXMLが出力される。


43行目: 43行目:
(このデータは[http://fonts.jp/hanazono/ 花園フォント]と同じく[https://glyphwiki.org/wiki/GlyphWiki:%e3%83%a1%e3%82%a4%e3%83%b3%e3%83%9a%e3%83%bc%e3%82%b8 GlyphWiki]のデータをもとにしたフォントとして筆者が最近公開した[https://github.com/ge9/NazonoMincho https://github.com/ge9/NazonoMincho]のものである)
(このデータは[http://fonts.jp/hanazono/ 花園フォント]と同じく[https://glyphwiki.org/wiki/GlyphWiki:%e3%83%a1%e3%82%a4%e3%83%b3%e3%83%9a%e3%83%bc%e3%82%b8 GlyphWiki]のデータをもとにしたフォントとして筆者が最近公開した[https://github.com/ge9/NazonoMincho https://github.com/ge9/NazonoMincho]のものである)


<pre class="visual">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8"?>
&lt;ttFont sfntVersion=&quot;OTTO&quot; ttLibVersion=&quot;4.38&quot;&gt;
<ttFont sfntVersion="OTTO" ttLibVersion="4.38">


   &lt;name&gt;
   <name>
     &lt;namerecord nameID=&quot;1&quot; platformID=&quot;1&quot; platEncID=&quot;0&quot; langID=&quot;0x0&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
       NazonoMincho Regular
       NazonoMincho Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;2&quot; platformID=&quot;1&quot; platEncID=&quot;0&quot; langID=&quot;0x0&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
       Regular
       Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;3&quot; platformID=&quot;1&quot; platEncID=&quot;0&quot; langID=&quot;0x0&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="3" platformID="1" platEncID="0" langID="0x0" unicode="True">
       0.001;YHVH;NazoMin
       0.001;YHVH;NazoMin
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;5&quot; platformID=&quot;1&quot; platEncID=&quot;0&quot; langID=&quot;0x0&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="5" platformID="1" platEncID="0" langID="0x0" unicode="True">
       Version 0.001;hotconv 1.1.0;makeotfexe 2.6.0
       Version 0.001;hotconv 1.1.0;makeotfexe 2.6.0
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;6&quot; platformID=&quot;1&quot; platEncID=&quot;0&quot; langID=&quot;0x0&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="6" platformID="1" platEncID="0" langID="0x0" unicode="True">
       NazoMin
       NazoMin
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;16&quot; platformID=&quot;1&quot; platEncID=&quot;0&quot; langID=&quot;0x0&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="16" platformID="1" platEncID="0" langID="0x0" unicode="True">
       NazonoMincho
       NazonoMincho
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;1&quot; platformID=&quot;1&quot; platEncID=&quot;1&quot; langID=&quot;0xb&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="1" platformID="1" platEncID="1" langID="0xb" unicode="True">
       謎乃明朝 Regular
       謎乃明朝 Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;2&quot; platformID=&quot;1&quot; platEncID=&quot;1&quot; langID=&quot;0xb&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="2" platformID="1" platEncID="1" langID="0xb" unicode="True">
       Regular
       Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;4&quot; platformID=&quot;1&quot; platEncID=&quot;1&quot; langID=&quot;0xb&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="4" platformID="1" platEncID="1" langID="0xb" unicode="True">
       謎乃明朝 Regular
       謎乃明朝 Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;16&quot; platformID=&quot;1&quot; platEncID=&quot;1&quot; langID=&quot;0xb&quot; unicode=&quot;True&quot;&gt;
     <namerecord nameID="16" platformID="1" platEncID="1" langID="0xb" unicode="True">
       謎乃明朝
       謎乃明朝
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;1&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
       NazonoMincho Regular
       NazonoMincho Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;2&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
       Regular
       Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;3&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
       0.001;YHVH;NazoMin
       0.001;YHVH;NazoMin
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;4&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
       NazonoMincho Regular
       NazonoMincho Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;5&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
       Version 0.001;hotconv 1.1.0;makeotfexe 2.6.0
       Version 0.001;hotconv 1.1.0;makeotfexe 2.6.0
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;6&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
       NazoMin
       NazoMin
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;16&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x409&quot;&gt;
     <namerecord nameID="16" platformID="3" platEncID="1" langID="0x409">
       NazonoMincho
       NazonoMincho
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;1&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x411&quot;&gt;
     <namerecord nameID="1" platformID="3" platEncID="1" langID="0x411">
       謎乃明朝 Regular
       謎乃明朝 Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;2&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x411&quot;&gt;
     <namerecord nameID="2" platformID="3" platEncID="1" langID="0x411">
       Regular
       Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;4&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x411&quot;&gt;
     <namerecord nameID="4" platformID="3" platEncID="1" langID="0x411">
       謎乃明朝 Regular
       謎乃明朝 Regular
     &lt;/namerecord&gt;
     </namerecord>
     &lt;namerecord nameID=&quot;16&quot; platformID=&quot;3&quot; platEncID=&quot;1&quot; langID=&quot;0x411&quot;&gt;
     <namerecord nameID="16" platformID="3" platEncID="1" langID="0x411">
       謎乃明朝
       謎乃明朝
     &lt;/namerecord&gt;
     </namerecord>
   &lt;/name&gt;
   </name>


&lt;/ttFont&gt;</pre>
</ttFont></syntaxhighlight>
</div></div>
</div></div>


121行目: 121行目:
.ttxファイルを書き換え終わったら、次のコマンドで元のフォントファイルに適用する。
.ttxファイルを書き換え終わったら、次のコマンドで元のフォントファイルに適用する。


<pre class="visual">ttx -m fontfile.ttf fontfile.ttx</pre>
<syntaxhighlight lang="vb.net">ttx -m fontfile.ttf fontfile.ttx</syntaxhighlight>
mはmergeの頭文字である。ttfとttxの順番を間違えやすいので注意すること。基本的に、マージの時に使うフォントファイルは1つ、対してttxファイルは(今回の例とは違って複数のテーブルを一気にマージする場合は)複数あるかもしれないと考えると、1つしかない方を&#45;mの引数にするほうが簡明だと思われるので、それで覚えられる。といっても&#45;tの引数には複数のテーブルを指定できるわけだが…
mはmergeの頭文字である。ttfとttxの順番を間違えやすいので注意すること。基本的に、マージの時に使うフォントファイルは1つ、対してttxファイルは(今回の例とは違って複数のテーブルを一気にマージする場合は)複数あるかもしれないと考えると、1つしかない方を&#45;mの引数にするほうが簡明だと思われるので、それで覚えられる。といっても&#45;tの引数には複数のテーブルを指定できるわけだが…


問題がなければ、fontfile&#35;1.ttfのようなファイルが生成される(既存ファイルへの上書きは回避される)。ダブルクリックで開いてみて、名前が変わっていることを確認する。
問題がなければ、fontfile&#35;1.ttfのようなファイルが生成される(既存ファイルへの上書きは回避される)。ダブルクリックで開いてみて、名前が変わっていることを確認する。
[[Category:IT]]{{#seo:|title={{FULLPAGENAME}} - Turgenev's Wiki}}
[[Category:IT]]{{#seo:|title={{FULLPAGENAME}} - Turgenev's Wiki}}