abenori / jlreq

Other
125 stars 18 forks source link

Supported ways to set fonts with uplatex that don't affect open_bracket_pos? #136

Open glandium opened 1 month ago

glandium commented 1 month ago

Take the following document:

\documentclass[
  uplatex,
  tate,
  book,
  paper=a6,
  hanging_punctuation,
  open_bracket_pos=zenkakunibu_nibu,
  number_of_lines=16,
]{jlreq}
\title{テスト}
\usepackage{bxpapersize}

\begin{document}
\chapter{てすと}
「てすと」

てすと
\end{document}

I was trying to use pxchfon to be able to switch fonts in a convenient way, but to be able to use more than \setminchofont and \setgothicfont, you either need pxbabel (for e.g. \setkoreanminchofont) or otf (for e.g. \setboldminchofont).

Unfortunately, adding either \usepackage[burasage,deluxe]{otf} or \usepackage[main=japanese]{pxbabel} in the above document makes open_bracket_pos ignored (notwithstanding other differences).

Are there other options? Or maybe there's a jlreq bug here?

abenori commented 1 month ago

The reason is the following: open_bracket_pos is implemented using special JFM, but otf package uses its own JFM and therefore the setting by jlreq class file is ignored. Using \usepackage{jlreq-deluxe} instead of otf package should work. See https://github.com/h20y6m/jlreq-deluxe. I have no idea about pxbabel.

glandium commented 1 month ago

Unfortunately, for some reason I don't understand, using jlreq-deluxe fails:

pathsea: Running mktextfm zu-bzjlreq--upnmlminrn-v
/usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map typeface abbreviation u- for zu-bzjlreq--upnmlminrn-v.
/usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update /usr/share/texlive/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input zu-bzjlreq--upnmlminrn-v
This is METAFONT, Version 2.71828182 (TeX Live 2025/dev/Debian) (preloaded base=mf)

kpathsea: Running mktexmf zu-bzjlreq--upnmlminrn-v
! I can't find file `zu-bzjlreq--upnmlminrn-v'.
<*> ...nonstopmode; input zu-bzjlreq--upnmlminrn-v

Please type another input file name
! Emergency stop.
<*> ...nonstopmode; input zu-bzjlreq--upnmlminrn-v

Transcript written on mfput.log.
grep: zu-bzjlreq--upnmlminrn-v.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input zu-bzjlreq--upnmlminrn-v' failed to make zu-bzjlreq--upnmlminrn-v.tfm.
kpathsea: Appending font creation commands to /tmp/missfont.log.

! Font JT2/hmc/m/n/10=zu-bzjlreq--upnmlminrn-v at 10.0pt not loadable: Metric (
TFM) file not found.
<to be read again> 
                   relax 
l.15 \begin{document}

(that's with both jlreq-deluxe and pxchfon)

glandium commented 1 month ago

... but only when enabling unicode in pxchfon

abenori commented 1 month ago

Can you explain what you did?

glandium commented 1 month ago

This works:

\usepackage{jlreq-deluxe}
\usepackage{pxchfon}

This doesn't:

\usepackage{jlreq-deluxe}
\usepackage[unicode]{pxchfon}
h20y6m commented 1 month ago

The jlreq-deluxe package does not provide the zu-* JFM/VFs needed for pxchfon with the unicode option. If you would like to use them, you can generate them using the jfmutil command.

$ jfmutil jodel --unicode ubzjlreq bzjlreq
$ jfmutil jodel --unicode ubzjlreqv bzjlreq

("b": for hanging_punctuation, "z": for open_bracket_pos=zenkakunibu_nibu)

Put the generated .tfm/.vf files in a directory where your TeX and DVI-ware can find them (e.g. ~/texmf/fonts/{tfm,vf}/).