" computeValues​​WithHarfbuzz - 需要强制单次运行和QUOT;在安卓4.0:这是什么意思?这是、什么意思、computeValues、QUOT

2023-09-07 08:44:16 作者:贱人,请走开

在我的Andr​​oid 4.0 Hotellist应用程序,我产生长期的观点通过添加多个的TextView s到一个的LinearLayout 。这项工作也为我所有的酒店,一的除外。问题是,的TextView S的名单中止添加第一个的TextView 之后,却没有引发异常!

in my Android 4 Hotellist application I'm generating long views by adding multiple textviews to a linearlayout. This work well for all my hotels, except of one. The problem is, that the list of textviews aborts after adding the first textview, but no exception is thrown!

我刚刚看到我的LogCat中这样的警告:

I just see this warning in my LogCat:

TextLayoutCache | computeValues​​WithHarfbuzz - 需要强制单   运行

TextLayoutCache | computeValuesWithHarfbuzz -- need to force to single run

有谁知道这是什么意思?

Does anyone know what that means?

推荐答案

HarfBuzz是布局/整形引擎OpenType字体。其目的是在标准化开源项目文本布局。这种警告,可以追溯到android/graphics/TextLayoutCache.cpp.

HarfBuzz is a layout/shaping engine for OpenType fonts. Its purpose is to standardize text layout in Open-source projects. That warning, can be traced back to android/graphics/TextLayoutCache.cpp.

相关code块是:

ubidi_setPara(bidi, chars, contextCount, bidiReq, NULL, &status); //runs the algorithm
int paraDir = ubidi_getParaLevel(bidi) & kDirection_Mask; // 0 if ltr, 1 if rtl

     if (U_SUCCESS(status) && rc == 1) {
           // Normal case: one run, status is ok
           isRTL = (paraDir == 1);
           useSingleRun = true;
      } else if (!U_SUCCESS(status) || rc < 1) {
           LOGW("computeValuesWithHarfbuzz -- need to force to single run");
           isRTL = (paraDir == 1);
           useSingleRun = true;
      } else {...}

的code这部分是比迪烟的算法(uBiDi),它代表统一$ C C双向$,细节的这里。

数据以阿拉伯文,希伯来文或其他RTL语言需要处理双向文本。由于这些从右到左的脚本使用从左至右写的数字,文字其实是双向的:将从右到左,左到右文本

Data in Arabic, Hebrew or another RTL languages need handling of bidirectional text. Because these right-to-left scripts use digits that are written from left to right, the text is actually bidirectional: a mixture of right-to-left and left-to-right text.

RC 上面是的算法的runco​​unt 。每单code字符都被分配一个级别。 (即使是未分配的)

rc in the above is the runcount of the algorithm. Each unicode character is assigned a level. (Even the unassigned ones)

Text是首先被分为不同的等级,(0级是纯英文文本,1级是普通的阿拉伯文字,可能是嵌入在英语水平0文字等)

Text is first split into different levels, (Level 0 is plain English text, Level 1 is plain Arabic text, possibly embedded within English level 0 text, etc)

的运行现在发生在下列方式进行。

The runs now occur in the following manner.

 Levels:  0   0   0   1   1   1   2

 Runs:   <--- 1 ---> <--- 2 ---> <3>

在上面的例子中运行计数为3。 该警告被抛出,如果比迪烟的算法一直无法运行甚至一度成功。有许多errors可能发生的,preventing算法的成功运行。 其中任何一个都可能已经引发了警告。

Run count in the above example is 3. The warning is thrown if the BiDi algorithm hasn't been able to run even once successfully. There are many errors that can occur, preventing the successful running of the algorithm. Any one of these could've triggered the warning.

然而,无论是报警发生与否,code行为除了警告记录完全相同。因此,它应该不会影响应用程序的运行。

 
精彩推荐