Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View aminophen's full-sized avatar
☃️
☃️⛄️🍣🦆🐦🤯🤮😱🤔🙃

Hironobu Yamashita aminophen

☃️
☃️⛄️🍣🦆🐦🤯🤮😱🤔🙃
View GitHub Profile
@aminophen
aminophen / gk-over256.tex
Created September 10, 2023 11:22
(u)pTeX: JFM glue/kern with more than 256 different value
%#!uptex
%% まずは kern が 256 を超える時:
% * (u)pPLtoTF はエラー発生しないが正常に格納できず→修正が必要
% * (u)pTFtoPL は元々読み出し OK
% * (u)pTeX は元々読み出し OK
% ※オリジナルの欧文版は max_kerns=5000 まで許容
\prebreakpenalty`…=0
\prebreakpenalty`「=0
\prebreakpenalty`・=0
@aminophen
aminophen / upkchar-mod.tex
Created September 1, 2023 22:53
upTeX: 文字コードの範囲を調べてみる
%#!euptex
% "8000000 = 2147483648 (TeX Integer Limit + 1)
% "1000000 = 16777216 (24bit + 1)
% "110000 = 1114112 (Unicode + 1)
% 文字コード "110000 以上は otf パッケージで
% Unicode (.."10FFFF) までに設定された \kcatcode や
% 禁則ペナルティの影響を受けない目的で利用される.
% ノード化の際もそのままの文字コードである.
% DVI 出力時には文字コード mod "110000 とみなす.
@aminophen
aminophen / nptex.am.patch
Created August 20, 2023 07:56
Building npTeX based on XeTeX for Mac
diff --git a/texk/web2c/nptexdir/am/nptex.am b/texk/web2c/nptexdir/am/nptex.am
index a3e08dd271..7fcfdd7cb7 100644
--- a/texk/web2c/nptexdir/am/nptex.am
+++ b/texk/web2c/nptexdir/am/nptex.am
@@ -25,8 +25,7 @@ nptex_CPPFLAGS = $(nptex_cppflags)
nptex_CFLAGS = $(WARNING_CFLAGS)
nptex_CXXFLAGS = # $(WARNING_CXXFLAGS)
nptex_LDADD = $(xetex_ldadd) $(LDADD) $(ipc_socketlibs) $(PTEXENC_LIBS)
-
-$(nptex_OBJECTS): $(nptex_prereq)
@aminophen
aminophen / brand_new_ptex.md
Last active October 29, 2022 03:27
Brand new pTeX - brainstorming

仕様案

従来の (u)pTeX と「付かず離れず」のクリーンな設計を考える。

  • 可能な文字コードは全 Unicode 範囲とする。
  • 欧文・和文とは関係なく常に「1文字1トークン」とする。(変更)
    • これで「1文字1トークンの和文文字の UTF-8 → Unicode 変換結果」と「1バイト1トークンの欧文文字」が 0x80--0xFF で衝突することがなくなる。★
    • 文字トークンの区切りが変化することもなくなる=「バッククオートで Unicode 文字直書きからコード取得」は常に安全。
    • [TODO] TeX82 の「1文字コントロールシーケンスの特別扱い」(つまり \aa はバッククオートでのコード取得が同値)は 0--255 のままにできるか?
  • 内部バッファの文字コードは固定する。(pTeX の EUC/SJIS は廃止)
@aminophen
aminophen / ptexfontname.tex
Last active October 17, 2022 15:10
[pTeX] New feature candidates for JIS-encoded or UCS-encoded TFM
%#!ptex, uptex, eptex, euptex
\nonstopmode
\tracingonline1
\tracingoutput1
\showboxdepth10000
\showboxbreadth10000
\newlinechar10
\font\x=zpl-Regular-tlf-t1
@aminophen
aminophen / ucs_toucs.tex
Last active October 16, 2022 12:58
Test for \ucs and \toucs: check if a number is in the range of JIS X 0208
%#!eptex -ini -etex
\let\dump\relax
\input plain
\newlinechar=`^^J
\newcount\tempcnta
\newcount\CharCount
\xdef\KINTERNAL{%
\ifnum\ucs"3000="3000 \string\ucs
@aminophen
aminophen / 20221016-ptex-jfmenc.diff
Last active October 15, 2022 23:58
[pTeX] Interface to specify JIS-encoded or UCS-encoded TFM
Index: eptexdir/eptex.defines
===================================================================
--- eptexdir/eptex.defines (revision 64704)
+++ eptexdir/eptex.defines (working copy)
@@ -34,6 +34,7 @@
@define function fromKUTEN ();
@define function UCStoUTF8 ();
@define function fromUCS ();
+@define function toJIS ();
@define function toUCS ();
@aminophen
aminophen / lastnodefont-test.tex
Last active February 14, 2022 13:20
e-(u)ptex: Add \lastnodefont primitive
%#!eptex
\catcode`\{=1
\catcode`\}=2
\hsize=300pt
\def\LNC{%
\ifnum\lastnodechar=-1 \message{LNC: -1}\else
\message{LNC: \the\lastnodechar}\fi}
\def\LNF{%
\ifjfont\lastnodefont \message{LNF: J:\fontname\lastnodefont}\else
@aminophen
aminophen / plext-caption-debug.diff
Last active January 30, 2022 10:53
Debug code for caption in plext.sty
diff --git a/plext.sty b/plext.sty
index 6948219..97ca652 100644
--- a/plext.sty
+++ b/plext.sty
@@ -173,6 +173,8 @@
\floatheight\ht\z@\advance\floatheight\dp\z@\relax
\floatruletick\z@
\fi
+ \typeout{float size:
+ \the\floatwidth:\the\floatheight:\float@pos}%
@aminophen
aminophen / fontchartype-test.tex
Last active January 26, 2022 14:22
e-(u)ptex: Add \fontchartype primitive
%#!eptex -ini -etex
\catcode`\{=1
\catcode`\}=2
\catcode`\^=7
\newlinechar=10
%---
\ifnum\jis"2121="3000
\font\STANDARD=upjisg-h