< prev index next >

src/java.desktop/share/classes/sun/awt/FontDescriptor.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1996, 2017, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1996, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 40,57 **** String nativeName; public CharsetEncoder encoder; String charsetName; private int[] exclusionRanges; public FontDescriptor(String nativeName, CharsetEncoder encoder, ! int[] exclusionRanges){ this.nativeName = nativeName; this.encoder = encoder; this.exclusionRanges = exclusionRanges; this.useUnicode = false; Charset cs = encoder.charset(); // The following looks odd but its the only public way to get the // historical name if one exists and the canonical name otherwise. try { OutputStreamWriter osw = new OutputStreamWriter(new ByteArrayOutputStream(), cs); --- 40,64 ---- String nativeName; public CharsetEncoder encoder; String charsetName; private int[] exclusionRanges; + private final boolean defaultFont; public FontDescriptor(String nativeName, CharsetEncoder encoder, ! int[] exclusionRanges) { ! this(nativeName, encoder, exclusionRanges, false); ! } ! ! public FontDescriptor(String nativeName, CharsetEncoder encoder, ! int[] exclusionRanges, boolean defaultFont) { this.nativeName = nativeName; this.encoder = encoder; this.exclusionRanges = exclusionRanges; this.useUnicode = false; + this.defaultFont = defaultFont; Charset cs = encoder.charset(); // The following looks odd but its the only public way to get the // historical name if one exists and the canonical name otherwise. try { OutputStreamWriter osw = new OutputStreamWriter(new ByteArrayOutputStream(), cs);
*** 121,126 **** --- 128,137 ---- String enc = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction("sun.io.unicode.encoding", "UnicodeBig")); isLE = !"UnicodeBig".equals(enc); } + + public boolean isDefaultFont() { + return defaultFont; + } }
< prev index next >