Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/native/sun/font/X11FontScaler.h
32287 views
/*1* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef _X11FONTSCALER_H_26#define _X11FONTSCALER_H_2728#include "gdefs.h"2930#ifndef HEADLESS31#include <X11/Xlib.h>32#endif3334#define SHIFTFACTOR 1635#define NO_POINTSIZE -1.03637#ifdef HEADLESS3839typedef struct {40unsigned char byte1;41unsigned char byte2;42} AWTChar2b;4344#define Success 14546#else /* !HEADLESS */4748extern Display *awt_display;49typedef XChar2b AWTChar2b;5051#endif /* !HEADLESS */5253typedef void *AWTChar;54typedef void *AWTFont;5556typedef struct NativeScalerContext {57AWTFont xFont;58int minGlyph;59int maxGlyph;60int numGlyphs;61int defaultGlyph;62int ptSize;63double scale;64} NativeScalerContext;656667/*68* Important note : All AWTxxx functions are defined in font.h.69* These were added to remove the dependency of certain files on X11.70* These functions are used to perform X11 operations and should71* be "stubbed out" in environments that do not support X11.72*/73JNIEXPORT int JNICALL AWTCountFonts(char* xlfd);74JNIEXPORT void JNICALL AWTLoadFont(char* name, AWTFont* pReturn);75JNIEXPORT void JNICALL AWTFreeFont(AWTFont font);76JNIEXPORT unsigned JNICALL AWTFontMinByte1(AWTFont font);77JNIEXPORT unsigned JNICALL AWTFontMaxByte1(AWTFont font);78JNIEXPORT unsigned JNICALL AWTFontMinCharOrByte2(AWTFont font);79JNIEXPORT unsigned JNICALL AWTFontMaxCharOrByte2(AWTFont font);80JNIEXPORT unsigned JNICALL AWTFontDefaultChar(AWTFont font);81/* Do not call AWTFreeChar() after AWTFontPerChar() or AWTFontMaxBounds() */82JNIEXPORT AWTChar JNICALL AWTFontPerChar(AWTFont font, int index);83JNIEXPORT AWTChar JNICALL AWTFontMaxBounds(AWTFont font);84JNIEXPORT int JNICALL AWTFontAscent(AWTFont font);85JNIEXPORT int JNICALL AWTFontDescent(AWTFont font);86/* Call AWTFreeChar() on overall after calling AWTFontQueryTextExtents16() */87JNIEXPORT void JNICALL AWTFontTextExtents16(AWTFont font, AWTChar2b* xChar,88AWTChar* overall);89JNIEXPORT void JNICALL AWTFreeChar(AWTChar xChar);90JNIEXPORT jlong JNICALL AWTFontGenerateImage(AWTFont xFont, AWTChar2b* xChar);91JNIEXPORT short JNICALL AWTCharAdvance(AWTChar xChar);92JNIEXPORT short JNICALL AWTCharLBearing(AWTChar xChar);93JNIEXPORT short JNICALL AWTCharRBearing(AWTChar xChar);94JNIEXPORT short JNICALL AWTCharAscent(AWTChar xChar);95JNIEXPORT short JNICALL AWTCharDescent(AWTChar xChar);9697#endif9899100