Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8248468: java/awt/font/DefaultFontTest/DefaultFontTest.java fails in …
…SunFontManager.findFont2D

Reviewed-by: jdv
  • Loading branch information
MBaesken committed Jun 29, 2020
1 parent af51a73 commit f23c983a46d03a33b82e8ed650db86aafc8b6e6e
Showing with 7 additions and 2 deletions.
  1. +4 −0 src/java.desktop/share/classes/sun/font/SunFontManager.java
  2. +3 −2 src/java.desktop/unix/classes/sun/awt/FcFontManager.java
@@ -353,6 +353,9 @@ public Void run() {

String[] fontInfo = getDefaultPlatformFont();
defaultFontName = fontInfo[0];
if (defaultFontName == null && FontUtilities.debugFonts()) {
FontUtilities.getLogger().warning("defaultFontName is null");
}
defaultFontFileName = fontInfo[1];

String extraFontPath = fontConfig.getExtraFontPath();
@@ -1888,6 +1891,7 @@ private Font2D findFontFromPlatform(String lcName, int style) {
* may be able to emulate the required style.
*/
public Font2D findFont2D(String name, int style, int fallback) {
if (name == null) return null;
String lowerCaseName = name.toLowerCase(Locale.ENGLISH);
String mapName = lowerCaseName + dotStyleStr(style);

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,8 @@ protected String[] getDefaultPlatformFont() {
*/
if (info[0] == null) {
if (fontConfigFonts != null && fontConfigFonts.length > 0 &&
fontConfigFonts[0].firstFont.fontFile != null) {
fontConfigFonts[0].firstFont.fontFile != null &&
fontConfigFonts[0].firstFont.fullName != null) {
info[0] = fontConfigFonts[0].firstFont.fullName;
info[1] = fontConfigFonts[0].firstFont.fontFile;
} else {

0 comments on commit f23c983

Please sign in to comment.