Characters in italic missing in HTML output (Linux, Docker)

Hi,

we noticed some characters are missing in HTML output which are in italic style. Scenario happens in Linux / Docker.

Reproducable with the following setup:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Aspose.Words" Version="25.9.0" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
    <PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.0" />
  </ItemGroup>

</Project>
// See https://aka.ms/new-console-template for more information
using Aspose.Words;
using Aspose.Words.Saving;

var lic = new License();
lic.SetLicense(@"./data/Aspose.Total.NET.lic");

var externalFontSource = new Aspose.Words.Fonts.FolderFontSource(@"./fonts/", true);
var systemFontSource =
    new Aspose.Words.Fonts.FolderFontSource(Environment.GetFolderPath(Environment.SpecialFolder.Fonts),
        true);

// Sammeln der Font-Quellen
var fontSources =
    new List<Aspose.Words.Fonts.FontSourceBase>(Aspose.Words.Fonts.FontSettings.DefaultInstance
        .GetFontsSources())
    {
                    // Hinzufügen der eigenen Font-Quellen
                    externalFontSource,
                    systemFontSource
    };

// Anwenden der neuen Font-Einstellungen
Aspose.Words.Fonts.FontSettings.DefaultInstance.SetFontsSources(fontSources.ToArray());

var doc = new Document(@"./data/in.docx");

var htmlOptions = new HtmlFixedSaveOptions();

htmlOptions.CssClassNamesPrefix = "cs-words";
htmlOptions.ExportEmbeddedCss = true;
htmlOptions.ExportEmbeddedFonts = true;
htmlOptions.ExportEmbeddedImages = true;
htmlOptions.ExportEmbeddedSvg = true;
htmlOptions.SaveFormat = SaveFormat.HtmlFixed;
htmlOptions.UseAntiAliasing = true;

// IMS-16349 Workaround; fixed with WORDSNET-23460 / WORDSNET-26109 through IMS-29035
// htmlOptions.MetafileRenderingOptions.RenderingMode = MetafileRenderingMode.Bitmap;

using (var stream = new FileStream(@"./data/out.html", FileMode.Create))
{
    doc.Save(stream, htmlOptions);
}

Console.WriteLine("FINISH");
# Unter https://aka.ms/customizecontainer erfahren Sie, wie Sie Ihren Debugcontainer anpassen und wie Visual Studio dieses Dockerfile verwendet, um Ihre Images für ein schnelleres Debuggen zu erstellen.

# Diese Stufe wird verwendet, wenn sie von VS im Schnellmodus ausgeführt wird (Standardeinstellung für Debugkonfiguration).
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
WORKDIR /app


# Diese Stufe wird zum Erstellen des Dienstprojekts verwendet.
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["ConsoleApp2/ConsoleApp2.csproj", "ConsoleApp2/"]
RUN dotnet restore "./ConsoleApp2/ConsoleApp2.csproj"
COPY . .
WORKDIR "/src/ConsoleApp2"
RUN dotnet build "./ConsoleApp2.csproj" -c $BUILD_CONFIGURATION -o /app/build

# Diese Stufe wird verwendet, um das Dienstprojekt zu veröffentlichen, das in die letzte Phase kopiert werden soll.
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./ConsoleApp2.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

# Diese Stufe wird in der Produktion oder bei Ausführung von VS im regulären Modus verwendet (Standard, wenn die Debugkonfiguration nicht verwendet wird).
FROM base AS final
WORKDIR /app

#Include contrib archive to install windows fonts. Must run before package update
RUN sed -i 's/^Components: main$/& contrib/' /etc/apt/sources.list.d/debian.sources

#Installs "windows fonts"
RUN apt-get update && apt-get install -y ttf-mscorefonts-installer fontconfig

#SkiaSharp dependency of Aspose requires libfontconfig1. See Aspose documentation for this. 
RUN apt-get update && apt-get install -y libfontconfig1

#ICU for Culture Information
RUN apt-get update && apt-get install -y libicu-dev 

USER $APP_UID

COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ConsoleApp2.dll"]

Run command:
docker run --rm -it -v C:\Fonts:/app/fonts -v D:\tmp:/app/data consoleapp2:latest

Fonts folder is a copy of WIndows Server Fonts folder + few customer speicfic fonts.

Test files (i inlcuded my output):
example.zip (363.2 KB)

You can see there are missing symbols on Page 3

Our customer mentioned they have that same behaviour in multiple documents with italic fonts and that we can hand out that one document as sample but has to be deleted after analysis / fixing.

Thanks for oyur help.

@Serraniel Font Frutiger LT 45 Light used in your document is not available on my side. Could you please attach this font here for testing? We will check the issue and provide you more information.

Hi,

these should be the fonts missing.
FrutigerLTStd-Bold.zip (82.7 KB)

@Serraniel
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-28641

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@Serraniel We have completed the issue analysis. The document uses bold italic Frutiger LT Std 45 Light font but there is no OTF file for this font style and Aspose.Words uses glyphs from the bold OTF instead. These glyphs are collected into a subset but during export the subset is incorrectly marked as font-style:normal; font-weight:bold (no italic), because these styles are taken from the bold OTF file. In order to fix the bug, Aspose.Words should mark font subsets using the requested font style instead of the font style from the substituted OTF file.

We’ll fix this bug so that characters will no longer disappear. However, unless you add bold italic OTF file into the font folder, the bold italic text will be rendered as just bold after the fix. We think the easiest and the most appropriate way to work around this whole bug is to add bold italic OTF into the font folder. Here is the file that we found on the Internet:
FrutigerLTStd-BoldItalic.zip (20.2 KB)