diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index 4152a3944c95df36875335a11fda5f7039194efc..dfb6341dc61766b5523928cd532eca68d933abe4 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -212,26 +212,22 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, CFDictionaryRef attrs = CFDictionaryCreate (kCFAllocatorDefault, (const void**) &kCTFontAttributeName, (const void**) &font_data->ct_font, - 1, // count of attributes + 1, /* count of attributes */ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - // TODO: support features + /* TODO: support features */ - // Now we can create an attributed string CFAttributedStringRef attr_string = CFAttributedStringCreate (kCFAllocatorDefault, string_ref, attrs); CFRelease (string_ref); CFRelease (attrs); - // Create the CoreText line from our string, then we're done with it CTLineRef line = CTLineCreateWithAttributedString (attr_string); CFRelease (attr_string); - // and finally retrieve the glyph data and store into the gfxTextRun CFArrayRef glyph_runs = CTLineGetGlyphRuns (line); unsigned int num_runs = CFArrayGetCount (glyph_runs); - // Iterate through the glyph runs. bool success = true; buffer->len = 0; @@ -246,11 +242,9 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, buffer->ensure (buffer->len + num_glyphs); - // retrieve the laid-out glyph data from the CTRun - - // Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds, - // and so copying data to our own buffer with CTRunGetGlyphs will be - // extremely rare. + /* Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds, + * and so copying data to our own buffer with CTRunGetGlyphs will be + * extremely rare. */ unsigned int scratch_size; char *scratch = (char *) buffer->get_scratch_buffer (&scratch_size); @@ -294,7 +288,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, info->codepoint = glyphs[j]; info->cluster = string_indices[j]; - // currently, we do all x-positioning by setting the advance, we never use x-offset + /* Currently, we do all x-positioning by setting the advance, we never use x-offset. */ info->mask = advance; info->var1.u32 = 0; info->var2.u32 = positions[j].y; @@ -316,12 +310,13 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, pos->y_offset = info->var2.u32; } - // Fix up clusters so that we never return out-of-order indices; - // if core text has reordered glyphs, we'll merge them to the - // beginning of the reordered cluster. - // This does *not* mean we'll form the same clusters as Uniscribe - // or the native OT backend, only that the cluster indices will be - // non-decreasing in the output buffer. + /* Fix up clusters so that we never return out-of-order indices; + * if core text has reordered glyphs, we'll merge them to the + * beginning of the reordered cluster. + * + * This does *not* mean we'll form the same clusters as Uniscribe + * or the native OT backend, only that the cluster indices will be + * monotonic in the output buffer. */ if (HB_DIRECTION_IS_FORWARD (buffer->props.direction)) { unsigned int prev_cluster = 0; for (unsigned int i = 0; i < count; i++) { @@ -337,7 +332,6 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, prev_cluster = curr_cluster; } } else { - // For RTL runs, we make them non-increasing instead. unsigned int prev_cluster = (unsigned int)-1; for (unsigned int i = 0; i < count; i++) { unsigned int curr_cluster = buffer->info[i].cluster; diff --git a/src/hb-icu-le.cc b/src/hb-icu-le.cc index d73752d171b9b479dac377c1ac8dba3fe92fe641..61099fedf74d6b038db8b2af6ded1c80525516a4 100644 --- a/src/hb-icu-le.cc +++ b/src/hb-icu-le.cc @@ -115,7 +115,7 @@ _hb_icu_le_shape (hb_shape_plan_t *shape_plan, LEFontInstance *font_instance = HB_SHAPER_DATA_GET (font); le_int32 script_code = hb_icu_script_from_script (shape_plan->props.script); le_int32 language_code = -1 /* TODO */; - le_int32 typography_flags = 3; // essential for ligatures and kerning + le_int32 typography_flags = 3; /* Needed for ligatures and kerning */ LEErrorCode status = LE_NO_ERROR; le_engine *le = le_create ((const le_font *) font_instance, script_code, diff --git a/src/hb-old.cc b/src/hb-old.cc index 529bffa0c9461727add24034aa19720edecab032..7c3e3702b4679763470594ab65524bc5b08dbaac 100644 --- a/src/hb-old.cc +++ b/src/hb-old.cc @@ -100,7 +100,7 @@ hb_old_convertStringToGlyphIndices (HB_Font old_font, glyphs[i] = u; } - *numGlyphs = length; // XXX + *numGlyphs = length; /* XXX */ return true; } @@ -123,7 +123,7 @@ hb_old_canRender (HB_Font old_font, const HB_UChar16 *string, hb_uint32 length) { - return true; // TODO + return true; /* TODO */ } static HB_Error @@ -135,7 +135,7 @@ hb_old_getPointInOutline (HB_Font old_font, HB_Fixed *ypos, hb_uint32 *nPoints) { - return HB_Err_Ok; // TODO + return HB_Err_Ok; /* TODO */ } static void @@ -230,8 +230,8 @@ _hb_old_shaper_font_data_create (hb_font_t *font) data->klass = &hb_old_font_class; data->x_ppem = font->x_ppem; data->y_ppem = font->y_ppem; - data->x_scale = font->x_scale; // XXX - data->y_scale = font->y_scale; // XXX + data->x_scale = font->x_scale; /* XXX */ + data->y_scale = font->y_scale; /* XXX */ data->userData = font; return data; diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index 31fedfbbceab598b25892315ebf2b5110935b4fe..20d5e8716977cdb9b2a05f2e29cb22807f4f40b6 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -255,7 +255,7 @@ struct OpenTypeFontFile }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OPEN_FILE_PRIVATE_HH */ diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 8595038d74cbde44ac07ee4affa25da0ae7cf048..2e03dc3d0caba50eedd6b445a8f34fc26e667b79 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -922,7 +922,7 @@ struct SortedArrayOf : ArrayOf { }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OPEN_TYPE_PRIVATE_HH */ diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh index 39495310aa9d4be92f1639df07c23946b3e741e5..b3b3a14c6825ef5bc04b722ae58b844e1d8150d3 100644 --- a/src/hb-ot-head-table.hh +++ b/src/hb-ot-head-table.hh @@ -143,7 +143,7 @@ struct head }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_HEAD_TABLE_HH */ diff --git a/src/hb-ot-hhea-table.hh b/src/hb-ot-hhea-table.hh index 5009e6b6a2df29f994946fb398a47f1cf70d4504..fa3088cc3caf917353975dc72c8e4e5c2b0b0c88 100644 --- a/src/hb-ot-hhea-table.hh +++ b/src/hb-ot-hhea-table.hh @@ -91,7 +91,7 @@ struct hhea }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_HHEA_TABLE_HH */ diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index feb60168008330fa2d524e45daf60688ea04620f..e09996ce42e1d16f275936ae04021d344e628eaf 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -86,7 +86,7 @@ struct hmtx }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_HMTX_TABLE_HH */ diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 0696e470bdb61d5b7d7aa7b7c5fb2a957311835b..54f59361a97a96e2f95528b79779e499eec5c515 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -878,7 +878,7 @@ struct Device }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_LAYOUT_COMMON_PRIVATE_HH */ diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh index 0ab2bc28dedeedb2a754cf0041733f55425c20c6..900dedd1a3f0c601ef6b4389bf2ab146c040260b 100644 --- a/src/hb-ot-layout-gdef-table.hh +++ b/src/hb-ot-layout-gdef-table.hh @@ -425,7 +425,7 @@ struct GDEF }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_LAYOUT_GDEF_TABLE_HH */ diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index d0f228d05a4e6755349fb1f09a96ab774539a43e..afe18b5fc80666de2eca55f2a8956864ed0ed575 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1712,7 +1712,7 @@ static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_i #undef cursive_chain -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_LAYOUT_GPOS_TABLE_HH */ diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index e5058c6a281d0c96a43a6897e2ce555dd4805d92..6e185baffa504eb6e1419fdbe91d18fbaa59b5c2 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1567,7 +1567,7 @@ static inline bool substitute_lookup (hb_apply_context_t *c, unsigned int lookup } -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_LAYOUT_GSUB_TABLE_HH */ diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index dd0ef63b611b5879b22c56ccf1a3646765ac033a..66e37a670d82b8566d90dbac4dec97a77aac7b68 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -1820,7 +1820,7 @@ struct GSUBGPOS }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */ diff --git a/src/hb-ot-maxp-table.hh b/src/hb-ot-maxp-table.hh index 9e113c73ad6a0e0ba89e64f34c9e030f6376c5c2..ef2b9f1cc623a6f8e593c5055eabcfd2aae3606c 100644 --- a/src/hb-ot-maxp-table.hh +++ b/src/hb-ot-maxp-table.hh @@ -63,7 +63,7 @@ struct maxp }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_MAXP_TABLE_HH */ diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index 6cc7a5ea2fd30fd60154fe8be336f48032fd1374..ab7a692ede192e10f0c2d878acaf436174fff80c 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -126,7 +126,7 @@ struct name }; -} // namespace OT +} /* namespace OT */ #endif /* HB_OT_NAME_TABLE_HH */ diff --git a/src/hb-ot-shape-complex-default.cc b/src/hb-ot-shape-complex-default.cc index 6a17330215fc60b17bb84f0f660d9aa735a2377c..5340293db5053482ca6f79a61ee99ed406772026 100644 --- a/src/hb-ot-shape-complex-default.cc +++ b/src/hb-ot-shape-complex-default.cc @@ -90,114 +90,115 @@ compose_default (const hb_ot_shape_normalize_context_t *c, hb_codepoint_t *ab) { /* Hebrew presentation-form shaping. - * https://bugzilla.mozilla.org/show_bug.cgi?id=728866 */ - // Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA; - // note that some letters do not have a dagesh presForm encoded + * https://bugzilla.mozilla.org/show_bug.cgi?id=728866 + * Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA; + * Note that some letters do not have a dagesh presForm encoded. + */ static const hb_codepoint_t sDageshForms[0x05EA - 0x05D0 + 1] = { - 0xFB30, // ALEF - 0xFB31, // BET - 0xFB32, // GIMEL - 0xFB33, // DALET - 0xFB34, // HE - 0xFB35, // VAV - 0xFB36, // ZAYIN - 0, // HET - 0xFB38, // TET - 0xFB39, // YOD - 0xFB3A, // FINAL KAF - 0xFB3B, // KAF - 0xFB3C, // LAMED - 0, // FINAL MEM - 0xFB3E, // MEM - 0, // FINAL NUN - 0xFB40, // NUN - 0xFB41, // SAMEKH - 0, // AYIN - 0xFB43, // FINAL PE - 0xFB44, // PE - 0, // FINAL TSADI - 0xFB46, // TSADI - 0xFB47, // QOF - 0xFB48, // RESH - 0xFB49, // SHIN - 0xFB4A // TAV + 0xFB30, /* ALEF */ + 0xFB31, /* BET */ + 0xFB32, /* GIMEL */ + 0xFB33, /* DALET */ + 0xFB34, /* HE */ + 0xFB35, /* VAV */ + 0xFB36, /* ZAYIN */ + 0x0000, /* HET */ + 0xFB38, /* TET */ + 0xFB39, /* YOD */ + 0xFB3A, /* FINAL KAF */ + 0xFB3B, /* KAF */ + 0xFB3C, /* LAMED */ + 0x0000, /* FINAL MEM */ + 0xFB3E, /* MEM */ + 0x0000, /* FINAL NUN */ + 0xFB40, /* NUN */ + 0xFB41, /* SAMEKH */ + 0x0000, /* AYIN */ + 0xFB43, /* FINAL PE */ + 0xFB44, /* PE */ + 0x0000, /* FINAL TSADI */ + 0xFB46, /* TSADI */ + 0xFB47, /* QOF */ + 0xFB48, /* RESH */ + 0xFB49, /* SHIN */ + 0xFB4A /* TAV */ }; bool found = c->unicode->compose (a, b, ab); if (!found && (b & ~0x7F) == 0x0580) { - // special-case Hebrew presentation forms that are excluded from - // standard normalization, but wanted for old fonts + /* Special-case Hebrew presentation forms that are excluded from + * standard normalization, but wanted for old fonts. */ switch (b) { - case 0x05B4: // HIRIQ - if (a == 0x05D9) { // YOD + case 0x05B4: /* HIRIQ */ + if (a == 0x05D9) { /* YOD */ *ab = 0xFB1D; found = true; } break; - case 0x05B7: // patah - if (a == 0x05F2) { // YIDDISH YOD YOD + case 0x05B7: /* patah */ + if (a == 0x05F2) { /* YIDDISH YOD YOD */ *ab = 0xFB1F; found = true; - } else if (a == 0x05D0) { // ALEF + } else if (a == 0x05D0) { /* ALEF */ *ab = 0xFB2E; found = true; } break; - case 0x05B8: // QAMATS - if (a == 0x05D0) { // ALEF + case 0x05B8: /* QAMATS */ + if (a == 0x05D0) { /* ALEF */ *ab = 0xFB2F; found = true; } break; - case 0x05B9: // HOLAM - if (a == 0x05D5) { // VAV + case 0x05B9: /* HOLAM */ + if (a == 0x05D5) { /* VAV */ *ab = 0xFB4B; found = true; } break; - case 0x05BC: // DAGESH + case 0x05BC: /* DAGESH */ if (a >= 0x05D0 && a <= 0x05EA) { *ab = sDageshForms[a - 0x05D0]; found = (*ab != 0); - } else if (a == 0xFB2A) { // SHIN WITH SHIN DOT + } else if (a == 0xFB2A) { /* SHIN WITH SHIN DOT */ *ab = 0xFB2C; found = true; - } else if (a == 0xFB2B) { // SHIN WITH SIN DOT + } else if (a == 0xFB2B) { /* SHIN WITH SIN DOT */ *ab = 0xFB2D; found = true; } break; - case 0x05BF: // RAFE + case 0x05BF: /* RAFE */ switch (a) { - case 0x05D1: // BET + case 0x05D1: /* BET */ *ab = 0xFB4C; found = true; break; - case 0x05DB: // KAF + case 0x05DB: /* KAF */ *ab = 0xFB4D; found = true; break; - case 0x05E4: // PE + case 0x05E4: /* PE */ *ab = 0xFB4E; found = true; break; } break; - case 0x05C1: // SHIN DOT - if (a == 0x05E9) { // SHIN + case 0x05C1: /* SHIN DOT */ + if (a == 0x05E9) { /* SHIN */ *ab = 0xFB2A; found = true; - } else if (a == 0xFB49) { // SHIN WITH DAGESH + } else if (a == 0xFB49) { /* SHIN WITH DAGESH */ *ab = 0xFB2C; found = true; } break; - case 0x05C2: // SIN DOT - if (a == 0x05E9) { // SHIN + case 0x05C2: /* SIN DOT */ + if (a == 0x05E9) { /* SHIN */ *ab = 0xFB2B; found = true; - } else if (a == 0xFB49) { // SHIN WITH DAGESH + } else if (a == 0xFB49) { /* SHIN WITH DAGESH */ *ab = 0xFB2D; found = true; } diff --git a/src/hb-tt-font.cc b/src/hb-tt-font.cc index b7198efdc9f88ccbb139215ee87ed7ebf0a299ce..c503a404380a1d3865e2f46fae6c7b9bdf0686fc 100644 --- a/src/hb-tt-font.cc +++ b/src/hb-tt-font.cc @@ -68,7 +68,7 @@ _hb_tt_font_destroy (hb_tt_font_t *tt) static inline const hhea& _get_hhea (hb_face_t *face) { -// return likely (face->tt && face->tt->hhea) ? *face->tt->hhea : Null(hhea); + return likely (face->tt && face->tt->hhea) ? *face->tt->hhea : Null(hhea); }