Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7d52e660
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d52e660
编写于
11月 16, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Whitespace
上级
51bb498b
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
87 addition
and
92 deletion
+87
-92
src/hb-coretext.cc
src/hb-coretext.cc
+13
-19
src/hb-icu-le.cc
src/hb-icu-le.cc
+1
-1
src/hb-old.cc
src/hb-old.cc
+5
-5
src/hb-open-file-private.hh
src/hb-open-file-private.hh
+1
-1
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+1
-1
src/hb-ot-head-table.hh
src/hb-ot-head-table.hh
+1
-1
src/hb-ot-hhea-table.hh
src/hb-ot-hhea-table.hh
+1
-1
src/hb-ot-hmtx-table.hh
src/hb-ot-hmtx-table.hh
+1
-1
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+1
-1
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+1
-1
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+1
-1
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+1
-1
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+1
-1
src/hb-ot-maxp-table.hh
src/hb-ot-maxp-table.hh
+1
-1
src/hb-ot-name-table.hh
src/hb-ot-name-table.hh
+1
-1
src/hb-ot-shape-complex-default.cc
src/hb-ot-shape-complex-default.cc
+55
-54
src/hb-tt-font.cc
src/hb-tt-font.cc
+1
-1
未找到文件。
src/hb-coretext.cc
浏览文件 @
7d52e660
...
...
@@ -212,26 +212,22 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CFDictionaryRef
attrs
=
CFDictionaryCreate
(
kCFAllocatorDefault
,
(
const
void
**
)
&
kCTFontAttributeName
,
(
const
void
**
)
&
font_data
->
ct_font
,
1
,
/
/ count of attributes
1
,
/
* count of attributes */
&
kCFTypeDictionaryKeyCallBacks
,
&
kCFTypeDictionaryValueCallBacks
);
/
/ TODO: support features
/
* TODO: support features */
// Now we can create an attributed string
CFAttributedStringRef
attr_string
=
CFAttributedStringCreate
(
kCFAllocatorDefault
,
string_ref
,
attrs
);
CFRelease
(
string_ref
);
CFRelease
(
attrs
);
// Create the CoreText line from our string, then we're done with it
CTLineRef
line
=
CTLineCreateWithAttributedString
(
attr_string
);
CFRelease
(
attr_string
);
// and finally retrieve the glyph data and store into the gfxTextRun
CFArrayRef
glyph_runs
=
CTLineGetGlyphRuns
(
line
);
unsigned
int
num_runs
=
CFArrayGetCount
(
glyph_runs
);
// Iterate through the glyph runs.
bool
success
=
true
;
buffer
->
len
=
0
;
...
...
@@ -246,11 +242,9 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
buffer
->
ensure
(
buffer
->
len
+
num_glyphs
);
// retrieve the laid-out glyph data from the CTRun
// Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds,
// and so copying data to our own buffer with CTRunGetGlyphs will be
// extremely rare.
/* Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds,
* and so copying data to our own buffer with CTRunGetGlyphs will be
* extremely rare. */
unsigned
int
scratch_size
;
char
*
scratch
=
(
char
*
)
buffer
->
get_scratch_buffer
(
&
scratch_size
);
...
...
@@ -294,7 +288,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
info
->
codepoint
=
glyphs
[
j
];
info
->
cluster
=
string_indices
[
j
];
/
/ currently, we do all x-positioning by setting the advance, we never use x-offset
/
* Currently, we do all x-positioning by setting the advance, we never use x-offset. */
info
->
mask
=
advance
;
info
->
var1
.
u32
=
0
;
info
->
var2
.
u32
=
positions
[
j
].
y
;
...
...
@@ -316,12 +310,13 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
pos
->
y_offset
=
info
->
var2
.
u32
;
}
// Fix up clusters so that we never return out-of-order indices;
// if core text has reordered glyphs, we'll merge them to the
// beginning of the reordered cluster.
// This does *not* mean we'll form the same clusters as Uniscribe
// or the native OT backend, only that the cluster indices will be
// non-decreasing in the output buffer.
/* Fix up clusters so that we never return out-of-order indices;
* if core text has reordered glyphs, we'll merge them to the
* beginning of the reordered cluster.
*
* This does *not* mean we'll form the same clusters as Uniscribe
* or the native OT backend, only that the cluster indices will be
* monotonic in the output buffer. */
if
(
HB_DIRECTION_IS_FORWARD
(
buffer
->
props
.
direction
))
{
unsigned
int
prev_cluster
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
...
...
@@ -337,7 +332,6 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
prev_cluster
=
curr_cluster
;
}
}
else
{
// For RTL runs, we make them non-increasing instead.
unsigned
int
prev_cluster
=
(
unsigned
int
)
-
1
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
unsigned
int
curr_cluster
=
buffer
->
info
[
i
].
cluster
;
...
...
src/hb-icu-le.cc
浏览文件 @
7d52e660
...
...
@@ -115,7 +115,7 @@ _hb_icu_le_shape (hb_shape_plan_t *shape_plan,
LEFontInstance
*
font_instance
=
HB_SHAPER_DATA_GET
(
font
);
le_int32
script_code
=
hb_icu_script_from_script
(
shape_plan
->
props
.
script
);
le_int32
language_code
=
-
1
/* TODO */
;
le_int32
typography_flags
=
3
;
/
/ essential for ligatures and kerning
le_int32
typography_flags
=
3
;
/
* Needed for ligatures and kerning */
LEErrorCode
status
=
LE_NO_ERROR
;
le_engine
*
le
=
le_create
((
const
le_font
*
)
font_instance
,
script_code
,
...
...
src/hb-old.cc
浏览文件 @
7d52e660
...
...
@@ -100,7 +100,7 @@ hb_old_convertStringToGlyphIndices (HB_Font old_font,
glyphs
[
i
]
=
u
;
}
*
numGlyphs
=
length
;
/
/ XXX
*
numGlyphs
=
length
;
/
* XXX */
return
true
;
}
...
...
@@ -123,7 +123,7 @@ hb_old_canRender (HB_Font old_font,
const
HB_UChar16
*
string
,
hb_uint32
length
)
{
return
true
;
/
/ TODO
return
true
;
/
* TODO */
}
static
HB_Error
...
...
@@ -135,7 +135,7 @@ hb_old_getPointInOutline (HB_Font old_font,
HB_Fixed
*
ypos
,
hb_uint32
*
nPoints
)
{
return
HB_Err_Ok
;
/
/ TODO
return
HB_Err_Ok
;
/
* TODO */
}
static
void
...
...
@@ -230,8 +230,8 @@ _hb_old_shaper_font_data_create (hb_font_t *font)
data
->
klass
=
&
hb_old_font_class
;
data
->
x_ppem
=
font
->
x_ppem
;
data
->
y_ppem
=
font
->
y_ppem
;
data
->
x_scale
=
font
->
x_scale
;
/
/ XXX
data
->
y_scale
=
font
->
y_scale
;
/
/ XXX
data
->
x_scale
=
font
->
x_scale
;
/
* XXX */
data
->
y_scale
=
font
->
y_scale
;
/
* XXX */
data
->
userData
=
font
;
return
data
;
...
...
src/hb-open-file-private.hh
浏览文件 @
7d52e660
...
...
@@ -255,7 +255,7 @@ struct OpenTypeFontFile
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OPEN_FILE_PRIVATE_HH */
src/hb-open-type-private.hh
浏览文件 @
7d52e660
...
...
@@ -922,7 +922,7 @@ struct SortedArrayOf : ArrayOf<Type> {
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OPEN_TYPE_PRIVATE_HH */
src/hb-ot-head-table.hh
浏览文件 @
7d52e660
...
...
@@ -143,7 +143,7 @@ struct head
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_HEAD_TABLE_HH */
src/hb-ot-hhea-table.hh
浏览文件 @
7d52e660
...
...
@@ -91,7 +91,7 @@ struct hhea
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_HHEA_TABLE_HH */
src/hb-ot-hmtx-table.hh
浏览文件 @
7d52e660
...
...
@@ -86,7 +86,7 @@ struct hmtx
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_HMTX_TABLE_HH */
src/hb-ot-layout-common-private.hh
浏览文件 @
7d52e660
...
...
@@ -878,7 +878,7 @@ struct Device
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_LAYOUT_COMMON_PRIVATE_HH */
src/hb-ot-layout-gdef-table.hh
浏览文件 @
7d52e660
...
...
@@ -425,7 +425,7 @@ struct GDEF
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_LAYOUT_GDEF_TABLE_HH */
src/hb-ot-layout-gpos-table.hh
浏览文件 @
7d52e660
...
...
@@ -1712,7 +1712,7 @@ static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_i
#undef cursive_chain
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_LAYOUT_GPOS_TABLE_HH */
src/hb-ot-layout-gsub-table.hh
浏览文件 @
7d52e660
...
...
@@ -1567,7 +1567,7 @@ static inline bool substitute_lookup (hb_apply_context_t *c, unsigned int lookup
}
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_LAYOUT_GSUB_TABLE_HH */
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
7d52e660
...
...
@@ -1820,7 +1820,7 @@ struct GSUBGPOS
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */
src/hb-ot-maxp-table.hh
浏览文件 @
7d52e660
...
...
@@ -63,7 +63,7 @@ struct maxp
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_MAXP_TABLE_HH */
src/hb-ot-name-table.hh
浏览文件 @
7d52e660
...
...
@@ -126,7 +126,7 @@ struct name
};
}
/
/ namespace OT
}
/
* namespace OT */
#endif
/* HB_OT_NAME_TABLE_HH */
src/hb-ot-shape-complex-default.cc
浏览文件 @
7d52e660
...
...
@@ -90,114 +90,115 @@ compose_default (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t
*
ab
)
{
/* Hebrew presentation-form shaping.
* https://bugzilla.mozilla.org/show_bug.cgi?id=728866 */
// Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA;
// note that some letters do not have a dagesh presForm encoded
* https://bugzilla.mozilla.org/show_bug.cgi?id=728866
* Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA;
* Note that some letters do not have a dagesh presForm encoded.
*/
static
const
hb_codepoint_t
sDageshForms
[
0x05EA
-
0x05D0
+
1
]
=
{
0xFB30
,
/
/ ALEF
0xFB31
,
/
/ BET
0xFB32
,
/
/ GIMEL
0xFB33
,
/
/ DALET
0xFB34
,
/
/ HE
0xFB35
,
/
/ VAV
0xFB36
,
/
/ ZAYIN
0
,
// HET
0xFB38
,
/
/ TET
0xFB39
,
/
/ YOD
0xFB3A
,
/
/ FINAL KAF
0xFB3B
,
/
/ KAF
0xFB3C
,
/
/ LAMED
0
,
// FINAL MEM
0xFB3E
,
/
/ MEM
0
,
// FINAL NUN
0xFB40
,
/
/ NUN
0xFB41
,
/
/ SAMEKH
0
,
// AYIN
0xFB43
,
/
/ FINAL PE
0xFB44
,
/
/ PE
0
,
// FINAL TSADI
0xFB46
,
/
/ TSADI
0xFB47
,
/
/ QOF
0xFB48
,
/
/ RESH
0xFB49
,
/
/ SHIN
0xFB4A
/
/ TAV
0xFB30
,
/
* ALEF */
0xFB31
,
/
* BET */
0xFB32
,
/
* GIMEL */
0xFB33
,
/
* DALET */
0xFB34
,
/
* HE */
0xFB35
,
/
* VAV */
0xFB36
,
/
* ZAYIN */
0
x0000
,
/* HET */
0xFB38
,
/
* TET */
0xFB39
,
/
* YOD */
0xFB3A
,
/
* FINAL KAF */
0xFB3B
,
/
* KAF */
0xFB3C
,
/
* LAMED */
0
x0000
,
/* FINAL MEM */
0xFB3E
,
/
* MEM */
0
x0000
,
/* FINAL NUN */
0xFB40
,
/
* NUN */
0xFB41
,
/
* SAMEKH */
0
x0000
,
/* AYIN */
0xFB43
,
/
* FINAL PE */
0xFB44
,
/
* PE */
0
x0000
,
/* FINAL TSADI */
0xFB46
,
/
* TSADI */
0xFB47
,
/
* QOF */
0xFB48
,
/
* RESH */
0xFB49
,
/
* SHIN */
0xFB4A
/
* TAV */
};
bool
found
=
c
->
unicode
->
compose
(
a
,
b
,
ab
);
if
(
!
found
&&
(
b
&
~
0x7F
)
==
0x0580
)
{
/
/ s
pecial-case Hebrew presentation forms that are excluded from
// standard normalization, but wanted for old fonts
/
* S
pecial-case Hebrew presentation forms that are excluded from
* standard normalization, but wanted for old fonts. */
switch
(
b
)
{
case
0x05B4
:
/
/ HIRIQ
if
(
a
==
0x05D9
)
{
/
/ YOD
case
0x05B4
:
/
* HIRIQ */
if
(
a
==
0x05D9
)
{
/
* YOD */
*
ab
=
0xFB1D
;
found
=
true
;
}
break
;
case
0x05B7
:
/
/ patah
if
(
a
==
0x05F2
)
{
/
/ YIDDISH YOD YOD
case
0x05B7
:
/
* patah */
if
(
a
==
0x05F2
)
{
/
* YIDDISH YOD YOD */
*
ab
=
0xFB1F
;
found
=
true
;
}
else
if
(
a
==
0x05D0
)
{
/
/ ALEF
}
else
if
(
a
==
0x05D0
)
{
/
* ALEF */
*
ab
=
0xFB2E
;
found
=
true
;
}
break
;
case
0x05B8
:
/
/ QAMATS
if
(
a
==
0x05D0
)
{
/
/ ALEF
case
0x05B8
:
/
* QAMATS */
if
(
a
==
0x05D0
)
{
/
* ALEF */
*
ab
=
0xFB2F
;
found
=
true
;
}
break
;
case
0x05B9
:
/
/ HOLAM
if
(
a
==
0x05D5
)
{
/
/ VAV
case
0x05B9
:
/
* HOLAM */
if
(
a
==
0x05D5
)
{
/
* VAV */
*
ab
=
0xFB4B
;
found
=
true
;
}
break
;
case
0x05BC
:
/
/ DAGESH
case
0x05BC
:
/
* DAGESH */
if
(
a
>=
0x05D0
&&
a
<=
0x05EA
)
{
*
ab
=
sDageshForms
[
a
-
0x05D0
];
found
=
(
*
ab
!=
0
);
}
else
if
(
a
==
0xFB2A
)
{
/
/ SHIN WITH SHIN DOT
}
else
if
(
a
==
0xFB2A
)
{
/
* SHIN WITH SHIN DOT */
*
ab
=
0xFB2C
;
found
=
true
;
}
else
if
(
a
==
0xFB2B
)
{
/
/ SHIN WITH SIN DOT
}
else
if
(
a
==
0xFB2B
)
{
/
* SHIN WITH SIN DOT */
*
ab
=
0xFB2D
;
found
=
true
;
}
break
;
case
0x05BF
:
/
/ RAFE
case
0x05BF
:
/
* RAFE */
switch
(
a
)
{
case
0x05D1
:
/
/ BET
case
0x05D1
:
/
* BET */
*
ab
=
0xFB4C
;
found
=
true
;
break
;
case
0x05DB
:
/
/ KAF
case
0x05DB
:
/
* KAF */
*
ab
=
0xFB4D
;
found
=
true
;
break
;
case
0x05E4
:
/
/ PE
case
0x05E4
:
/
* PE */
*
ab
=
0xFB4E
;
found
=
true
;
break
;
}
break
;
case
0x05C1
:
/
/ SHIN DOT
if
(
a
==
0x05E9
)
{
/
/ SHIN
case
0x05C1
:
/
* SHIN DOT */
if
(
a
==
0x05E9
)
{
/
* SHIN */
*
ab
=
0xFB2A
;
found
=
true
;
}
else
if
(
a
==
0xFB49
)
{
/
/ SHIN WITH DAGESH
}
else
if
(
a
==
0xFB49
)
{
/
* SHIN WITH DAGESH */
*
ab
=
0xFB2C
;
found
=
true
;
}
break
;
case
0x05C2
:
/
/ SIN DOT
if
(
a
==
0x05E9
)
{
/
/ SHIN
case
0x05C2
:
/
* SIN DOT */
if
(
a
==
0x05E9
)
{
/
* SHIN */
*
ab
=
0xFB2B
;
found
=
true
;
}
else
if
(
a
==
0xFB49
)
{
/
/ SHIN WITH DAGESH
}
else
if
(
a
==
0xFB49
)
{
/
* SHIN WITH DAGESH */
*
ab
=
0xFB2D
;
found
=
true
;
}
...
...
src/hb-tt-font.cc
浏览文件 @
7d52e660
...
...
@@ -68,7 +68,7 @@ _hb_tt_font_destroy (hb_tt_font_t *tt)
static inline const hhea&
_get_hhea (hb_face_t *face)
{
//
return likely (face->tt && face->tt->hhea) ? *face->tt->hhea : Null(hhea);
return likely (face->tt && face->tt->hhea) ? *face->tt->hhea : Null(hhea);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录