Description: On Ubuntu I installed ttf-mscorefonts-installer and all M$ ruetype fonts are working in Writer, Calc. Documents from M$ Word works nicely. But when I open PDF with M$ fonts DRAW destroys PDF layout because fonts are not recognized and wrong fonts are used for substitution. For example "TimesNewRomanPS", "TimesNewRoman" are not recognized. When I select text area box with wrong layout I see in Properties -> Character: "The current font name is not available and will be substituted." When I manually change font types of all those "text areas" to "Times New Roman" which is available in Draw (after I installed M$ fonts) layout of that PDF is fixed and I can get PDF from which was possible only on Windows. I was not able to find any solution for this problem online. Please help or direct me into source code where decisions about fonts are being made and I can try to fix it. Steps to Reproduce: 1. Download pdf file https://www.dropbox.com/s/bv8owu5k2zy1vik/File258301.pdf?dl=0 2. Open file using LibreOffice Draw: 3. See that layout of some text boxes is wonrg (they are one over another) Actual Results: "TimesNewRomanPS", "TimesNewRoman" are not recognized. When I select text area box with wrong layout I see in Properties -> Character: "The current font name is not available and will be substituted." Expected Results: "TimesNewRomanPS" - I don't know what that "PS" is. I know nothing about fonts. But When I changed it into "Times New Roman" layout was nice, so to recognize it as "Times New Roman" would provide working solution for me. "TimesNewRoman" - Recognized as "Times New Roman" Reproducible: Always User Profile Reset: No Additional Info: Version: 6.4.6.2 Build ID: 1:6.4.6-0ubuntu0.20.04.1 CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: kf5; Locale: en-US (C); UI-Language: en-US Calc: threaded
This is expected when the Draw filter import of PDF reads out the font names as recorded. It does not occur when the PDF is inserted--different filter, that just reads the layout of the PDF and renders to image. But a simple to work around when filter importing to Draw if there is a font with close metrics actually installed on the system. Obviously the font you need is in MS Core Fonts (ttf-mscorefonts) as "Times New Roman". Just use the Tools -> Options -> Fonts replacement table to assign an existing font for the fontname as recorded in the PDF and listed in the Properties deck for a text selection. I.e. for a PDF text run listing "TimesNewRoman" that is not available on system and so shows in italics just substitute "Times New Roman" with is with the MS Core Fonts. Likewise for "TimesNewRomanPS". Alternatively the Liberation Serif fonts should closely match metrics, and you can use those as replacement as well.
> This is expected What exactly you mean with "this is expected". Which part of my description do you refer to? Is it really expected that when you have M$ fonts installed ad you open PDF created on Windows with M$ products with LibreOffice on GNU/Linux it will show you document with completely distorted layout, when you decide to invest your time, you try to check what is going on, you find out that "TimesNewRomanPS" and "TimesNewRoman" is not recognized, you don't know which font was used instead of unrecognized "TimesNewRomanPS" but it completely destroyed document layout. When you manually change to "TimesNewRoman" then document layout is correct. Is this behavior expected? From my point of view it's sabotage behavior. There is just tine little effort to make it work better and the impact will be huge. I'm sorry that I made my statements provoking but I really like opensource and want best for it. > It does not occur when the PDF is inserted--different filter, > that just reads the layout of the PDF and renders to image. When does this "PDF insert" happens? Please give me example. I'm just light LibreOffice user and therefore you have to imagine my user point of view before you try to explain it. > But a simple to work around when filter importing to Draw if there is a font > with close metrics actually installed on the system. Obviously the font > you need is in MS Core Fonts (ttf-mscorefonts) as "Times New Roman". Yes, I know this and written about that in my description, but for some reason availability of "Times New Roman" is not enough for LibreOffice. From my novice / unexperienced user point of view, that "TimesNewRoman" without white spaces is some kind of trick used to make LibreOffice unusable for basic users. Because office managers don't use LibreOffice Draw to fill PDFs because e.g., "LibreOffice Draw destroys layout of PDF even my son installed M$ fonts on my system, so I won't use that Draw". > Just use the Tools -> Options -> Fonts replacement table to assign an > existing font for the fontname as recorded in the PDF and listed in the > Properties deck for a text selection. Thanks, this helped me to solve the issue. But I tried to use it also yesterday and it was not working because in order to be able to add font transform ("FontA"-> "FontB") you have to check "Apply replacement table" what makes no sense to me. I would expaect to be able to add font replacement rules without applying them. Yesterday I thought that it doesn't want to add "TimesNewRomanPS" -> "Times New Roman" because that "TimesNewRomanPS" is not in available fonts list. After I applied those font transformations layout of PDF was again wrong (in different way). After I closed LibbreOffice draw and opened again then the PDF seemed as it seems on Windows. Thanks a lot. > Alternatively the Liberation Serif fonts should closely match metrics, and > you can use those as replacement as well. Thanks for good tip, I notice it down but think you should made it part of LibreOffice logic, that when M$ fonts are not available let's use something what matches with metrics. Because currently behavior is really bad even you have M$ fonts. That 2 font rules to transform: "TimesNewRomanPS" -> "Times New Roman" "TimesNewRoman" -> "Times New Roman" made LibreOffice Draw completely new product for me. Now it can be used. Let's make something with this, because it was so simple and it will bring thousands of new basics user to LibreOffice. I can provide more details but I can't afford to loose my time here if no one from LibreOffice dev community views this as possible improvement with huge impact. I'm sorry that this is negative. But I thank you very much, all LibreOffice developers for your work for community.
No, this is not a bug. LibreOffice (or any PDF processor) is at the mercy of the PDF generator as to the names of the font's used in the PDF. When the PDF contains derived names, as most do, a fallback occurs if the operating system can not match the fontname. The operating system will handle fontname resolution and fallback when unidentified. LibreOffice can bypass that fallback by use of the Fonts... replacement table dialog to exactly specify the replacement. Identifying the fallback font is a requirement, see bug 61134 or its meta bug 103342 And consider, LibreOffice is not a PDF editor. Should export of document back to PDF be done--the fontnames of the original PDF will be replaced with something different.