Skip to content
Dong Liu edited this page Oct 11, 2023 · 2 revisions

Build

跳过tests

修改test Task:

// include("**/*.*");
exclude("**/*.*");

build

./gradlew build

构建结果目录:build/sdk/lib

build with webkit

./gradlew -PCOMPILE_WEBKIT=true build

publish to local

./gradlew -PMAVEN_PUBLISH=true -PMILESTONE_FCS=true publishToMavenLocal -x test

版本xxx-internal(如22-internal)

clean all

./gradlew clean;./gradlew cleanNative

static build

先要clean/cleanNative

./gradlew -PSTATIC_BUILD=true build

build后目录: build/sdk/lib

  1. copy 所有的.a文件到 .gluon/substrate/javafxStaticSdk/${version}/darwin-${arch}/sdk/lib
  2. 从原来的jar包中解压native compile config:unzip javafx.xxxx.jar META-INF/substrate
  3. copy需要的jar到.gluon/substrate/javafxStaticSdk/${version}/darwin-${arch}/sdk/lib
  4. 新jar包中加入native compile config:zip -ur avafx.xxxx.jar META-INF/substrate

BUGS

中文标点

调用路径:GlassView3D.m -> notifyInputMethod (GlassViewDelegate.m) -> notifyInputMethodMac(MacView) ->

Font Family 字体选择

  • com.sun.javafx.font.PrismFontFactory#createFontResources,index默认是0,需要查找一下index
  • com.sun.javafx.font.PrismFontFactory#getFontResource,常规字体应选择 Regular
0 = "PingFang SC Regular"
1 = "PingFang SC Medium"
2 = "PingFang SC Ultralight"
3 = "PingFang SC Semibold"
4 = "PingFang SC Thin"
5 = "PingFang SC Light"

默认系统fallback字体

PingFang 最早作为iOS 9和OS X El Capitan (10.11)的默认中文字体。

输入法翻页键([]-+)处理,错误键入

keyDown错误的设置shouldProcessKeyEvent=true

GlassViewDelegate.m#keyDown ->
GlassView3D.m#performKeyEquivalent->
com.sun.glass.ui.View#notifyKey ->
com.sun.javafx.tk.quantum.GlassViewEventHandler#handleKeyEvent ->
KeyEvent type=KEY_TYPED ->
com.sun.javafx.scene.control.behavior.TextInputControlBehavior#defaultKeyTyped

其他

字体

获取字符渲染结果:com.sun.javafx.font.coretext.CTGlyph#getPixelData(int),CTGlyph包含一个glyphCode和对应的字体。glyphCode是字体中对字符的编码,unicode到 glyphCode的转换:com.sun.javafx.font.CompositeGlyphMapper#convertToGlyph

CoreText的字体定义:CTFont

字体回落

CompositeFontResource -> PrismCompositeFontResource (含 FallbackResource)

系统fallback字体:com.sun.javafx.font.coretext.CTFactory#getFallbacks

字体style

os table 字体属性: https://github.com/googlefonts/sfntly/blob/main/java/src/com/google/typography/font/sfntly/table/core/OS2Table.java