[uom] Add Celsius, Fahrenheit and other UoM single glyph aliases (#5640)

* fix celsius symbol

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* keep two character symbols as main, and use single character symbols as aliase

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* restore prior comment

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

* add other suggested glyphs

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

---------

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green
2026-06-14 22:05:13 +02:00
committed by GitHub
parent c6be254433
commit 053fcdcfc8
3 changed files with 15 additions and 0 deletions
@@ -117,6 +117,9 @@ public final class ImperialUnits extends CustomUnits {
SimpleUnitFormat.getInstance().label(GALLON_PER_MINUTE, "gal/min");
SimpleUnitFormat.getInstance().label(POUND_FORCE_SQUARE_INCH, POUND_FORCE_SQUARE_INCH.getSymbol());
SimpleUnitFormat.getInstance().label(GRAIN, GRAIN.getSymbol());
// Add the single character ℉ glyph as an alias to improve support of East Asian languages
SimpleUnitFormat.getInstance().alias(FAHRENHEIT, "");
}
private ImperialUnits() {
@@ -52,6 +52,15 @@ public final class SIUnits extends CustomUnits {
static {
// Override the default unit symbol ℃ to better support TTS and UIs:
SimpleUnitFormat.getInstance().label(CELSIUS, "°C");
// Add some single character glyphs as aliases to improve support of East Asian languages
SimpleUnitFormat.getInstance().alias(CELSIUS, "");
SimpleUnitFormat.getInstance().alias(METRE.multiply(0.001), "");
SimpleUnitFormat.getInstance().alias(METRE.multiply(0.01), "");
SimpleUnitFormat.getInstance().alias(METRE.multiply(1000), "");
SimpleUnitFormat.getInstance().alias(KILOGRAM, "");
SimpleUnitFormat.getInstance().alias(SQUARE_METRE, "");
SimpleUnitFormat.getInstance().alias(CUBIC_METRE, "");
}
private SIUnits() {
@@ -355,6 +355,9 @@ public final class Units extends CustomUnits {
SimpleUnitFormat.getInstance().alias(MONTH, "mo");
SimpleUnitFormat.getInstance().alias(WEEK, "wk");
SimpleUnitFormat.getInstance().alias(YEAR, "y");
// Add the single character ㏈ glyph as an alias to improve support of East Asian languages
SimpleUnitFormat.getInstance().alias(DECIBEL, "");
}
private Units() {