Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
cbd1d6a6
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
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看板
提交
cbd1d6a6
编写于
5月 21, 2010
作者:
M
Martin Hosken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename Grxxx to HbGrxxx
上级
aa62a402
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
src/hb-graphite.cc
src/hb-graphite.cc
+13
-13
未找到文件。
src/hb-graphite.cc
浏览文件 @
cbd1d6a6
...
...
@@ -46,10 +46,10 @@ typedef struct _featureSetting {
int
value
;
}
featureSetting
;
class
GrBufferTextSrc
:
public
gr
::
ITextSource
class
Hb
GrBufferTextSrc
:
public
gr
::
ITextSource
{
public:
GrBufferTextSrc
(
hb_buffer_t
*
buff
,
hb_feature_t
*
feats
,
unsigned
int
num_features
)
Hb
GrBufferTextSrc
(
hb_buffer_t
*
buff
,
hb_feature_t
*
feats
,
unsigned
int
num_features
)
{
hb_feature_t
*
aFeat
=
feats
;
featureSetting
*
aNewFeat
;
...
...
@@ -64,7 +64,7 @@ public:
aNewFeat
->
value
=
aFeat
->
value
;
}
};
~
GrBufferTextSrc
()
{
hb_buffer_destroy
(
buffer
);
delete
[]
features
;
};
~
Hb
GrBufferTextSrc
()
{
hb_buffer_destroy
(
buffer
);
delete
[]
features
;
};
virtual
gr
::
UtfType
utfEncodingForm
()
{
return
gr
::
kutf32
;
};
virtual
size_t
getLength
()
{
return
buffer
->
len
;
};
virtual
size_t
fetch
(
gr
::
toffset
ichMin
,
size_t
cch
,
gr
::
utf32
*
prgchBuffer
)
...
...
@@ -120,12 +120,12 @@ private:
unsigned
int
nFeatures
;
};
class
GrHb
Font
:
public
gr
::
Font
class
HbGr
Font
:
public
gr
::
Font
{
public:
GrHb
Font
(
hb_font_t
*
font
,
hb_face_t
*
face
)
:
gr
::
Font
()
HbGr
Font
(
hb_font_t
*
font
,
hb_face_t
*
face
)
:
gr
::
Font
()
{
m_font
=
hb_font_reference
(
font
);
m_face
=
hb_face_reference
(
face
);
initfont
();
};
~
GrHb
Font
()
~
HbGr
Font
()
{
std
::
map
<
hb_tag_t
,
hb_blob_t
*>::
iterator
p
=
m_blobs
.
begin
();
while
(
p
!=
m_blobs
.
end
())
...
...
@@ -133,7 +133,7 @@ public:
hb_font_destroy
(
m_font
);
hb_face_destroy
(
m_face
);
};
GrHbFont
(
const
GrHb
Font
&
font
)
:
gr
::
Font
(
font
)
HbGrFont
(
const
HbGr
Font
&
font
)
:
gr
::
Font
(
font
)
{
*
this
=
font
;
m_blobs
=
std
::
map
<
hb_tag_t
,
hb_blob_t
*>
(
font
.
m_blobs
);
...
...
@@ -142,7 +142,7 @@ public:
hb_font_reference
(
m_font
);
hb_face_reference
(
m_face
);
};
virtual
GrHbFont
*
copyThis
()
{
return
new
GrHb
Font
(
*
this
);
};
virtual
HbGrFont
*
copyThis
()
{
return
new
HbGr
Font
(
*
this
);
};
virtual
bool
bold
()
{
return
m_bold
;
};
virtual
bool
italic
()
{
return
m_italic
;
};
virtual
float
ascent
()
{
float
asc
;
getFontMetrics
(
&
asc
,
NULL
,
NULL
);
return
asc
;
};
...
...
@@ -210,7 +210,7 @@ private:
std
::
map
<
hb_tag_t
,
hb_blob_t
*>
m_blobs
;
};
void
GrHb
Font
::
initfont
()
void
HbGr
Font
::
initfont
()
{
const
void
*
pOS2
=
getTable
(
gr
::
kttiOs2
,
NULL
);
const
void
*
pHead
=
getTable
(
gr
::
kttiHead
,
NULL
);
...
...
@@ -228,10 +228,10 @@ hb_graphite_shape (hb_font_t *font,
unsigned
int
num_features
)
{
/* create text source */
GrBufferTextSrc
textSrc
(
buffer
,
features
,
num_features
);
Hb
GrBufferTextSrc
textSrc
(
buffer
,
features
,
num_features
);
/* create grfont */
GrHb
Font
grfont
(
font
,
face
);
HbGr
Font
grfont
(
font
,
face
);
/* create segment */
int
*
firsts
;
...
...
@@ -264,7 +264,7 @@ hb_graphite_shape (hb_font_t *font,
hb_buffer_ensure
(
buffer
,
numGlyphs
);
pSegment
.
getUniscribeClusters
(
firsts
,
numChars
,
NULL
,
flags
,
numGlyphs
,
NULL
);
glyph_range
=
pSegment
.
glyphs
();
for
(
pGlyph
=
glyph_infos
,
iGlyph
=
glyph_range
.
first
;
iGlyph
<
glyph_range
.
second
;
for
(
pGlyph
=
glyph_infos
,
iGlyph
=
glyph_range
.
first
;
iGlyph
!=
glyph_range
.
second
;
iGlyph
++
,
pGlyph
++
)
{
*
pGlyph
=
iGlyph
->
glyphID
();
}
...
...
@@ -285,7 +285,7 @@ hb_graphite_shape (hb_font_t *font,
float
curradvx
=
0.
,
curradvy
=
0.
;
for
(
pPosition
=
hb_buffer_get_glyph_positions
(
buffer
),
iGlyph
=
glyph_range
.
first
;
iGlyph
<
glyph_range
.
second
;
pPosition
++
,
iGlyph
++
)
iGlyph
!=
glyph_range
.
second
;
pPosition
++
,
iGlyph
++
)
{
pPosition
->
x_offset
=
iGlyph
->
origin
()
-
curradvx
;
pPosition
->
y_offset
=
iGlyph
->
yOffset
()
-
curradvy
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录