[lucida] Problems with Lucida OT font typesetting

John H Lienhard lienhard at mit.edu
Mon May 2 05:06:38 CEST 2022


Hi Raul –

Glad you have things working. 😊

BTW, the bm package is aimed at LaTeX, and not really compatible with unicode-math.

As a note for others who may read all this in the future, the calls to ISO style will set bold math in italic, so that \symbf{B} produces italic B.  Without those options, \symbf{B} will be bold upright, and \symbfit{B} is needed to get italic B.

            Cheers
            John

From: R Martinez <rm.tech at mac.com>
Date: Sunday, May 1, 2022 at 9:47 PM
To: John H Lienhard <lienhard at mit.edu>, TeXnical discussion of the Lucida fonts. <lucida at tug.org>, Herbert Voss <herbert.voss at fu-berlin.de>
Subject: Re: [lucida] Problems with Lucida OT font typesetting
Hello John and Herbert,

I greatly appreciate your replies to my queries about some difficulties I was having using the Lucida font for the first time. Your replies pointed me in the right direction and answered all my questions.

Particularly helpful was referring me to the unicode-math documentation, which helped me to resolve many of the issues.

Learning about the unicode-math options [bold-style=ISO,math-style=ISO] helped a lot.

Here’s my latest and hopefully last MWE and its output, which is attached as a PDF document.  Perhaps my investigation may have some results of interest to you. The bottom line is that item (6) together with the unicode-math ISO options provide the best method to get bold math characters in the correct typeface. It turns out that my desiderata (bold, italic math symbol with bold upright subscript) are ISO standards.

Thanks again.

J Raul Martinez

—————————

%\listfiles

% ----------Document class-------------------------------
\documentclass[12pt,reqno]{amsart}

%-------Packages----------------------------------------

%!TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode

\synctex=1

%----------------------------------------------------------

\usepackage{fontspec} % For XeLaTeX

\usepackage{amsmath,amsthm,amsxtra}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{bm} %For bold math symbols

\usepackage{fontspec}      % support opentype text fonts
\usepackage[bold-style=ISO,math-style=ISO]{unicode-math}  % support opentype math fonts

% Slightly reduce font size.
\defaultfontfeatures{Scale=.92}
%
% The explicit .otf extension tells the engines to find the font via
% filenames in the TeX trees, rather than as system-installed fonts.
%
\setmainfont[% main rm
  Ligatures=TeX,
      ItalicFont=LucidaBrightOT-Italic.otf,
        BoldFont=LucidaBrightOT-Demi.otf,
  BoldItalicFont=LucidaBrightOT-DemiItalic.otf,
  ]{LucidaBrightOT.otf}
%
%
\setsansfont[% main sans
  Ligatures=TeX,
      ItalicFont=LucidaSansOT-Italic.otf,
        BoldFont=LucidaSansOT-Demi.otf,
  BoldItalicFont=LucidaSansOT-DemiItalic.otf,
  ]{LucidaSansOT.otf}
%
\setmonofont[% main typewriter
      ItalicFont=LucidaSansTypewriterOT-Oblique.otf,
        BoldFont=LucidaSansTypewriterOT-Bold.otf,
  BoldItalicFont=LucidaSansTypewriterOT-BoldOblique.otf,
  ]{LucidaSansTypewriterOT.otf}
%
\setmathfont{LucidaBrightMathOT.otf}
\setmathfont[version=bold]{LucidaBrightMathOT-Demi.otf}
\setmathfont{LucidaBrightMathOT.otf}[RawFeature = {+ss04}]
%
% The specialized one-off fonts:
%\newfontface\LucidaBlackletter{LucidaBlackletterOT.otf}
%\newfontface\LucidaCalligraphy{LucidaCalligraphyOT.otf}
%\newfontface\LucidaHandwriting{LucidaHandwritingOT.otf}
%
% GrandeMono and Console fonts for an example:
%\newfontface\LucidaGrandeMono{LucidaGrandeMonoDK.otf}
%\newfontface\LucidaConsole{LucidaConsoleDK.otf}





%-------------------------------------------------------

\begin{document}

%-----------------------------------

Lucida Bright OT  fonts \\

The unicode-math package now has these option settings: \verb"[bold-style=ISO,math-style=ISO]". The ``bold-style'' option causes bold math symbols to be typeset in italic typeface.

One problem remains: Using boldface in math mode. \\

The problem: Given  the original in plain math.

\emph{Source}:  \verb"$B_3\big(s,a,(a+4)/3\big)$" \\
 \emph{Typeset}: $B_3\big(s,a,(a+4)/3\big)$    \\


I want $B_{3}$ to be in boldface in math mode with both $B$  and its subscript 3  in boldface but with an upright subscript. \\

\begin{enumerate}
\item Use the command \verb"\boldmath{}". \\
\emph{Source}: \verb"$\boldmath{B_3}\big(s,a,(a+4)/3\big)$" \\
\emph{Typeset}: $\mathbf{B_3}\big(s,a,(a+4)/3\big)$.   \\
\emph{Comment}: B is bold but upright. The subscript 3 is bold and upright.
\item Use the command \verb"\mathbf". \\
\emph{Source}: \verb"$\mathbf{B_3}\big(s,a,(a+4)/3\big)$" \\
\emph{Typeset}: $\mathbf{B_3}\big(s,a,(a+4)/3\big)$ \\
\emph{Comment}: \verb"\mathbf" changes \verb"B_{3}" to boldface but B is upright and 3 is not bold. \\
Same as \verb"\boldmath"
\item Use unicode-symbol commands \verb"\mbfitB" for B and \verb"\mbfthree" for 3.  \\
\emph{Source}: \verb"$\mbfitB_{\mbfthree}\big(s,a,(a+4)/3\big)$" \\
\emph{Typeset}: $\mbfitB_{\mbfthree}\big(s,a,(a+4)/3\big)$ \\
\emph{Comment}: Typeset output has bold B and 3, B is italic and 3 is upright. \\
\emph{This is the desired outcome.}
\item Use only the unicode-symbol command \verb"\mbfitB"  \\
\emph{Source}: \verb"$\mbfitB_{3}\big(s,a,(a+4)/3\big)$" \\
\emph{Typeset}: $\mbfitB_{3}\big(s,a,(a+4)/3\big)$ \\
\emph{Comment}: B is bold and italic and  3 is upright but not bold.
\item Use unicode command \verb"\symbf" only for B \\
\emph{Source}: \verb"$\symbf{B}_{3}\big(s,a,(a+4)/3\big)$"   \\
\emph{Typeset}: $\symbf{B}_{3}\big(s,a,(a+4)/3\big)$ \\
\emph{Comment}: B is bold and italic and 3 is upright but not bold. \\
Same as the immediately preceding item.
\item Use unicode command \verb"\symbf" for both B and 3 \\
\emph{Source}: \verb"$\symbf{B_3}\big(s,a,(a+4)/3\big)$" \\
\emph{Typeset}: $\symbf{B_3}\big(s,a,(a+4)/3\big)$ \\
\emph{Comment}: B is bold and italic, and 3 is bold and upright. \\
\emph{This is the desired outcome.} \\
It is also the preferred approach because it is simpler and more general than using the command pair \verb"\mbfitB" and \verb"\mbfthree".
\item Use the command \verb"\bm{}" from the ``bm'' package. \\
\emph{Source}: \verb"$\bm{B_3}\big(s,a,(a+4)/3\big)$" \\
\emph{Typeset}: $\bm{B_3}\big(s,a,(a+4)/3\big)$. \\
\emph{Comment}: The typeset output is incorrect. \\
Package bm does not work.
\end{enumerate}

%------------------------
\end{document}

--------------------------------


On Apr 30, 2022, at 2:35 PM, John H Lienhard <lienhard at mit.edu<mailto:lienhard at mit.edu>> wrote:

Hi J R,

It appears that your source file is missing the correct line to active math version=bold. Put this in your preamble, and \boldmath will do its job:

\setmathfont{LucidaBrightMathOT-Demi.otf}[version=bold]

At the point where you call \mathbf{}, you note that that you get an upright, not italic, bold symbol.  This is the expected behavior for \mathbf – it calls the bold text character.  With unicode-math, you want \symbfit instead.  Could I suggest you have a look at the documentation for unicode-math?  From the terminal,

texdoc unicode-math

will bring it up (or look for it in ctan.org<http://ctan.org/>).

For the \mathcal  symbol, you are getting the [default] script option of Lucida.  If you prefer more calligraphic option, put:

\setmathfont{LucidaBrightMathOT.otf}[RawFeature = {+ss04}]

This calls stylistic set 04 (see the lucida-otf documentation), which is a different mathcal font.

On the \emph font, I’m not sure what you are expecting to see other than italic?  Have a look at the discussion of \emph in the fontspec documentation.

Hope this helps a bit.

            John


From: lucida <lucida-bounces+lienhard=mit.edu at tug.org<mailto:lucida-bounces+lienhard=mit.edu at tug.org>> on behalf of R Martinez <rm.tech at mac.com<mailto:rm.tech at mac.com>>
Date: Saturday, April 30, 2022 at 4:32 PM
To: TeXnical discussion of the Lucida fonts. <lucida at tug.org<mailto:lucida at tug.org>>
Subject: [lucida] Problems with Lucida OT font typesetting
Hello,

I am new using the Lucida OT fonts and have been testing them. Thanks to Bruno Voisin, the fonts are correctly installed on my M1 MacBook Pro running OS 12.3.1. I’m using MacTeX 2022 with TeXShop 4.72. I have correctly typeset all the Lucida source documents that are included in the Lucida distribution.

The problems are described in detail in the attached PDF document, which contains the output of my test.

In a nutshell, there are three problems:
1. Using boldface in math mode.
2. Same text printed in emphasis and italic mode are identical.
3. The \mathcal typeface produces the wrong output.

Below is my source text. The preamble is extracted from the lucidaot.tex document provided with the Lucida font distribution. The annotated output is in the attached PDF document.

I will greatly appreciate comments and suggestions.

Thanks in advance.

J R Martinez


%\listfiles

% ----------Document class-------------------------------
\documentclass[12pt,reqno]{amsart}

%-------Packages----------------------------------------

%!TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode

\synctex=1

%----------------------------------------------------------

\usepackage{fontspec} % For XeLaTeX

\usepackage{amsmath,amsthm,amsxtra}
\usepackage{amssymb} %This is redundant when using STIX and kpfonts-otf
\usepackage{mathtools}
\usepackage{bm} %For bold math symbol

\usepackage{fontspec}      % support opentype text fonts
\usepackage{unicode-math}  % support opentype math fonts

% Slightly reduce font size.
\defaultfontfeatures{Scale=.92}
%
% The explicit .otf extension tells the engines to find the font via
% filenames in the TeX trees, rather than as system-installed fonts.
%
\setmainfont[% main rm
  Ligatures=TeX,
      ItalicFont=LucidaBrightOT-Italic.otf,
        BoldFont=LucidaBrightOT-Demi.otf,
  BoldItalicFont=LucidaBrightOT-DemiItalic.otf,
  ]{LucidaBrightOT.otf}
%
%
\setsansfont[% main sans
  Ligatures=TeX,
      ItalicFont=LucidaSansOT-Italic.otf,
        BoldFont=LucidaSansOT-Demi.otf,
  BoldItalicFont=LucidaSansOT-DemiItalic.otf,
  ]{LucidaSansOT.otf}
%
\setmonofont[% main typewriter
      ItalicFont=LucidaSansTypewriterOT-Oblique.otf,
        BoldFont=LucidaSansTypewriterOT-Bold.otf,
  BoldItalicFont=LucidaSansTypewriterOT-BoldOblique.otf,
  ]{LucidaSansTypewriterOT.otf}
%
\setmathfont{LucidaBrightMathOT.otf}
%\setmathfont[version=bold]{LucidaBrightMathOT-Demi}
%
% The specialized one-off fonts:
%\newfontface\LucidaBlackletter{LucidaBlackletterOT.otf}
%\newfontface\LucidaCalligraphy{LucidaCalligraphyOT.otf}
%\newfontface\LucidaHandwriting{LucidaHandwritingOT.otf}
%
% GrandeMono and Console fonts for an example:
%\newfontface\LucidaGrandeMono{LucidaGrandeMonoDK.otf}
%\newfontface\LucidaConsole{LucidaConsoleDK.otf}





%-------------------------------------------------------

\begin{document}

%-----------------------------------

Lucida Bright OT  fonts \\

There are three problems:
\begin{enumerate}
\item Using boldface in math mode.
\item Using \verb"\emph" in text mode.
\item Something is wrong with the \verb"\mathcal" command.
\end{enumerate}

Problem 1: Using boldface in math mode.\\
The problem: I want the math symbol $B_{3}$ to be in boldface in math mode with $B$ not upright. Both B and its subscript 3 should be in boldface. The command \verb"\bm{}" from the ``bm'' package does not work at all.


The following examples illustrate the problem. I show the typeset original followed by the command.

This is the original in plain math.

$B_3\big(s,a,(a+4)/3\big)$    \\
\verb"$B_3\big(s,a,(a+4)/3\big)$" \\

This is the attempt using \verb"\boldmath".
The \verb"\boldmath" command does not do anything.


$\boldmath{B_3}\big(s,a,(a+4)/3\big)$ \\
\verb"$\boldmath{B_3}\big(s,a,(a+4)/3\big)$" \\

This is the attempt using \verb"\mathbf".
The \verb"\mathbf" command changes \verb"B_{3}" to boldface but B is upright:
$\mathbf{B_3}\big(s,a,(a+4)/3\big)$.   \\
\verb"$\mathbf{B_3}\big(s,a,(a+4)/3\big)$" \\

Typeface issues.\\

Problem 2: The emphasis and italic typeface commands produce identical output.
Examples follow. \\



These illustrate the issue with \verb"\emph". \\
\emph{Emphasis},  \textit{Emphasis in italic mode} \\
\verb"\emph{Emphasis},  \textit{Emphasis in italic mode}" \\

\textit{Italic}, \emph{Italic in emphasis mode} \\
\verb"\textit{Italic}, \emph{Italic in emphasis mode}" \\

Problem 3: \verb"\mathcal" produces the wrong output.
These illustrate the issue with  \verb"\mathcal", namely, the typeset characters are not the Lucida Calligraphy OT characters.

$ \mathcal{MathCal}, \mathcal{MATHCAL} $ \\
\verb"$ \mathcal{MathCal}, \mathcal{MATHCAL} $" \\


$\mathcal{A, B, C, D, E, F, G, H, I, J, K, L, M}$ \\
\verb"$\mathcal{A, B, C, D, E, F, G, H, I, J, K, L, M}$" \\

$\mathcal{N, O, P, Q, R, S, T, U, V, W, X, Y, Z}$ \\
\verb"$\mathcal{N, O, P, Q, R, S, T, U, V, W, X, Y, Z}$" \\


%------------------------
\end{document}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/lucida/attachments/20220502/c7b41ad0/attachment-0001.html>


More information about the lucida mailing list.