Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,20 @@ jobs:
path: ${{ env.REGISTRY_PATH }}/

test:
name: Test
runs-on: ubuntu-latest
name: Test (${{ matrix.platform }})
# Each platform runs on a native runner: under QEMU emulation, patching
# fonts is several times slower and the arm64 tests take more than an hour.
runs-on: ${{ matrix.runner }}
needs: build
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
platform: [linux/amd64, linux/arm64]
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-24.04-arm
env:
DOCKER_CLI_EXPERIMENTAL: enabled
PLATFORM: ${{ matrix.platform }}
Expand All @@ -91,8 +99,6 @@ jobs:
# Enable docker daemon experimental support.
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
# Install QEMU multi-architecture support for docker buildx.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

- name: Start Docker registry
run: |
Expand All @@ -107,8 +113,8 @@ jobs:
- name: Docker inspect
run: docker buildx imagetools inspect ${IMAGE_NAME} | grep '${{ matrix.platform }}'

- name: Install ttx tool
run: sudo apt update -y && sudo apt install -y python3-fonttools fonttools
- name: Install fontTools
run: sudo apt update -y && sudo apt install -y python3-fonttools

- name: Execute tests
env:
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog

The following list only reflects changes made on this project. Please, refer to the [Nerd Fonts 3.4.0 Release Notes](https://www.nerdfonts.com/releases) for the complete list of changes.
The following list only reflects changes made on this project. Please, refer to the [Nerd Fonts 3.5.1 Release Notes](https://www.nerdfonts.com/releases) for the complete list of changes.

**3.5.1**

- Upgrade Nerd Fonts to `3.5.1`
- Improve font comparison in tests
- Change Docker base image to `ubuntu:resolute-20261024.1`
- Fix package names for Ubuntu 26.04 and skip fontforge translations (gettext >= 0.22)
- Build fontforge with `-ffp-contract=off`, so fonts patched on arm64 match the official ones

**3.4.0**

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:noble-20250415.1
FROM ubuntu:resolute-20261024.1

ARG BUILD_DATE
ARG VCS_REF

# https://github.com/ryanoasis/nerd-fonts/releases
ENV NERDFONTS_VERSION="v3.4.0" \
NERDFONTS_SHA256="0387198b376639dc2f5359b52b9edc4861ef7ad48b769fcad045736ad1a27d03"
ENV NERDFONTS_VERSION="v3.5.1" \
NERDFONTS_SHA256="81627f9e1d79c5028e2ac28a011b46dc335e146c6ce9d0c368f28c5c3601955a"
ENV IMAGE_VERSION="${NERDFONTS_VERSION}"

ENV BUILD_DIR="/build" \
Expand All @@ -29,7 +29,7 @@ LABEL org.opencontainers.image.vendor="cdalvaro"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.version="${IMAGE_VERSION}"
LABEL org.opencontainers.image.revision="${VCS_REF}"
LABEL org.opencontainers.image.base.name="ubuntu:noble-20250415.1"
LABEL org.opencontainers.image.base.name="ubuntu:resolute-20261024.1"
LABEL org.opencontainers.image.licenses="MIT"

# Entrypoint
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Architecture AMD64][arch_amd64_badge]][arch_link]
[![Architecture ARM64][arch_arm64_badge]][arch_link]

# Dockerized Nerd Fonts Patcher v3.4.0
# Dockerized Nerd Fonts Patcher v3.5.1

Dockerfile to build a Nerd Fonts Patcher image for the Docker opensource container platform.

Expand Down Expand Up @@ -67,9 +67,9 @@ or from [GitHub Container Registry](https://ghcr.io/cdalvaro/docker-nerd-fonts-p
docker pull ghcr.io/cdalvaro/docker-nerd-fonts-patcher
```

[nerdfonts_badge]: https://img.shields.io/badge/Nerd%20Fonts-v3.4.0-lightgrey.svg
[nerdfonts_release_notes]: https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.4.0 "Nerd Fonts Release Notes"
[ubuntu_badge]: https://img.shields.io/badge/ubuntu-jammy--20240227-E95420.svg?logo=Ubuntu
[nerdfonts_badge]: https://img.shields.io/badge/Nerd%20Fonts-v3.5.1-lightgrey.svg
[nerdfonts_release_notes]: https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.5.1 "Nerd Fonts Release Notes"
[ubuntu_badge]: https://img.shields.io/badge/ubuntu-resolute--20261024.1-E95420.svg?logo=Ubuntu
[ubuntu_hub_docker]: https://hub.docker.com/_/ubuntu/ "Ubuntu Image"
[github_publish_badge]: https://github.com/cdalvaro/docker-nerd-fonts-patcher/actions/workflows/publish.yml/badge.svg
[github_publish_workflow]: https://github.com/cdalvaro/docker-nerd-fonts-patcher/actions/workflows/publish.yml
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.0
3.5.1
11 changes: 11 additions & 0 deletions assets/build/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,19 @@ function install_fontforge() {
check_sha256 "${FILE}" "${SHA256}"
extract "${FILE}" "${EXTRACT_DIR}"

# Do not build translations: they are not needed in a headless container, and
# gettext >= 0.22 rejects some format strings in fontforge 20230101's fr.po.
: > "${EXTRACT_DIR}/po/LINGUAS"

BUILD_OPTS=(
-DENABLE_GUI=OFF
# Do not fuse a*b+c into a single FMA instruction. AArch64 has FMA in its
# base ISA and GCC contracts by default in GNU C mode, which changes the
# last bit of some results and, after rounding coordinates, the outlines of
# scaled glyphs. With contraction off, arm64 matches the official fonts,
# which are built on x86-64 (no FMA in its base ISA).
-DCMAKE_C_FLAGS=-ffp-contract=off
-DCMAKE_CXX_FLAGS=-ffp-contract=off
)

(cd $EXTRACT_DIR && build_and_install "fontforge ${VERSION}" "${BUILD_OPTS[@]}")
Expand Down
8 changes: 4 additions & 4 deletions assets/build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ source "${FUNCTIONS_FILE}"

log_info "Installing required packages and build dependencies ..."
REQUIRED_PACKAGES=(
libpng16-16 zlib1g libjpeg8 libxml2 libspiro1 libgif7 libtiff6 \
libiconv-hook1 libfreetype6 libcairo2 libwoff1 libglib2.0-0 \
libuninameslist1 libreadline8 libpython3.10 python3 unifont \
libpng16-16t64 zlib1g libjpeg8 libxml2-16 libspiro1 libgif7 libtiff6 \
libiconv-hook1 libfreetype6 libcairo2 libwoff1 libglib2.0-0t64 \
libuninameslist1 libreadline8t64 libpython3.14 python3 unifont \
python3-setuptools python3-dev python3-fonttools fonttools
)

BUILD_DEPENDENCIES=(
libjpeg-dev libtiff5-dev libpng-dev libfreetype6-dev libgif-dev \
libjpeg-dev libtiff5-dev libpng-dev libfreetype-dev libgif-dev \
libxml2-dev libpango1.0-dev libcairo2-dev libspiro-dev \
libuninameslist-dev libreadline-dev libwoff-dev ca-certificates \
ninja-build cmake build-essential openssl wget gettext git \
Expand Down
21 changes: 12 additions & 9 deletions tests/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,23 @@ function font_patcher()
--volume "${INPUT_DIR}/":/input \
--volume "${OUTPUT_DIR}/":/output \
--env PUID="$(id -u)" --env PGID="$(id -g)" \
--env SOURCE_DATE_EPOCH \
-- "${IMAGE_NAME}" "$@"
}

#--- FUNCTION -------------------------------------------------------------------------------------------------------
# NAME: get_font_info
# DESCRIPTION: Get font information from the given font file and save it into the specified file.
function get_font_info()
# NAME: font_build_time
# DESCRIPTION: Print the build time of the given font ('head.modified') as a Unix timestamp.
#----------------------------------------------------------------------------------------------------------------------
function font_build_time()
{
local FONT_PATH="${1}"
local INFO_OUTPUT_FILE="${2}"

# Generate a TTX file with font information
ttx -q --recalc-timestamp -o "${INFO_OUTPUT_FILE}" "${FONT_PATH}"

# Remove the following tags from the TTX file:
sed -E -i 's/.*<(checkSumAdjustment|modified|FFTimeStamp|sourceModified).*//g' "${INFO_OUTPUT_FILE}"
# 'head' stores seconds since 1904-01-01; epoch_diff converts them to Unix time
python3 -c '
import sys
from fontTools.misc.timeTools import epoch_diff
from fontTools.ttLib import TTFont
print(TTFont(sys.argv[1])["head"].modified + epoch_diff)
' "${FONT_PATH}"
}
Loading
Loading