mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-1850: on macOS fonts should be sorted by weight to ensure proper population of the families
This commit is contained in:
committed by
Vitaly Provodin
parent
2dbce65b75
commit
f3344cf11d
@@ -28,12 +28,8 @@ package sun.font;
|
||||
import java.io.File;
|
||||
import java.awt.Font;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
public class FontFamily {
|
||||
|
||||
@@ -263,6 +259,9 @@ public class FontFamily {
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
if (FontUtilities.isMacOSX) {
|
||||
fontSequence.sort(Comparator.comparing(FontAndStyle::getWeight));
|
||||
}
|
||||
for (FontAndStyle fontAndStyle : fontSequence) {
|
||||
doSetFont(fontAndStyle.font, fontAndStyle.style);
|
||||
}
|
||||
@@ -493,6 +492,10 @@ public class FontFamily {
|
||||
font = inFont;
|
||||
style = inStyle;
|
||||
}
|
||||
|
||||
int getWeight() {
|
||||
return font.getWeight();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user