/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class FontFamily {
protected boolean logicalFont = false;
protected int familyRank;
}
return null;
}
/* Only for use by FontManager.deRegisterBadFont(..).
* If this was the only font in the family, the family is removed
* from the map
*/
return;
}
}
}
}
}
}
}
familyName = name;
familyRank = rank;
}
/* Create a family for created fonts which aren't listed in the
* main map.
*/
logicalFont = false;
familyName = name;
}
return familyName;
}
public int getRank() {
return familyRank;
}
if (FontUtilities.isLogging()) {
" to family " + this +
" of rank " + familyRank);
}
return;
}
switch (style) {
break;
break;
break;
bolditalic = font;
break;
default:
break;
}
}
switch (style) {
return plain;
return bold;
return italic;
return bolditalic;
default:
return null;
}
}
/* REMIND: if the callers of this method are operating in an
* environment in which not all fonts are registered, the returned
* font may be a algorithmically styled one, where in fact if loadfonts
* were executed, a styled font may be located. Our present "solution"
* to this is to register all fonts in a directory and assume that this
* registered all the styles of a font, since they would all be in the
* same location.
*/
switch (style) {
return plain;
return bold;
return plain;
} else {
return null;
}
return italic;
return plain;
} else {
return null;
}
if (bolditalic != null) {
return bolditalic;
return italic;
return italic;
return plain;
} else {
return null;
}
default:
return null;
}
}
/* Only to be called if getFont(style) returns null
* This method will only return null if the family is completely empty!
* Note that it assumes the font of the style you need isn't in the
* family. The logic here is that if we must substitute something
* it might as well be from the same family.
*/
switch (style) {
/* if you ask for a plain font try to return a non-italic one,
* then a italic one, finally a bold italic one */
return bold;
return italic;
} else {
return bolditalic;
}
/* if you ask for a bold font try to return a non-italic one,
* then a bold italic one, finally an italic one */
return plain;
} else if (bolditalic != null) {
return bolditalic;
} else {
return italic;
}
/* if you ask for a italic font try to return a bold italic one,
* then a plain one, finally an bold one */
if (bolditalic != null) {
return bolditalic;
return plain;
} else {
return bold;
}
return italic;
return bold;
} else {
return plain;
}
}
return null;
}
/* Font may have localized names. Store these in a separate map, so
* that only clients who use these names need be affected.
*/
if (allLocaleNames == null) {
}
}
}
if (allLocaleNames == null) {
return null;
}
}
return
"Font family: " + familyName +
" plain="+plain+
" bold=" + bold +
" italic=" + italic +
" bolditalic=" + bolditalic;
}
}