jlreq icon indicating copy to clipboard operation
jlreq copied to clipboard

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

Open glandium opened this issue 1 year ago • 6 comments

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?

glandium avatar Jul 24 '24 08:07 glandium

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.

abenori avatar Jul 24 '24 13:07 abenori

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 avatar Jul 24 '24 21:07 glandium

... but only when enabling unicode in pxchfon

glandium avatar Jul 24 '24 21:07 glandium

Can you explain what you did?

abenori avatar Jul 25 '24 03:07 abenori

This works:

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

This doesn't:

\usepackage{jlreq-deluxe}
\usepackage[unicode]{pxchfon}

glandium avatar Jul 25 '24 03:07 glandium

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}/).

h20y6m avatar Jul 25 '24 11:07 h20y6m