#StackBounty: #microsoft-word #pdf #fonts #adobe-acrobat How to enable non-English text copying from PDF file?

Bounty: 100

I converted a MS Doc file to a PDF file. If the file contains English then, one can copy text from the converted PDF file. But if the file contains language other than English, and someone tries to copy that non-English text from the converted PDF file, and paste it to a MS doc file, then the pasted text becomes gibberish.

What is the solution?

I tried with Adobe Acrobat and Foxit reader to convert Doc file to PDF file. Also when I save MS Doc file, I keep tick on the Embed fonts in the file in Save.

For example, I write the below line in Mangal font in MS Word

बिहार विधानसभा चुनाव में एक बार फिर एनडीए की सरकार बनती नजर आ रही है।

I convert the file using Foxit reader, when I copy the text from PDF file and paste it to search bar or MS Word, I get –

बहार वधानसभा चुनाव म एक बार फर एनडीए क सरकार बनती नजर आ रह है।

What is the remedy?


Get this bounty!!!

#StackBounty: #kubuntu #fonts #inkscape #texlive PFB fonts are broken in certain applications and missing in others (Kubuntu 20.04)

Bounty: 100

I am running Kubuntu 20.04. I have a problem where certain fonts (Courier and Century Schoolbook L) are broken in applications like Inkscape (where they are invisible) or font-manager where they show like this:
Font-manager with broken fonts

They also don’t show up in Libre office (Don’t really care about this as I rarely touch word-processors).

All broken fonts are .pfb fonts installed through TeX-live or ghostscript. As the font is already installed I am not able to install TTFs of the font I need. Obviously I do not want to uninstall ghostscript or tex-live as I use them regularly.

I have tried running

sudo fc-cache -f -v

to no avail. The font show up find in KFontView:
enter image description here

The bug is particularly frustrating as I have existing artwork in inskcape which used courier and Century Schoolbook L.


Get this bounty!!!

#StackBounty: #fonts #color #packages #tcolorbox A small display of a scientific calculator

Bounty: 100

Starting from LCD package (one page) of documentation, looking in particular this question where there is the long code of @Thomas F. Sturm (here):,

documentclass[openany,10pt]{book}

usepackage{newpxtext}

usepackage[varg]{newpxmath} %font package

usepackage[letterpaper,margin=0.75in,bindingoffset=0.5in]{geometry}

usepackage[most]{tcolorbox}
    colorlet{blackened}{black!90!white}
    colorlet{blackish}{black!70!white}
    colorlet{greyish}{black!60!white}
    colorlet{whiteish}{white}
    colorlet{orangeish}{yellow!90!red}
    colorlet{greenish}{green!16!gray}
    colorlet{redish}{red!80!black}

tcbset{calbackground/.style={
    enhanced,
    leftright skip=0.25cm,beforeafter skip=0pt,
    toptitle=0mm,bottomtitle=0mm,
    right=2mm,left=2mm,
    top=1pt,
    bottom=0.25cm,
    boxsep=0pt,
    boxrule=0mm,
    sharp corners,
    sidebyside,
    sidebyside gap=2mm,
    lefthand ratio=0.6,
    bicolor,
    colback=black!10!white,
    colbacklower=greenish,
    colframe=white,
    autoparskip,
    }}

newtcbtheorem[no counter]{calx}{Calculator}{calbackground}{cax}

newtcbox{KY}[1][]{
    enhanced,
    on line,
    arc=2pt,outer arc=2pt,
    boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
    boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
    interior style={top color=blackish,bottom color=blackened},
    colframe=greyish,
    width=2.5em,
    tcbox width=forced center,
    equal height group=K,
    valign=center,
    fontupper=footnotesizesffamily,
    coltext=orangeish,
    before upper=vrule width 0pt height 2ex depth 1exrelax,
    }

newtcbox{KYm}[1][]{
    enhanced,
    on line,
    arc=2pt,outer arc=2pt,
    boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
    boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
    interior style={top color=blackish,bottom color=blackened},
    colframe=greyish,
    width=2.5em,
    tcbox width=forced center,
    equal height group=K,
    valign=center,
    fontupper=footnotesizesffamily,
    coltext=orangeish,
    before upper=vrule width 0pt height 2ex depth 1exrelax$,
    after upper=$,
    }

newtcbox{KN}{
    enhanced,
    on line,
    arc=2pt,outer arc=2pt,
    boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
    boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
    interior style={top color=blackish,bottom color=blackened},
    colframe=greyish,
    width=1.5em,
    tcbox width=forced center,
    equal height group=K,
    valign=center,
    fontupper=footnotesizesffamily,
    coltext=whiteish,
    before upper=vrule width 0pt height 2ex depth 1exrelax,
    }

usepackage{lcd}
    LCDcolors{black}{greenish}
    DefineLCDchar{sq}{11100001000100011100000000000000000}
    DefineLCDchar{tm}{00000100010101000100010101000100000}
    DefineLCDchar{dv}{00000001000000011111000000010000000}
    DefineLCDchar{mu}{00011000011110100001000000000000000}
    DefineLCDchar{sc}{11011010011001000000000000000000000}

DeclareMathOperator{ee}{textrm{e}}

usepackage{MnSymbol} %boxes
usepackage{xfrac} %sfrac
usepackage{lipsum} %for textwidth comparison
    setlipsumdefault{1-2}

begin{document}

begin{calx}{}{}
KY{$($}KN{3}KY{$x^2$}KN{-}KN{4}KY{$x^2$}KN{-}KN{6}KY{$x^2$}KY{$)$}KN{$=$}
tcblower
{LargetextLCD[0]{20}|(3{sq}-4{sq}-6{sq})|}
{LARGEtextLCD[0]{16}|             -43|}
end{calx}
%
begin{calx}{}{}
KN{$div$}KY{$($}KY{$(-)$}KN{2}KN{$times$}KN{4}KN{$times$}KN{6}KY{$)$}KN{$=$}
tcblower
{LargetextLCD[0]{20}|ANS{dv}(-2{tm}4{tm}6)|}
{LARGEtextLCD[0]{16}|    0.8958333333|}
end{calx}
%
begin{calx}{}{}
KY{$cos^{-1}$}KY{ANS}KN{$=$}
tcblower
{LargetextLCD[0]{20}|cos{mu}(ANS|}
{LARGEtextLCD[0]{16}|     26.38432975|}
end{calx}
%
begin{calx}{}{}
KY{$circ,prime,primeprime$}
tcblower
{LargetextLCD[0]{20}|cos{mu}(ANS|}
{LARGEtextLCD[0]{16}|     26°23'3.59{sc} |}
end{calx}

lipsum

KYm{x^2}%
KYm{x^3}%
KYm{x^{-1}}%
KYm{x^{filledsquare}}%
KYm{sqrt{filledmedsquare}}%
KYm{sqrt[3]{filledmedsquare}}%
KYm{sqrt[filledsquare]{medsquare}}\

KY{$ln$}%
KY{$log$}%
KY{$log_{filledsquare}medsquare$}%
KY{$10^{filledsquare}$}%
KY{$ee^{filledsquare}$}\

KY{$(-)$}%
KY{$frac{filledmedsquare}{medsquare}$}%
KY{$sfrac{filledmedsquare}{medsquare}$}%
KY{$tfrac{filledmedsquare}{medsquare}$}\

KY{$circ,prime,primeprime$}%
KY{$sin$}%
KY{$sin^{-1}$}%
KY{$cos$}%
KY{$cos^{-1}$}%
KY{$tan$}%
KY{$tan^{-1}$}\

KY{$($}%
KY{$)$}%
KN{$times$}%
KN{$div$}%
KN{$+$}%
KN{$-$}%
KN{$=$}\

KN{$1$}%
KN{$2$}%
KN{$3$}%
KN{$4$}%
KN{$5$}%
KN{$6$}%
KN{$7$}%
KN{$8$}%
KN{$9$}%
KN{$0$}\

KN{1}%
KN{2}%
KN{3}%
KN{4}%
KN{5}%
KN{6}%
KN{7}%
KN{8}%
KN{9}%
KN{0}\

end{document}

how can I reduce the MWE adding only the words DEG or RAD in character LCD, increasing the dimension of the rectangle (height and lenght)?

Thank you very much for all users.

enter image description here


Related question for the symbols of the calculator: Easiest way to create TeX macro/code to access symbols from particular font?


Get this bounty!!!

#StackBounty: #linux #fonts #libreoffice #user-interface Changing the UI font for LibreOffice in Linux

Bounty: 100

I’m using the official LibreOffice package for Linux, version 7.0.1, and I’ve no idea how to change the font for the user interface (dialogs, menu, options, etc). I’ve been Googling for that for the past two years and nothing has come up unfortunately. It would be great if someone dug deep into the application and resolved this conundrum. It looks like LibreOffice uses some "default" fonts for Windows/Linux/Mac OS but again, it’s not clear what the defaults are and how to override them. There’s nothing in the options aside from the ability to enable/disable font antialiasing.

Someone who can read code can certainly figure it out but I won’t attempt to comb through 1GB of sources: https://github.com/LibreOffice/core

I’ve found a file which seemingly describes default fonts but it’s too much for me: https://github.com/LibreOffice/core/blob/master/officecfg/registry/data/org/openoffice/VCL.xcu


Get this bounty!!!

#StackBounty: #fonts #fontspec #siunitx #unicode-math fonts / siunitx: Understanding how "detect-all" and "detect-inline…

Bounty: 50

For the following, I need to

1- understand why neither detect-all nor detect-inline-family=math doesn’t make num print the same font as the surrounding inline math, and the only way to do so is through math-rm = symup as suggested by this answer.

2- understand why I need to load the option math-rm = symup in order to make num copy the document default math font.

3- know if it is possible to make the default math font-weight as light as the surrounding normal text since it looks a bit bolder for my eyes.

enter image description here

documentclass[14pt]{article}

usepackage[no-math]{fontspec}
setmainfont{Latin Modern Roman}

usepackage{unicode-math}
setmathfont[math-style=ISO]{Cambria Math}

usepackage[
detect-all,
detect-inline-family=math
]{siunitx}

begin{document}
    centering
    text: 123 num{123}\
    inline math: $123~num{123}$\
    display math: [123~num{123}]
    
    verb|sisetup{math-rm = symup}|
    sisetup{math-rm = symup} % https://tex.stackexchange.com/a/438342/2288
    
    vspace{baselineskip}
    text: 123 num{123}\
    inline math: $123~num{123}$\
    display math: [123~num{123}]
end{document}


Get this bounty!!!

#StackBounty: #fonts Will MSCoreFonts displaying styles with foreign characters on fc-list affect the way the font works?

Bounty: 50

I recently installed the MS Core Fonts 2 on my Linux server so I can use the MS style TTF for my documents, but when I run the fc-list command, there are several items that stand out as odd.

Some of the fonts are showing non-English characters as their style designation.

  • Example 1: /usr/share/fonts/msttcore/timesbd.ttf: Times New Roman:style=Έντονα,Bold
  • Example 2: /usr/share/fonts/msttcore/cour.ttf: Courier New:style=Κανονικά,Regular
  • Example 3: /usr/share/fonts/msttcore/arial.ttf: Arial:style=Standaard,Regular

My text is primarily in US English, so I am concerned that when the fonts are applied to my text, the fonts will mis-translate characters rather than just apply the expected italic/bold/font style. I found a similar unanswered question.

Are these non-English characters just name designations and can they be safely ignored, or will using these fonts potentially affect the actual data / text characters in a detrimental way?

Full results of the fc-list

-bash-4.2$ fc-list | grep ms
/usr/share/fonts/msttcore/candaraz.ttf: Candara:style=Bold Italic
/usr/share/fonts/msttcore/corbeli.ttf: Corbel:style=Italic
/usr/share/fonts/msttcore/timesbd.ttf: Times New Roman:style=Έντονα,Bold
/usr/share/fonts/msttcore/verdana.ttf: Verdana:style=Regular
/usr/share/fonts/msttcore/tahoma.ttf: Tahoma:style=Regular
/usr/share/fonts/msttcore/corbelz.ttf: Corbel:style=Bold Italic
/usr/share/fonts/msttcore/georgiai.ttf: Georgia:style=Italic,Cursiva
/usr/share/fonts/msttcore/impact.ttf: Impact:style=Regular,Standard
/usr/share/fonts/msttcore/ariali.ttf: Arial:style=Πλάγια,Italic
/usr/share/fonts/msttcore/andalemo.ttf: Andale Mono:style=Regular,normal
/usr/share/fonts/msttcore/courbd.ttf: Courier New:style=tučné,Bold
/usr/share/fonts/msttcore/timesi.ttf: Times New Roman:style=Πλάγια,Italic
/usr/share/fonts/msttcore/corbel.ttf: Corbel:style=Regular
/usr/share/fonts/msttcore/trebucbi.ttf: Trebuchet MS:style=Bold Italic,Negrita Cursiva
/usr/share/fonts/msttcore/constanb.ttf: Constantia:style=Bold
/usr/share/fonts/msttcore/georgiab.ttf: Georgia:style=Bold,Negreta
/usr/share/fonts/msttcore/calibri.ttf: Calibri:style=Regular
/usr/share/fonts/msttcore/comic.ttf: Comic Sans MS:style=Regular,normal
/usr/share/fonts/msttcore/consolab.ttf: Consolas:style=Bold
/usr/share/fonts/msttcore/verdanaz.ttf: Verdana:style=Bold Italic,Negreta cursiva
/usr/share/fonts/msttcore/cour.ttf: Courier New:style=Κανονικά,Regular
/usr/share/fonts/msttcore/consola.ttf: Consolas:style=Regular
/usr/share/fonts/msttcore/arialbi.ttf: Arial:style=Έντονα Πλάγια,Bold Italic
/usr/share/fonts/msttcore/georgiaz.ttf: Georgia:style=Bold Italic,Negreta cursiva
/usr/share/fonts/msttcore/times.ttf: Times New Roman:style=Standaard,Regular
/usr/share/fonts/msttcore/calibrii.ttf: Calibri:style=Italic
/usr/share/fonts/msttcore/courbi.ttf: Courier New:style=fed kursiv,Bold Italic
/usr/share/fonts/msttcore/constanz.ttf: Constantia:style=Bold Italic
/usr/share/fonts/msttcore/cambriab.ttf: Cambria:style=Bold
/usr/share/fonts/msttcore/corbelb.ttf: Corbel:style=Bold
/usr/share/fonts/msttcore/couri.ttf: Courier New:style=kurzíva,Italic
/usr/share/fonts/msttcore/constani.ttf: Constantia:style=Italic
/usr/share/fonts/msttcore/ariblk.ttf: Arial Black:style=Regular,Standard
/usr/share/fonts/msttcore/arial.ttf: Arial:style=Standaard,Regular
/usr/share/fonts/msttcore/candarai.ttf: Candara:style=Italic
/usr/share/fonts/msttcore/consolaz.ttf: Consolas:style=Bold Italic
/usr/share/fonts/msttcore/trebucit.ttf: Trebuchet MS:style=Italic,Cursiva
/usr/share/fonts/msttcore/constan.ttf: Constantia:style=Regular
/usr/share/fonts/msttcore/calibriz.ttf: Calibri:style=Bold Italic
/usr/share/fonts/msttcore/calibrib.ttf: Calibri:style=Bold
/usr/share/fonts/msttcore/trebuc.ttf: Trebuchet MS:style=Regular
/usr/share/fonts/msttcore/cambriaz.ttf: Cambria:style=Bold Italic
/usr/share/fonts/msttcore/candara.ttf: Candara:style=Regular
/usr/share/fonts/msttcore/webdings.ttf: Webdings:style=Regular,normal
/usr/share/fonts/msttcore/georgia.ttf: Georgia:style=Regular,obyčejné
/usr/share/fonts/msttcore/arialbd.ttf: Arial:style=Έντονα,Bold
/usr/share/fonts/msttcore/trebucbd.ttf: Trebuchet MS:style=Bold,Negrita
/usr/share/fonts/msttcore/cambriai.ttf: Cambria:style=Italic
/usr/share/fonts/msttcore/verdanab.ttf: Verdana:style=Bold,Fett
/usr/share/fonts/msttcore/comicbd.ttf: Comic Sans MS:style=Bold,Έντονα
/usr/share/fonts/msttcore/candarab.ttf: Candara:style=Bold
/usr/share/fonts/msttcore/consolai.ttf: Consolas:style=Italic
/usr/share/fonts/msttcore/verdanai.ttf: Verdana:style=Italic,Cursiva
/usr/share/fonts/msttcore/timesbi.ttf: Times New Roman:style=Έντονα Πλάγια,Bold Italic


Get this bounty!!!

#StackBounty: #fonts #xetex #fontspec #mactex #hoefler xelatex does not find some Hoefler Text ligatures that it used to find

Bounty: 50

I just updated to MacTex 2020, and I get the following error, on a document that was compiling fine yesterday, and without having made any change to the document.

I compile with:

xelatex test.tex

and get:

This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex)
 restricted write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrartcl.cls
Document Class: scrartcl 2020/01/24 v3.29 KOMA-Script document class (article)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrkbase.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrbase.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrlfile.sty)))
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrsize10pt.clo)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/typearea.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def
))) (/usr/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2020/texmf-dist/tex/xelatex/xltxtra/xltxtra.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifluatex.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifxetex.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/realscripts/realscripts.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/metalogo/metalogo.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/xetex.def)))))

Package fontspec Warning: AAT feature
(fontspec)                'Ligatures=Common,Rare,Historic,Contextual' (1,2)
(fontspec)                not available in font 'Hoefler Text'.


Package fontspec Warning: AAT feature
(fontspec)                'Ligatures=Common,Rare,Historic,Contextual' (1,4)
(fontspec)                not available in font 'Hoefler Text'.


! LaTeX3 Error: Key 'fontspec-aat/Ligatures' accepts only a fixed set of
(LaTeX3)        choices.

For immediate help type H <return>.
 ...

l.7

?

where test.tex is:

documentclass[10pt,a4paper]{scrartcl}
usepackage{fontspec, xltxtra}
setmainfont[Mapping=tex-text, ItalicFeatures={Alternate = 0}, 
Ligatures={Common,Rare,Historic,Contextual},Contextuals=Inner,Alternate=1]{Hoefler Text}

begin{document}
ff fi ffi ct st
end{document}

What should I do to fix this?

Addendum Adding Renderer=OpenType removes the error messages when compiling but the ct and st ligatures are lost.

Addendum 2 The .tex files on this (old) page don’t compile anymore either, and when using Renderer=OpenType, do not show the ligatures and swashes it used to. So, something has been lost/is not backward compatible, apparently.

Addendum 3 This related post doesn’t seem to help either.


Get this bounty!!!

#StackBounty: #terminal #fonts #xorg #unicode #true-type-fonts Different line spacing depending on font encoding

Bounty: 50

Historically, I’ve been using Monotype Courier New as my XTerm font (it displays well both Cyrillic characters and box-drawing characters). When migrating from legacy KOI8-R to UTF-8 locale, I’ve noticed a change in the inter-line spacing (or leading), which made Courier New no longer suitable for terminals.

Here’s how my XTerm used to look in ru_RU.KOI8-R locale (12pt Courier New):

enter image description here

Here’s how it looks now (ru_RU.UTF-8, 12pt again, character width is the same, but note the increased leading, vertical box-drawing charaters form a double “dashed” line):

enter image description here

Apparently, XTerm is not the only application affected. Basically, all programs using Core X11 Fonts exhibit the same behaviour. Take a look at xfontsel displaying different encodings of the same font:

KOI8-R:

enter image description here

ISO 10646-1 (which stands for Unicode):

enter image description here

Interestingly, Courier New seems to be the only monospaced font affected. Other fonts, like -misc-freemono-*, have the same leading regardless of the encoding.

Now, the question:

Is there any way I can enforce the particular leading for a particular font? Should I look into the FreeType library? Or Xft? Any ideas are appreciated.


Get this bounty!!!

#StackBounty: #fonts #spacing #luatex How to apply a LuaLaTeX function to only a specific font?

Bounty: 50

In the italic font I am using, the apostrophe appears too far right in its bounding box, and therefore a space between an apostrophe and a glyph appears smaller than a space between two glyphs. I adapted code from Kerning against word space in LuaTeX in order to increase this space. However, the code applies to all fonts used in the document, but I want it to apply to only the italic font. Is there a way to do this?

Current output:

The same sentence typeset in roman and italic, with extra space after the apostrophes

Desired output:

The same sentence typeset in roman and italic, with only the italic version having extra space after the apostrophes

(the spaces have been exaggerated for purposes of demonstration)

MWE:

documentclass{article}
usepackage{fontspec}
directlua{
  function kernspace(head)
    for space in node.traverse_id(node.id('glue'), head) do
      if space.subtype == 13 then
        local prev = node.prev(space)
        local next = node.next(space)
        if prev.id == 29 and next.id == 29 then
          if prev.char == 8217 then
            space.width = space.width + 1000000
          end
        end
      end
    end
    return true
  end
  luatexbase.add_to_callback("pre_linebreak_filter", kernspace, "kernspace");
}
setmainfont{times.ttf}[
  ItalicFont = timesi.ttf
]
begin{document}
`It's time to rock 'n' roll,' he said. par
textit{`It's time to rock 'n' roll,' he said.}
end{document}


Get this bounty!!!