You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix: Allow chinese symbols in (AWT) tray menu - #4384
Supersedes #4381. Description copied from there and adjusted. Initial fix/contribution made by @Red51531.
Summary
Chinese text in the Windows tray menu renders as squares. OpenJDK's Windows fontconfig defines sequence.allfonts.UTF-8.{hi,ja,ko} but no UTF-8.zh. With file.encoding=UTF-8, WFontConfiguration finds no GB2312_CHARSET component font for the AWT PopupMenu and falls back to Arial,ANSI_CHARSET. Korean has its own UTF-8.ko entry, which likely explains why it could not be reproduced with a Korean locale in #1474.
This PR generates runtime/lib/fontconfig.properties from the bundled .src after jlink, adding UTF-8.zh (+ zh.TW, zh.HK). FontConfiguration.findImpl() loads .properties before .bfc. file.encoding stays UTF-8, so no WinFsp/FUSE side effects. The build fails if any allfonts.UTF-8.zh* entry exists, so a future JDK change cannot silently drop the patch.
Addresses #1474 (tray menu shows squares for Chinese on Windows).
**Cause:** OpenJDK's Windows fontconfig defines `sequence.allfonts.UTF-8.{hi,ja,ko}` but no `UTF-8.zh`. With `file.encoding=UTF-8`, `WFontConfiguration` finds no `GB2312_CHARSET` component font for the AWT `PopupMenu` and falls back to `Arial,ANSI_CHARSET`, so Chinese renders as squares. Korean has its own `UTF-8.ko` entry, which likely explains why it could not be reproduced with a Korean locale.
**Change:** after jlink, generate `runtime/lib/fontconfig.properties` from the bundled `.src`, adding `UTF-8.zh` (+ `zh.TW`, `zh.HK`). `FontConfiguration.findImpl()` loads `.properties` before `.bfc`. `file.encoding` stays UTF-8, so no WinFsp/FUSE side effects. The build fails if the anchor line is missing, so a future JDK change cannot silently drop the patch.
**Tested:** Windows 11 (zh-CN), Cryptomator 1.19.6-msi-6588. The file produced by this script, loaded via `-Dsun.awt.fontconfig`, fixes the tray menu; an equivalent patch was also verified on a second machine. I did not build the installer locally. zh_TW / zh_HK are untested.
This may be superseded by the native tray work (@purejava's Shell_NotifyIconW POC); it is meant as a low-risk interim fix.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Packaged Windows runtime validation is still needed because testing used an explicit fontconfig override on zh-CN, leaving automatic font discovery and installer tray rendering across zh-CN, zh-TW, and zh-HK unverified.
No open issues 🎉
What changed in this PR
This PR addresses Chinese text rendering as squares in the Windows AWT tray menu by patching the bundled runtime’s font configuration without changing UTF-8 encoding.
Changes:
Generate fontconfig.properties with UTF-8 sequences for Chinese, Taiwan, and Hong Kong locales.
Fail the build if any of the three target sequences already exists, prompting reassessment of the workaround.
Apply the patch after runtime creation and before packaging in both Windows build paths.
File
Description
dist/win/build.ps1
Invoke the font configuration helper during local Windows builds.
dist/win/AddChineseFontConfigSequences.java
Generate the patched configuration and check for existing target sequences.
.github/workflows/win-exe.yml
Apply the font configuration patch before CI packaging.
The build-msi job runs AddChineseFontConfigSequences.java against runtime after removing distrusted CA certificates. This adds missing UTF-8.zh font sequences to the generated Windows runtime.
No concrete merge-blocking risk is established by the current review.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title names the main change: Chinese symbols in the AWT tray menu are fixed. The changeset adds the missing UTF-8.zh font sequences to the Windows runtime build, which addresses that rendering bug…
Description check
The description states the problem (Chinese text in the Windows tray menu renders as squares) and the cause (missing UTF-8.zh fontconfig sequences). It also describes the fix: generating runtime/lib/f…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: Chinese symbols in the AWT tray menu are fixed. The changeset adds the missing UTF-8.zh font sequences to the Windows runtime build, which addresses that rendering bug. The title is specific and matches the objectives, though it does not mention the build-time mechanism.
Full details: Description check
Explanation
The description states the problem (Chinese text in the Windows tray menu renders as squares) and the cause (missing UTF-8.zh fontconfig sequences). It also describes the fix: generating runtime/lib/fontconfig.properties after jlink with UTF-8.zh entries. This matches the workflow change and the objectives.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
.github/workflows/win-exe.yml-183-183: 1
183-183: Minor · Stability & Availability · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Quote the JAVA_HOME executable path.
This workflow runs run steps with Bash. (raw.githubusercontent.com) The unquoted expansion can undergo word splitting or pathname expansion. (gnu.org) A Java path containing whitespace or glob characters can prevent the MSI build step from starting Java. Use "${JAVA_HOME}/bin/java" here, and apply the same fix to the preceding invocation.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 9c3f38b4-a4ea-4ac2-a453-caabfab05cb4
Commits
Reviewing files that changed from the base of the PR and between 88c7a79 and 84d391b.
Files ignored due to path filters: 2
dist/win/AddChineseFontConfigSequences.java is excluded by !**/dist/**
dist/win/build.ps1 is excluded by !**/dist/**
Files selected for processing: 1
.github/workflows/win-exe.yml
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #4381. Description copied from there and adjusted. Initial fix/contribution made by @Red51531.
Summary
Chinese text in the Windows tray menu renders as squares. OpenJDK's Windows fontconfig defines
sequence.allfonts.UTF-8.{hi,ja,ko}but noUTF-8.zh. Withfile.encoding=UTF-8,WFontConfigurationfinds noGB2312_CHARSETcomponent font for the AWTPopupMenuand falls back toArial,ANSI_CHARSET. Korean has its ownUTF-8.koentry, which likely explains why it could not be reproduced with a Korean locale in #1474.This PR generates
runtime/lib/fontconfig.propertiesfrom the bundled.srcafter jlink, addingUTF-8.zh(+zh.TW,zh.HK).FontConfiguration.findImpl()loads.propertiesbefore.bfc.file.encodingstays UTF-8, so no WinFsp/FUSE side effects. The build fails if anyallfonts.UTF-8.zh*entry exists, so a future JDK change cannot silently drop the patch.Related Issues
Closes #1474