のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

hb_blob_t

     53 struct hb_blob_t {
     54   hb_object_header_t header;
     55   ASSERT_POD ();
     56 
     57   bool immutable;
     58 
     59   const char *data;
     60   unsigned int length;
     61   hb_memory_mode_t mode;
     62 
     63   void *user_data;
     64   hb_destroy_func_t destroy;
     65 };

Cross Reference: /external/harfbuzz_ng/src/hb-blob.cc

     96 struct hb_font_t {
     97   hb_object_header_t header;
     98   ASSERT_POD ();
     99 
    100   hb_bool_t immutable;
    101 
    102   hb_font_t *parent;
    103   hb_face_t *face;
    104 
    105   int x_scale;
    106   int y_scale;
    107 
    108   unsigned int x_ppem;
    109   unsigned int y_ppem;
    110 
    111   hb_font_funcs_t   *klass;
    112   void              *user_data;
    113   hb_destroy_func_t  destroy;
    114 
    115   struct hb_shaper_data_t shaper_data;

Cross Reference: /external/harfbuzz_ng/src/hb-font-private.hh

     43 struct hb_face_t {
     44   hb_object_header_t header;
     45   ASSERT_POD ();
     46 
     47   hb_bool_t immutable;
     48 
     49   hb_reference_table_func_t  reference_table_func;
     50   void                      *user_data;
     51   hb_destroy_func_t          destroy;
     52 
     53   unsigned int index;
     54   mutable unsigned int upem;
     55   mutable unsigned int num_glyphs;
     56 
     57   struct hb_shaper_data_t shaper_data;
     58 
     59   struct plan_node_t {
     60     hb_shape_plan_t *shape_plan;
     61     plan_node_t *next;
     62   } *shape_plans;

Cross Reference: /external/harfbuzz_ng/src/hb-face-private.hh

tapas コマンド

Building

Trade Federation is set up in a lightweight "unbundled" branch that uses slightly different build commands from the platform source. In particular, unbundled branches use the tapas command to set up the build environment, rather than the lunch command. So starting from the root directory of the source tree you checked out, try:

$ . build/envsetup.sh
$ tapas tradefed-all
$ m -j8
Note that once the $ . build/envsetup.sh step is done, the other two commands will run equally well from anywhere in the tree.

Development Environment | Android Open Source Project

aosp build/envsetup.shのコマンド

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:     lunch <product_name>-<build_variant>
- tapas:     tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]
- croot:     Changes directory to the top of the tree.
- m:         Makes from the top of the tree.
- mm:        Builds all of the modules in the current directory, but not their dependencies.
- mmm:       Builds all of the modules in the supplied directories, but not their dependencies.
             To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma:       Builds all of the modules in the current directory, and their dependencies.
- mmma:      Builds all of the modules in the supplied directories, and their dependencies.
- provision: Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep:     Greps on all local C/C++ files.
- ggrep:     Greps on all local Gradle files.
- jgrep:     Greps on all local Java files.
- resgrep:   Greps on all local res/*.xml files.
- mangrep:   Greps on all local AndroidManifest.xml files.
- mgrep:     Greps on all local Makefiles files.
- sepgrep:   Greps on all local sepolicy files.
- sgrep:     Greps on all local source files.
- godir:     Go to the directory containing a file.

Environment options:
- SANITIZE_HOST: Set to 'true' to use ASAN for all host modules. Note that
                 ASAN_OPTIONS=detect_leaks=0 will be set by default until the
                 build is leak-check clean.

addFont

6.0.0_r1

    103 bool FontFamily::addFont(MinikinFont* typeface) {
    104     AutoMutex _l(gMinikinLock);
    105     const uint32_t os2Tag = MinikinFont::MakeTag('O', 'S', '/', '2');
    106     size_t os2Size = 0;
    107     bool ok = typeface->GetTable(os2Tag, NULL, &os2Size);
    108     if (!ok) return false;
    109     UniquePtr<uint8_t[]> os2Data(new uint8_t[os2Size]);
    110     ok = typeface->GetTable(os2Tag, os2Data.get(), &os2Size);
    111     if (!ok) return false;
    112     int weight;
    113     bool italic;
    114     if (analyzeStyle(os2Data.get(), os2Size, &weight, &italic)) {
    115         //ALOGD("analyzed weight = %d, italic = %s", weight, italic ? "true" : "false");
    116         FontStyle style(weight, italic);
    117         addFontLocked(typeface, style);
    118         return true;
    119     } else {
    120         ALOGD("failed to analyze style");
    121     }
    122     return false;
    123 }

Cross Reference: /frameworks/minikin/libs/minikin/FontFamily.cpp

     81 bool MinikinFontSkia::GetTable(uint32_t tag, uint8_t *buf, size_t *size) {
     82     if (buf == NULL) {
     83         const size_t tableSize = mTypeface->getTableSize(tag);
     84         *size = tableSize;
     85         return tableSize != 0;
     86     } else {
     87         const size_t actualSize = mTypeface->getTableData(tag, 0, *size, buf);
     88         *size = actualSize;
     89         return actualSize != 0;
     90     }
     91 }

Cross Reference: /frameworks/base/core/jni/android/graphics/MinikinSkia.cpp

    61 bool MinikinFontFreeType::GetTable(uint32_t tag, uint8_t *buf, size_t *size) {
     62 	FT_ULong ftsize = *size;
     63 	FT_Error error = FT_Load_Sfnt_Table(mTypeface, tag, 0, buf, &ftsize);
     64 	if (error != 0) {
     65 		return false;
     66 	}
     67 	*size = ftsize;
     68 	return true;