提交 95eb0f3b 编写于 作者: G Garret Rieger

[subset] Switch to a non-log using implementation of caculating searchRangeZ,...

[subset] Switch to a non-log using implementation of caculating searchRangeZ, entrySelectorZ, and rangeShiftZ in cmap4.
上级 b0d7971b
...@@ -87,14 +87,12 @@ struct CmapSubtableFormat4 ...@@ -87,14 +87,12 @@ struct CmapSubtableFormat4
this->format.set (4); this->format.set (4);
this->length.set (get_sub_table_size (segments)); this->length.set (get_sub_table_size (segments));
// 2 * segCount
this->segCountX2.set (segments.len * 2); this->segCountX2.set (segments.len * 2);
// 2 * (2**floor(log2(segCount))) this->entrySelectorZ.set (MAX (1u, _hb_bit_storage (segments.len)) - 1);
this->searchRangeZ.set (2 * (1 << (int) (log (segments.len) / log (2.0)))); this->searchRangeZ.set (2 * (1u << this->entrySelectorZ));
// log2(searchRange/2) this->rangeShiftZ.set (segments.len * 2 > this->searchRangeZ
this->entrySelectorZ.set (log ((double) this->searchRangeZ / 2.0) / log (2.0)); ? 2 * segments.len - this->searchRangeZ
// 2 x segCount - searchRange : 0);
this->rangeShiftZ.set (2 * segments.len - this->searchRangeZ);
HBUINT16 *end_count = c->allocate_size<HBUINT16> (HBUINT16::static_size * segments.len); HBUINT16 *end_count = c->allocate_size<HBUINT16> (HBUINT16::static_size * segments.len);
c->allocate_size<HBUINT16> (HBUINT16::static_size); // 2 bytes of padding. c->allocate_size<HBUINT16> (HBUINT16::static_size); // 2 bytes of padding.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册