latex3 / tagging-project

Issues related to the tagging project
https://latex3.github.io/tagging-project/
LaTeX Project Public License v1.3c
30 stars 13 forks source link

tagging of chessfss symbols #634

Open mbertucci47 opened 3 weeks ago

mbertucci47 commented 3 weeks ago

Following up on the comment in #607.

The chess font symbols of chessfss are not correctly mapped to Unicode where it makes sense or given ActualText.

\DocumentMetadata
  {
    lang=en-US,
    pdfversion=2.0,
    pdfstandard=ua-2,
    testphase={phase-III,math,title,table,firstaid}
  }
\documentclass{article}
\usepackage{chessfss}
\usepackage[LSB,LSBC3,T1]{fontenc}
\usepackage{xcolor}

\title{chessfss tagging test}

\begin{document}

\ExplSyntaxOn
\tl_map_inline:nn
  {
    \king
    \queen
    \rook
    \bishop
    \knight
    \pawn
    \checksymbol
    \castlinghyphen
    \withattack
    \withinit
    \zugzwang
    \withidea
    \onlymove
    \diagonal
    \file
    \centre
    \weakpt
    \ending
    \qside
    \kside
    \etc
    \morepawns
    \timelimit
    \moreroom
    \counterplay
    \capturesymbol
    \bishoppair
    \betteris
    \wupperhand
    \doublepawns
    \bupperhand
    \wbetter
    \bbetter
    \wdecisive
    \bdecisive
    \unclear
    \chesssee
    \mate
    \compensation
    \opposbishops
    \seppawns
    \passedpawn
    \samebishops
    \devadvantage
    \unitedpawns
    \with
    \without
    \comment
    \castlingchar
    \longcastling
    \shortcastling
    \novelty
    \various
  }
  { #1 \quad \cs_to_str:N #1 \par }
\ExplSyntaxOff

\setboardfontcolors{
  blackfieldmask=blue!30,
  whitefieldmask=yellow!50,
  blackfield=blue,
  whiteonwhitepiecemask=red!50,
  whitepiece=green,
  blackpiece=gray}
\setboardfontsize{30pt}%
\showchessboardencoding{LSBC3}
\end{document}
u-fischer commented 2 weeks ago

With pdftex one can handle the figurines with

\pdfglyphtounicode{tfm:SkakNew-Figurine/K}{2654}
\pdfglyphtounicode{tfm:SkakNew-Figurine/Q}{2655}
\pdfglyphtounicode{tfm:SkakNew-Figurine/R}{2656}
\pdfglyphtounicode{tfm:SkakNew-Figurine/B}{2657}
\pdfglyphtounicode{tfm:SkakNew-Figurine/N}{2658}
\pdfglyphtounicode{tfm:SkakNew-Figurine/p}{2659}

But this syntax seems not to work with lualatex (@zauguin ?)

For the other symbols I'm not sure what is best. One find for lots of them similar looking unicode chars, but I'm not sure if one should e.g. map \betteris to U+2313 ⌓.

FrankMittelbach commented 2 weeks ago

I think the figurines are unquestionable given that they have proper Unicode slots. For the others, I wonder. A quick look on the web didn't reveal any clear guidance on how they should be mapped to Unicode, so perhaps it is up to us to come up with a first suggestion and then take it from there and adjust. Or, perhaps with your background to the game @u-fischer you could try to reach out to see if some consensus could be found to get to a standard mapping.