Path: blob/master/src/java.desktop/share/native/libfontmanager/hb-jdk.h
41149 views
/*1* Copyright (c) 2015, 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 HB_JDK_H26#define HB_JDK_H2728#include "hb.h"29#include <jni.h>30#include <sunfontids.h>3132# ifdef __cplusplus33extern "C" {34#endif3536typedef struct JDKFontInfo_Struct {37JNIEnv* env;38jobject font2D;39jobject fontStrike;40float matrix[4];41float ptSize;42float xPtSize;43float yPtSize;44float devScale; // How much applying the full glyph tx scales x distance.45} JDKFontInfo;464748// Use 16.16 for better precision than 26.649#define HBFloatToFixedScale ((float)(1 << 16))50#define HBFloatToFixed(f) ((unsigned int)((f) * HBFloatToFixedScale))5152/*53* Note:54*55* Set face size on ft-face before creating hb-font from it.56* Otherwise hb-ft would NOT pick up the font size correctly.57*/5859hb_face_t *60hb_jdk_face_create(JDKFontInfo* jdkFontInfo,61hb_destroy_func_t destroy);62hb_font_t *63hb_jdk_font_create(hb_face_t* hbFace,64JDKFontInfo* jdkFontInfo,65hb_destroy_func_t destroy);666768/* Makes an hb_font_t use JDK internally to implement font functions. */69void70hb_jdk_font_set_funcs(hb_font_t *font);717273# ifdef __cplusplus74}75#endif7677#endif /* HB_JDK_H */787980