Skip to content

OpenType c2sc feature works improperly #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
YellowJacketLinux opened this issue Jan 26, 2024 · 2 comments
Closed
2 tasks

OpenType c2sc feature works improperly #497

YellowJacketLinux opened this issue Jan 26, 2024 · 2 comments

Comments

@YellowJacketLinux
Copy link

YellowJacketLinux commented Jan 26, 2024

Description

The c2sc OpenType feature is supposed to use the small-caps variant of the lower case letter where the upper case letter is requested, but the unicode code-point should still be for the upper-case variant so that copy and paste still produces an upper-case letter regardless of font features in the document being pasted into.

Check/indicate

  • [ ?] Relevant for XeTeX
  • [ YES] Relevant for LuaTeX
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate

Minimal example demonstrating the issue

\RequirePackage{fontspec}
\documentclass[letterpaper,fontsize=14pt]{scrarticle}

\setmainfont
  [ Ligatures   = TeX ,
    Extension   = .otf ,
    UprightFont = *-regular ,
    BoldFont = *-bold ,
    ItalicFont = *-italic ,
    BoldItalicFont = *-bolditalic ]
  {texgyretermes}
\setsansfont
  [ Ligatures   = TeX ,
    Extension   = .otf ,
    UprightFont = *-regular ,
    BoldFont = *-bold ,
    ItalicFont = *-italic ,
    BoldItalicFont = *-bolditalic ]
  {texgyreheros}
\setmonofont
  [ Ligatures   = NoCommon ,
    Extension   = .otf ,
    UprightFont = *-regular ,
    BoldFont = *-bold ,
    ItalicFont = *-italic ,
    BoldItalicFont = *-bolditalic ]
  {texgyrecursor}

\usepackage[colorlinks=true]{hyperref}

\begin{document}
\section{Stuff}
Herod the Great died at around
4~{\fontspec[Letters=UppercaseSmallCaps]{texgyretermes-regular.otf}B.C.E.}\
but Quirinius did not become governor of Syria until
6~{\fontspec[Letters=UppercaseSmallCaps]{texgyretermes-regular.otf}C.E.}\
which means the tax of Quirinius did not happen until at least ten years after Herod the Great died.

\end{document}

Further details

With the above example, the resulting PDF (when compiled with lualatex renders correctly however copy the string and paste it elsewhere, and both the B.C.E. and C.E. will be lower-case, indicating that the lower-case unicode code points were used.

@TeXhackse
Copy link

It's the same in XeLaTeX. I had a look at that yesterday after @YellowJacketLinux asked a question on that via Mastodon.

And also tried to find similar issues and did not, in case that information helps.

@wspr
Copy link
Collaborator

wspr commented Jan 29, 2024

Sorry, this is an engine issue which fontspec doesn't have any ability to change. Not saying the behaviour you're seeing is right or wrong, just that the package can't do anything about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants