Skip to content

Conversation

Copy link
Contributor

Copilot AI commented May 21, 2025

Problem

When using emoji characters like 👍 in markdown documents, DocFX failed to embed the necessary fonts in the generated PDF files. This resulted in "T3_font" appearing in Adobe Acrobat reader's property page, and these characters displaying incorrectly depending on the environment.

Solution

This PR modifies the PDF generation process to properly handle emoji characters by:

  1. Automatically detecting and using emoji fonts if available on the system:

    • Standard locations on Linux (Ubuntu, etc.)
    • macOS system emoji font and user-installed fonts
    • Windows with Noto Color Emoji installed
  2. Adding an environment variable (DOCFX_PDF_EMOJI_FONT) to specify a custom emoji font path:

    DOCFX_PDF_EMOJI_FONT=/path/to/NotoColorEmoji.ttf docfx ...
    
  3. Adding diagnostic info to the PDF metadata to identify which emoji font was used

This change ensures that emoji characters are properly rendered in generated PDFs across different operating systems without requiring manual intervention.

Fixes #10484.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.fwupd.org
    • Triggering command: /usr/bin/fwupdmgr refresh (dns block)
  • crl3.digicert.com
    • Triggering command: dotnet build (dns block)
  • crl4.digicert.com
    • Triggering command: dotnet build (dns block)
  • dot.net
    • Triggering command: wget REDACTED -O dotnet-install.sh (dns block)
  • download.visualstudio.microsoft.com
    • Triggering command: wget REDACTED -O dotnet-sdk.tar.gz (dns block)
  • ocsp.digicert.com
    • Triggering command: dotnet build (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • s.symcb.com
    • Triggering command: dotnet build (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • s.symcd.com
    • Triggering command: dotnet build (dns block)
  • ts-crl.ws.symantec.com
    • Triggering command: dotnet build (dns block)
  • ts-ocsp.ws.symantec.com
    • Triggering command: dotnet build (dns block)
  • www.microsoft.com
    • Triggering command: dotnet build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits May 21, 2025 09:35
Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com>
Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com>
Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com>
Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com>
Copilot AI changed the title [WIP] [Bug] When using 👍 emoji icon. docfx failed to embed relating font. Fix emoji font embedding in PDF generation May 21, 2025
Copilot AI requested a review from yufeih May 21, 2025 09:40
Copilot finished work on behalf of yufeih May 21, 2025 09:40
@yufeih
Copy link
Contributor

yufeih commented May 27, 2025

@copilot revert all ur existing changes, install fonts-noto-color-emoji in github action linux env

Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 27, 2025

@copilot revert all ur existing changes, install fonts-noto-color-emoji in github action linux env

I've reverted all the code changes and updated the CI workflows to install fonts-noto-color-emoji package in the Linux environment. Changes include:

  1. Added package installation to the build action for all Linux runners
  2. Added package installation to the snapshot workflow
  3. Completely removed the custom emoji font detection code from PdfBuilder.cs

The changes are in commit 12fb85b.

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

Successfully merging this pull request may close these issues.

[Bug] When using 👍 emoji icon. docfx failed to embed relating font.

2 participants