Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
886cca8f
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
886cca8f
编写于
5月 07, 2018
作者:
O
Omar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stb_truetype: stbtt_PackFontRanges skip missing glyphs.
上级
e6afb9cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
8 deletion
+12
-8
stb_truetype.h
stb_truetype.h
+12
-8
未找到文件。
stb_truetype.h
浏览文件 @
886cca8f
...
...
@@ -3967,13 +3967,17 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stb
int
x0
,
y0
,
x1
,
y1
;
int
codepoint
=
ranges
[
i
].
array_of_unicode_codepoints
==
NULL
?
ranges
[
i
].
first_unicode_codepoint_in_range
+
j
:
ranges
[
i
].
array_of_unicode_codepoints
[
j
];
int
glyph
=
stbtt_FindGlyphIndex
(
info
,
codepoint
);
stbtt_GetGlyphBitmapBoxSubpixel
(
info
,
glyph
,
scale
*
spc
->
h_oversample
,
scale
*
spc
->
v_oversample
,
0
,
0
,
&
x0
,
&
y0
,
&
x1
,
&
y1
);
rects
[
k
].
w
=
(
stbrp_coord
)
(
x1
-
x0
+
spc
->
padding
+
spc
->
h_oversample
-
1
);
rects
[
k
].
h
=
(
stbrp_coord
)
(
y1
-
y0
+
spc
->
padding
+
spc
->
v_oversample
-
1
);
if
(
glyph
!=
0
)
{
stbtt_GetGlyphBitmapBoxSubpixel
(
info
,
glyph
,
scale
*
spc
->
h_oversample
,
scale
*
spc
->
v_oversample
,
0
,
0
,
&
x0
,
&
y0
,
&
x1
,
&
y1
);
rects
[
k
].
w
=
(
stbrp_coord
)
(
x1
-
x0
+
spc
->
padding
+
spc
->
h_oversample
-
1
);
rects
[
k
].
h
=
(
stbrp_coord
)
(
y1
-
y0
+
spc
->
padding
+
spc
->
v_oversample
-
1
);
}
else
{
rects
[
k
].
w
=
rects
[
k
].
h
=
0
;
}
++
k
;
}
}
...
...
@@ -4026,7 +4030,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const
sub_y
=
stbtt__oversample_shift
(
spc
->
v_oversample
);
for
(
j
=
0
;
j
<
ranges
[
i
].
num_chars
;
++
j
)
{
stbrp_rect
*
r
=
&
rects
[
k
];
if
(
r
->
was_packed
)
{
if
(
r
->
was_packed
&&
r
->
w
!=
0
&&
r
->
h
!=
0
)
{
stbtt_packedchar
*
bc
=
&
ranges
[
i
].
chardata_for_range
[
j
];
int
advance
,
lsb
,
x0
,
y0
,
x1
,
y1
;
int
codepoint
=
ranges
[
i
].
array_of_unicode_codepoints
==
NULL
?
ranges
[
i
].
first_unicode_codepoint_in_range
+
j
:
ranges
[
i
].
array_of_unicode_codepoints
[
j
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录