Path: blob/master/src/java.desktop/share/native/common/font/fontscalerdefs.h
41153 views
/*1* Copyright (c) 2003, 2013, 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 FontScalerDefsIncludesDefined26#define FontScalerDefsIncludesDefined2728#include "AccelGlyphCache.h"2930#ifdef __cplusplus31extern "C" {32#endif3334#ifdef _LP6435typedef unsigned int UInt32;36typedef int Int32;37#else38typedef unsigned long UInt32;39typedef long Int32;40#endif41typedef unsigned short UInt16;42typedef short Int16;43typedef unsigned char UInt8;4445typedef UInt8 Byte;46typedef Int32 hsFixed;47typedef Int32 hsFract;48typedef UInt32 Bool32;4950#ifndef __cplusplus51#ifndef false52#define false 053#endif5455#ifndef true56#define true 157#endif58#endif5960/* managed: 1 means the glyph has a hardware cached61* copy, and its freeing is managed by the usual62* 2D disposer code.63* A value of 0 means its either unaccelerated (and so has no cellInfos)64* or we want to free this in a different way.65* The field uses previously unused padding, so doesn't enlarge66* the structure.67*/68#define UNMANAGED_GLYPH 069#define MANAGED_GLYPH 170typedef struct GlyphInfo {71float advanceX;72float advanceY;73UInt16 width;74UInt16 height;75UInt16 rowBytes;76UInt8 managed;77float topLeftX;78float topLeftY;79void *cellInfo;80UInt8 *image;81} GlyphInfo;8283/* We use fffe and ffff as meaning invisible glyphs which have no84* image, or advance and an empty outline.85* Since there are no valid glyphs with this great a value (watch out for86* large fonts in the future!) we can safely use check for >= this value87*/88#define INVISIBLE_GLYPHS 0xfffe8990#include "sunfontids.h"9192/* If font is malformed then scaler context created by particular scaler93* will be replaced by null scaler context.94* Note that this context is not compatible with structure of the context95* object used by particular scaler. Therefore, before using context96* scaler has to check if it is NullContext.97*98* Note that in theory request with NullContext should not even reach native99* scaler.100*101* It seems that the only reason to support NullContext is to simplify102* FileFontStrike logic - presence of context is used as marker to103* free the memory.104*/105JNIEXPORT int isNullScalerContext(void *context);106107#ifdef __cplusplus108}109#endif110111#endif112113114