Comments (5)
Debugging:
It doesn't matter if you ask Java for "", "SansSerif" or null: You get a java.awt.Font with the internal font2DHandle pointing to a CompositeFont with interesting attributes:
componentNames = ["Arial", "Wingdings", "Symbol", "Segoe UI Symbol", "Segoe UI Emoji", +23 more]
...
And: exclusionRanges = [1792, 7423, 7552, 7839, 7936, 8215, 8224, 8363, 8365, 8376, 8379, 8380, 8382, 9471, 9473, 9473, 9475, 9483, 9485, 9487, 9489, 9491, 9493, 9495, 9497, 9499, 9501, 9507, 9509, 9515, 9517, 9523, 9525, 9531, 9533, 9551, 9581, 63743, 13, 34, 36, 41, 43, 47, 58, 168, 170, 173, 175, 732, 8194, 8195, 8197, 8197, 8205, 8205, 8211, 8212, 8216, 8218, 8220, 8222, 8224, 8226, 8230, 8230, 8240, 8240, 8249, 8250, 8260, 8260, 8364, 8364, 8419, 8419, 8486, 8486, 8592, 8595, 8602, 8616, 8619, 8703, 8710, 8710, 8719, 8719, 8721, 8722, 8729, 8730, 8734, 8734, 8747, 8747, 8776, 8776, 8800, 8800, +182 more]
- and 8734 is the infinity symbol!
So someone at Java decided to exclude it! đ They go out of their way to combine elements from different system fonts, only to give you something with worse Unicode support than the individual system fonts themselves. đ§ đ„Ł đ§
from unciv.
Confirmed - Problem does not exist on Mint 21.
Another possible patch:
(force-redirect default to Segoe UI)
Index: desktop/src/com/unciv/app/desktop/UncivWindowListener.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/desktop/src/com/unciv/app/desktop/UncivWindowListener.kt b/desktop/src/com/unciv/app/desktop/UncivWindowListener.kt
--- a/desktop/src/com/unciv/app/desktop/UncivWindowListener.kt (revision 4503e724006690a334ef01f351c61948f1efa8ac)
+++ b/desktop/src/com/unciv/app/desktop/UncivWindowListener.kt (date 1709641530970)
@@ -80,7 +80,7 @@
* (which, by the way, says "Incomplete implementation to support demos.")
*/
val user32: User32? = try {
- if (System.getProperty("os.name")?.contains("Windows") == true) {
+ if (SystemUtils.isWindows()) {
Native.load(User32::class.java)
} else {
null
Index: desktop/src/com/unciv/app/desktop/SystemUtils.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/desktop/src/com/unciv/app/desktop/SystemUtils.kt b/desktop/src/com/unciv/app/desktop/SystemUtils.kt
--- a/desktop/src/com/unciv/app/desktop/SystemUtils.kt (revision 4503e724006690a334ef01f351c61948f1efa8ac)
+++ b/desktop/src/com/unciv/app/desktop/SystemUtils.kt (date 1709642097609)
@@ -5,12 +5,18 @@
object SystemUtils {
+ /** Detects if we're running on Windows via Java's os.name */
+ // Note com.badlogic.gdx.utils.SharedLibraryLoader.isWindows basically does the same
+ // but seeing as it fails isLinux on FreeBSD - cheap enough to do it again.
+ fun isWindows() = System.getProperty("os.name")?.isWindows() == true
+ private fun String.isWindows() = startsWith("Windows", ignoreCase = true)
+
fun getSystemInfo(): String {
val builder = StringBuilder()
// Operating system
val osName = System.getProperty("os.name") ?: "Unknown"
- val isWindows = osName.startsWith("Windows", ignoreCase = true)
+ val isWindows = osName.isWindows()
builder.append("OS: $osName")
if (!isWindows) {
val osInfo = listOfNotNull(System.getProperty("os.arch"), System.getProperty("os.version")).joinToString()
Index: desktop/src/com/unciv/app/desktop/DesktopFont.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/desktop/src/com/unciv/app/desktop/DesktopFont.kt b/desktop/src/com/unciv/app/desktop/DesktopFont.kt
--- a/desktop/src/com/unciv/app/desktop/DesktopFont.kt (revision 4503e724006690a334ef01f351c61948f1efa8ac)
+++ b/desktop/src/com/unciv/app/desktop/DesktopFont.kt (date 1709650568626)
@@ -30,7 +30,10 @@
// System font
else
{
- this.font = Font(fontFamilyData.invariantName, Font.PLAIN, size)
+ this.font = Font(fontFamilyData.invariantName.ifBlank {
+ // Java's default manages to give you a CompositeFont omitting the infinity symbol
+ if (SystemUtils.isWindows()) "Segoe UI" else null
+ }, Font.PLAIN, size)
}
val bufferedImage = BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR)
... but since I have no info on who else is affected, no PR.
from unciv.
Adding another custom emoji for infinity sounds a lot less error prone than forcing fonts, especially since user can change the font manually
from unciv.
It also won't break if Windows 14 decides to ship without this font
from unciv.
Adding another custom emoji for infinity
Well a patch for that is in #11257, although one should edit that image and push down the baseline before actually using. The gimp to do that before scaling losses is there too.
But - if no-one else complains, I'd say ignore, as it's an upstream bug, not ours.
from unciv.
Related Issues (20)
- Feature request: Button to disband units in overview HOT 6
- FPS cap HOT 7
- Window mode issues HOT 3
- "Hidden from users" not hiding triggerable effect on event notification HOT 4
- When i tap to chek how mi relationship with a country is going, give me an error HOT 3
- Function to disable mods HOT 2
- Promotion crash HOT 3
- Wrong city-state shown in notification log after being destroyed HOT 11
- Automated units and actions HOT 12
- Start new game issues - e.g. Map Type selection sometimes fails HOT 1
- Technology cost discrepancy HOT 5
- éČăăȘă
- RFC: Telling stories - Ideas and related observations HOT 3
- Units without vision cannot be seen when moved into the fog HOT 2
- Game crash on starting new game after deleting mod HOT 20
- Feature request: Put resource point value for worker tile improvement priority in the settings. HOT 1
- Countable scopes approach decision HOT 6
- "Open terrain" goes wrong HOT 2
- Workers don't build roads. HOT 3
- Unable to decide what to do with a city HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â€ïž Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unciv.