0N/A/*
2362N/A * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#ifndef _X11FONTSCALER_H_
0N/A#define _X11FONTSCALER_H_
0N/A
0N/A#include "gdefs.h"
0N/A
0N/A#ifndef HEADLESS
0N/A#include <X11/Xlib.h>
0N/A#endif
0N/A
0N/A#define SHIFTFACTOR 16
0N/A#define NO_POINTSIZE -1.0
0N/A
0N/A#ifdef HEADLESS
0N/A
0N/Atypedef struct {
0N/A unsigned char byte1;
0N/A unsigned char byte2;
0N/A} AWTChar2b;
0N/A
0N/A#define Success 1
0N/A
0N/A#else /* !HEADLESS */
0N/A
0N/Aextern Display *awt_display;
0N/Atypedef XChar2b AWTChar2b;
0N/A
0N/A#endif /* !HEADLESS */
0N/A
0N/Atypedef void *AWTChar;
0N/Atypedef void *AWTFont;
0N/A
0N/Atypedef struct NativeScalerContext {
0N/A AWTFont xFont;
0N/A int minGlyph;
0N/A int maxGlyph;
0N/A int numGlyphs;
0N/A int defaultGlyph;
0N/A int ptSize;
0N/A double scale;
0N/A} NativeScalerContext;
0N/A
0N/A
0N/A/*
0N/A * Important note : All AWTxxx functions are defined in font.h.
0N/A * These were added to remove the dependency of certain files on X11.
0N/A * These functions are used to perform X11 operations and should
0N/A * be "stubbed out" in environments that do not support X11.
0N/A */
0N/AJNIEXPORT int JNICALL AWTCountFonts(char* xlfd);
0N/AJNIEXPORT void JNICALL AWTLoadFont(char* name, AWTFont* pReturn);
0N/AJNIEXPORT void JNICALL AWTFreeFont(AWTFont font);
0N/AJNIEXPORT unsigned JNICALL AWTFontMinByte1(AWTFont font);
0N/AJNIEXPORT unsigned JNICALL AWTFontMaxByte1(AWTFont font);
0N/AJNIEXPORT unsigned JNICALL AWTFontMinCharOrByte2(AWTFont font);
0N/AJNIEXPORT unsigned JNICALL AWTFontMaxCharOrByte2(AWTFont font);
0N/AJNIEXPORT unsigned JNICALL AWTFontDefaultChar(AWTFont font);
0N/A/* Do not call AWTFreeChar() after AWTFontPerChar() or AWTFontMaxBounds() */
0N/AJNIEXPORT AWTChar JNICALL AWTFontPerChar(AWTFont font, int index);
0N/AJNIEXPORT AWTChar JNICALL AWTFontMaxBounds(AWTFont font);
0N/AJNIEXPORT int JNICALL AWTFontAscent(AWTFont font);
0N/AJNIEXPORT int JNICALL AWTFontDescent(AWTFont font);
0N/A/* Call AWTFreeChar() on overall after calling AWTFontQueryTextExtents16() */
0N/AJNIEXPORT void JNICALL AWTFontTextExtents16(AWTFont font, AWTChar2b* xChar,
0N/A AWTChar* overall);
0N/AJNIEXPORT void JNICALL AWTFreeChar(AWTChar xChar);
0N/AJNIEXPORT jlong JNICALL AWTFontGenerateImage(AWTFont xFont, AWTChar2b* xChar);
0N/AJNIEXPORT short JNICALL AWTCharAdvance(AWTChar xChar);
0N/AJNIEXPORT short JNICALL AWTCharLBearing(AWTChar xChar);
0N/AJNIEXPORT short JNICALL AWTCharRBearing(AWTChar xChar);
0N/AJNIEXPORT short JNICALL AWTCharAscent(AWTChar xChar);
0N/AJNIEXPORT short JNICALL AWTCharDescent(AWTChar xChar);
0N/A
0N/A#endif