diff options
Diffstat (limited to 'pango')
53 files changed, 1972 insertions, 1972 deletions
diff --git a/pango/break.c b/pango/break.c index d3c033d3..e159b024 100644 --- a/pango/break.c +++ b/pango/break.c @@ -345,15 +345,15 @@ static const int line_break_indexes[] = { }; #define BREAK_TYPE_SAFE(btype) \ - (btype < G_N_ELEMENTS(line_break_indexes) ? btype : G_UNICODE_BREAK_UNKNOWN) + (btype < G_N_ELEMENTS(line_break_indexes) ? btype : G_UNICODE_BREAK_UNKNOWN) #define BREAK_INDEX(btype) \ - (line_break_indexes[(btype)]) + (line_break_indexes[(btype)]) #define BREAK_ROW(before_type) \ - (line_break_rows[BREAK_INDEX (before_type)]) + (line_break_rows[BREAK_INDEX (before_type)]) #define BREAK_OP(before_type, after_type) \ - (BREAK_ROW (before_type)[BREAK_INDEX (after_type)]) + (BREAK_ROW (before_type)[BREAK_INDEX (after_type)]) #define IN_BREAK_TABLE(btype) \ - (btype < G_N_ELEMENTS(line_break_indexes) && BREAK_INDEX(btype) < INDEX_END_OF_TABLE) + (btype < G_N_ELEMENTS(line_break_indexes) && BREAK_INDEX(btype) < INDEX_END_OF_TABLE) @@ -425,19 +425,19 @@ static const CharJamoProps HangulJamoProps[] = { */ #define VIRAMA_SCRIPT(wc) ((wc) >= 0x0901 && (wc) <= 0x17FF) #define VIRAMA(wc) ((wc) == 0x094D || \ - (wc) == 0x09CD || \ - (wc) == 0x0A4D || \ - (wc) == 0x0ACD || \ - (wc) == 0x0B4D || \ - (wc) == 0x0BCD || \ - (wc) == 0x0C4D || \ - (wc) == 0x0CCD || \ - (wc) == 0x0D4D || \ - (wc) == 0x0DCA || \ - (wc) == 0x0E3A || \ - (wc) == 0x0F84 || \ - (wc) == 0x1039 || \ - (wc) == 0x17D2) + (wc) == 0x09CD || \ + (wc) == 0x0A4D || \ + (wc) == 0x0ACD || \ + (wc) == 0x0B4D || \ + (wc) == 0x0BCD || \ + (wc) == 0x0C4D || \ + (wc) == 0x0CCD || \ + (wc) == 0x0D4D || \ + (wc) == 0x0DCA || \ + (wc) == 0x0E3A || \ + (wc) == 0x0F84 || \ + (wc) == 0x1039 || \ + (wc) == 0x17D2) /* Types of Japanese characters */ #define JAPANESE(wc) ((wc) >= 0x2F00 && (wc) <= 0x30FF) #define KANJI(wc) ((wc) >= 0x2F00 && (wc) <= 0x2FDF) @@ -502,10 +502,10 @@ typedef enum **/ void pango_default_break (const gchar *text, - gint length, - PangoAnalysis *analysis, - PangoLogAttr *attrs, - int attrs_len) + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) { /* The rationale for all this is in section 5.15 of the Unicode 3.0 book, * the line breaking stuff is also in TR14 on unicode.org @@ -578,41 +578,41 @@ pango_default_break (const gchar *text, break_type = next_break_type; if (almost_done) - { - /* - * If we have already reached the end of @text g_utf8_next_char() - * may not increment next - */ - next_wc = 0; + { + /* + * If we have already reached the end of @text g_utf8_next_char() + * may not increment next + */ + next_wc = 0; next_break_type = G_UNICODE_BREAK_UNKNOWN; done = TRUE; - } + } else - { - next = g_utf8_next_char (next); + { + next = g_utf8_next_char (next); if ((length >= 0 && next >= text + length) || *next == '\0') - { - /* This is how we fill in the last element (end position) of the - * attr array - assume there's a paragraph separators off the end + { + /* This is how we fill in the last element (end position) of the + * attr array - assume there's a paragraph separators off the end * of @text. - */ + */ next_wc = PARAGRAPH_SEPARATOR; almost_done = TRUE; - } - else + } + else next_wc = g_utf8_get_char (next); next_break_type = g_unichar_break_type (next_wc); - next_break_type = BREAK_TYPE_SAFE (next_break_type); - } + next_break_type = BREAK_TYPE_SAFE (next_break_type); + } type = g_unichar_type (wc); jamo = JAMO_TYPE (break_type); /* Determine wheter this forms a Hangul syllable with prev. */ if (jamo == NO_JAMO) - makes_hangul_syllable = FALSE; + makes_hangul_syllable = FALSE; else { JamoType prev_end = HangulJamoProps[prev_jamo].end ; @@ -631,106 +631,106 @@ pango_default_break (const gchar *text, /* ---- Cursor position breaks (Grapheme breaks) ---- */ if (wc == '\n') - { - /* Break before line feed unless prev char is a CR */ - - if (prev_wc != '\r') - attrs[i].is_cursor_position = TRUE; - else - attrs[i].is_cursor_position = FALSE; - } + { + /* Break before line feed unless prev char is a CR */ + + if (prev_wc != '\r') + attrs[i].is_cursor_position = TRUE; + else + attrs[i].is_cursor_position = FALSE; + } else if (i == 0 || - prev_type == G_UNICODE_CONTROL || - prev_type == G_UNICODE_FORMAT) - { - /* Break at first position (must be special cased, or if the - * first char is say a combining mark there won't be a - * cursor position at the start, which seems wrong to me - * ???? - maybe it makes sense though, who knows) - */ - /* break after all format or control characters */ - attrs[i].is_cursor_position = TRUE; - } + prev_type == G_UNICODE_CONTROL || + prev_type == G_UNICODE_FORMAT) + { + /* Break at first position (must be special cased, or if the + * first char is say a combining mark there won't be a + * cursor position at the start, which seems wrong to me + * ???? - maybe it makes sense though, who knows) + */ + /* break after all format or control characters */ + attrs[i].is_cursor_position = TRUE; + } else - { - switch (type) - { - case G_UNICODE_CONTROL: - case G_UNICODE_FORMAT: - /* Break before all format or control characters */ - attrs[i].is_cursor_position = TRUE; - break; - - case G_UNICODE_COMBINING_MARK: - case G_UNICODE_ENCLOSING_MARK: - case G_UNICODE_NON_SPACING_MARK: - /* Unicode spec includes "Combining marks plus Tibetan - * subjoined characters" as joining chars, but lists the - * Tibetan subjoined characters as combining marks, and - * g_unichar_type() returns NON_SPACING_MARK for the Tibetan - * subjoined characters. So who knows, beats me. - */ - - /* It's a joining character, break only if preceded by - * control or format; we already handled the case where - * it was preceded earlier, so here we know it wasn't, - * don't break - */ - attrs[i].is_cursor_position = FALSE; - break; - - case G_UNICODE_LOWERCASE_LETTER: - case G_UNICODE_MODIFIER_LETTER: - case G_UNICODE_OTHER_LETTER: - case G_UNICODE_TITLECASE_LETTER: - case G_UNICODE_UPPERCASE_LETTER: + { + switch (type) + { + case G_UNICODE_CONTROL: + case G_UNICODE_FORMAT: + /* Break before all format or control characters */ + attrs[i].is_cursor_position = TRUE; + break; + + case G_UNICODE_COMBINING_MARK: + case G_UNICODE_ENCLOSING_MARK: + case G_UNICODE_NON_SPACING_MARK: + /* Unicode spec includes "Combining marks plus Tibetan + * subjoined characters" as joining chars, but lists the + * Tibetan subjoined characters as combining marks, and + * g_unichar_type() returns NON_SPACING_MARK for the Tibetan + * subjoined characters. So who knows, beats me. + */ + + /* It's a joining character, break only if preceded by + * control or format; we already handled the case where + * it was preceded earlier, so here we know it wasn't, + * don't break + */ + attrs[i].is_cursor_position = FALSE; + break; + + case G_UNICODE_LOWERCASE_LETTER: + case G_UNICODE_MODIFIER_LETTER: + case G_UNICODE_OTHER_LETTER: + case G_UNICODE_TITLECASE_LETTER: + case G_UNICODE_UPPERCASE_LETTER: if (makes_hangul_syllable) - attrs[i].is_cursor_position = FALSE; - else - { - /* Handle non-Hangul-syllable non-combining chars */ + attrs[i].is_cursor_position = FALSE; + else + { + /* Handle non-Hangul-syllable non-combining chars */ - /* Break before Jamo if they are in a broken sequence or - * next to non-Jamo; break if preceded by Jamo; don't + /* Break before Jamo if they are in a broken sequence or + * next to non-Jamo; break if preceded by Jamo; don't * break if a letter is preceded by a virama; break in * all other cases. No need to check whether we are or are - * preceded by Jamo explicitly, since a Jamo is not - * a virama, we just break in all cases where we - * aren't a or preceded by a virama. Don't fool with + * preceded by Jamo explicitly, since a Jamo is not + * a virama, we just break in all cases where we + * aren't a or preceded by a virama. Don't fool with * viramas if we aren't part of a script that uses them. - */ - - if (VIRAMA_SCRIPT (wc)) - { - /* Check whether we're preceded by a virama; this - * could use some optimization. - */ - if (VIRAMA (prev_wc)) - attrs[i].is_cursor_position = FALSE; - else - attrs[i].is_cursor_position = TRUE; - } - else - { - attrs[i].is_cursor_position = TRUE; - } - } - break; - - default: - /* Some weirdo char, just break here, why not */ - attrs[i].is_cursor_position = TRUE; - break; - } - } + */ + + if (VIRAMA_SCRIPT (wc)) + { + /* Check whether we're preceded by a virama; this + * could use some optimization. + */ + if (VIRAMA (prev_wc)) + attrs[i].is_cursor_position = FALSE; + else + attrs[i].is_cursor_position = TRUE; + } + else + { + attrs[i].is_cursor_position = TRUE; + } + } + break; + + default: + /* Some weirdo char, just break here, why not */ + attrs[i].is_cursor_position = TRUE; + break; + } + } /* If this is a grapheme boundary, we have to decide if backspace * deletes a character or the whole grapheme cluster */ if (attrs[i].is_cursor_position) - attrs[i].backspace_deletes_character = BACKSPACE_DELETES_CHARACTER (base_character); + attrs[i].backspace_deletes_character = BACKSPACE_DELETES_CHARACTER (base_character); else - attrs[i].backspace_deletes_character = FALSE; + attrs[i].backspace_deletes_character = FALSE; /* ---- Line breaking ---- */ @@ -742,9 +742,9 @@ pango_default_break (const gchar *text, attrs[i].is_mandatory_break = FALSE; if (attrs[i].is_cursor_position) /* If it's not a grapheme boundary, - * it's not a line break either - */ - { + * it's not a line break either + */ + { /* space followed by a combining mark is handled * specially; (rule 7a from TR 14) */ @@ -752,15 +752,15 @@ pango_default_break (const gchar *text, next_break_type == G_UNICODE_BREAK_COMBINING_MARK) break_type = G_UNICODE_BREAK_IDEOGRAPHIC; - /* Unicode doesn't specify char wrap; we wrap around all chars - * except where a line break is prohibited, which means we - * effectively break everywhere except inside runs of spaces. - */ - attrs[i].is_char_break = TRUE; + /* Unicode doesn't specify char wrap; we wrap around all chars + * except where a line break is prohibited, which means we + * effectively break everywhere except inside runs of spaces. + */ + attrs[i].is_char_break = TRUE; /* Make any necessary replacements first */ - switch (prev_break_type) - { + switch (prev_break_type) + { case G_UNICODE_BREAK_HANGUL_L_JAMO: case G_UNICODE_BREAK_HANGUL_V_JAMO: case G_UNICODE_BREAK_HANGUL_T_JAMO: @@ -771,16 +771,16 @@ pango_default_break (const gchar *text, prev_break_type = G_UNICODE_BREAK_IDEOGRAPHIC; break; - case G_UNICODE_BREAK_AMBIGUOUS: + case G_UNICODE_BREAK_AMBIGUOUS: /* FIXME - * we need to resolve the East Asian width - * to decide what to do here + * we need to resolve the East Asian width + * to decide what to do here */ - case G_UNICODE_BREAK_COMPLEX_CONTEXT: + case G_UNICODE_BREAK_COMPLEX_CONTEXT: /* FIXME - * language engines should handle this case... + * language engines should handle this case... */ - case G_UNICODE_BREAK_UNKNOWN: + case G_UNICODE_BREAK_UNKNOWN: /* convert unknown, complex, ambiguous to ALPHABETIC */ prev_break_type = G_UNICODE_BREAK_ALPHABETIC; @@ -790,71 +790,71 @@ pango_default_break (const gchar *text, ; } - switch (prev_break_type) - { - case G_UNICODE_BREAK_MANDATORY: - case G_UNICODE_BREAK_LINE_FEED: - case G_UNICODE_BREAK_NEXT_LINE: - attrs[i].is_line_break = TRUE; - attrs[i].is_mandatory_break = TRUE; - break; - - case G_UNICODE_BREAK_CARRIAGE_RETURN: - if (wc != '\n') - { - attrs[i].is_line_break = TRUE; - attrs[i].is_mandatory_break = TRUE; - } - break; - - case G_UNICODE_BREAK_CONTINGENT: - /* can break after 0xFFFC by default, though we might want - * to eventually have a PangoLayout setting or - * PangoAttribute that disables this, if for some - * application breaking after objects is not desired. - */ - break_op = BREAK_ALLOWED; - break; - - case G_UNICODE_BREAK_SURROGATE: + switch (prev_break_type) + { + case G_UNICODE_BREAK_MANDATORY: + case G_UNICODE_BREAK_LINE_FEED: + case G_UNICODE_BREAK_NEXT_LINE: + attrs[i].is_line_break = TRUE; + attrs[i].is_mandatory_break = TRUE; + break; + + case G_UNICODE_BREAK_CARRIAGE_RETURN: + if (wc != '\n') + { + attrs[i].is_line_break = TRUE; + attrs[i].is_mandatory_break = TRUE; + } + break; + + case G_UNICODE_BREAK_CONTINGENT: + /* can break after 0xFFFC by default, though we might want + * to eventually have a PangoLayout setting or + * PangoAttribute that disables this, if for some + * application breaking after objects is not desired. + */ + break_op = BREAK_ALLOWED; + break; + + case G_UNICODE_BREAK_SURROGATE: g_assert_not_reached (); - break; - - default: - g_assert (IN_BREAK_TABLE (prev_break_type)); - - /* Note that our table assumes that combining marks - * are only applied to alphabetic characters; - * tech report 14 explains how to remove this assumption - * from the code, if anyone ever cares, but it shouldn't - * be a problem. Also this issue sort of goes - * away since we only look for breaks on grapheme - * boundaries. - */ - - switch (break_type) - { - case G_UNICODE_BREAK_MANDATORY: - case G_UNICODE_BREAK_LINE_FEED: - case G_UNICODE_BREAK_CARRIAGE_RETURN: - case G_UNICODE_BREAK_NEXT_LINE: - case G_UNICODE_BREAK_SPACE: - /* These types all "pile up" at the end of lines and - * get elided. - */ - break_op = BREAK_PROHIBITED; - break; - - case G_UNICODE_BREAK_CONTINGENT: - /* break before 0xFFFC by default, eventually - * make this configurable? - */ - break_op = BREAK_ALLOWED; - break; - - case G_UNICODE_BREAK_SURROGATE: + break; + + default: + g_assert (IN_BREAK_TABLE (prev_break_type)); + + /* Note that our table assumes that combining marks + * are only applied to alphabetic characters; + * tech report 14 explains how to remove this assumption + * from the code, if anyone ever cares, but it shouldn't + * be a problem. Also this issue sort of goes + * away since we only look for breaks on grapheme + * boundaries. + */ + + switch (break_type) + { + case G_UNICODE_BREAK_MANDATORY: + case G_UNICODE_BREAK_LINE_FEED: + case G_UNICODE_BREAK_CARRIAGE_RETURN: + case G_UNICODE_BREAK_NEXT_LINE: + case G_UNICODE_BREAK_SPACE: + /* These types all "pile up" at the end of lines and + * get elided. + */ + break_op = BREAK_PROHIBITED; + break; + + case G_UNICODE_BREAK_CONTINGENT: + /* break before 0xFFFC by default, eventually + * make this configurable? + */ + break_op = BREAK_ALLOWED; + break; + + case G_UNICODE_BREAK_SURROGATE: g_assert_not_reached (); - break; + break; /* Hangul additions are from Unicode 4.1 UAX#14 */ case G_UNICODE_BREAK_HANGUL_L_JAMO: @@ -862,9 +862,9 @@ pango_default_break (const gchar *text, case G_UNICODE_BREAK_HANGUL_T_JAMO: case G_UNICODE_BREAK_HANGUL_LV_SYLLABLE: case G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE: - /* treat Jamo as IDEOGRAPHIC from now + /* treat Jamo as IDEOGRAPHIC from now */ - break_type = G_UNICODE_BREAK_IDEOGRAPHIC; + break_type = G_UNICODE_BREAK_IDEOGRAPHIC; if (makes_hangul_syllable) break_op = BREAK_IF_SPACES; @@ -882,55 +882,55 @@ pango_default_break (const gchar *text, * language engines should handle this case... */ case G_UNICODE_BREAK_UNKNOWN: - /* treat unknown, complex, and ambiguous like ALPHABETIC + /* treat unknown, complex, and ambiguous like ALPHABETIC * for now - */ - break_op = BREAK_OP (prev_break_type, G_UNICODE_BREAK_ALPHABETIC); - break; + */ + break_op = BREAK_OP (prev_break_type, G_UNICODE_BREAK_ALPHABETIC); + break; default: g_assert (IN_BREAK_TABLE (break_type)); - break_op = BREAK_OP (prev_break_type, break_type); - break; - } - break; - } - - if (break_op != BREAK_ALREADY_HANDLED) - { - switch (break_op) - { - case BREAK_PROHIBITED: - /* can't break here */ - attrs[i].is_char_break = FALSE; - break; - - case BREAK_IF_SPACES: - /* break if prev char was space */ - if (prev_was_break_space) - attrs[i].is_line_break = TRUE; - break; - - case BREAK_ALLOWED: - attrs[i].is_line_break = TRUE; - break; - - default: - g_assert_not_reached (); - break; - } - } - } + break_op = BREAK_OP (prev_break_type, break_type); + break; + } + break; + } + + if (break_op != BREAK_ALREADY_HANDLED) + { + switch (break_op) + { + case BREAK_PROHIBITED: + /* can't break here */ + attrs[i].is_char_break = FALSE; + break; + + case BREAK_IF_SPACES: + /* break if prev char was space */ + if (prev_was_break_space) + attrs[i].is_line_break = TRUE; + break; + + case BREAK_ALLOWED: + attrs[i].is_line_break = TRUE; + break; + + default: + g_assert_not_reached (); + break; + } + } + } if (break_type != G_UNICODE_BREAK_SPACE) - { - prev_break_type = break_type; - prev_was_break_space = FALSE; + { + prev_break_type = break_type; + prev_was_break_space = FALSE; prev_jamo = jamo; - } + } else - prev_was_break_space = TRUE; + prev_was_break_space = TRUE; /* ---- Word breaks ---- */ @@ -939,100 +939,100 @@ pango_default_break (const gchar *text, attrs[i].is_word_end = FALSE; if (current_word_type != WordNone) - { - /* Check for a word end */ - switch (type) - { - case G_UNICODE_COMBINING_MARK: - case G_UNICODE_ENCLOSING_MARK: - case G_UNICODE_NON_SPACING_MARK: + { + /* Check for a word end */ + switch (type) + { + case G_UNICODE_COMBINING_MARK: + case G_UNICODE_ENCLOSING_MARK: + case G_UNICODE_NON_SPACING_MARK: case G_UNICODE_FORMAT: - /* nothing, we just eat these up as part of the word */ - break; - - case G_UNICODE_LOWERCASE_LETTER: - case G_UNICODE_MODIFIER_LETTER: - case G_UNICODE_OTHER_LETTER: - case G_UNICODE_TITLECASE_LETTER: - case G_UNICODE_UPPERCASE_LETTER: - if (current_word_type == WordLetters) - { - /* Japanese special cases for ending the word */ - if (JAPANESE (last_word_letter) || - JAPANESE (wc)) - { - if ((HIRAGANA (last_word_letter) && - !HIRAGANA (wc)) || - (KATAKANA (last_word_letter) && - !(KATAKANA (wc) || HIRAGANA (wc))) || - (KANJI (last_word_letter) && - !(HIRAGANA (wc) || KANJI (wc))) || - (JAPANESE (last_word_letter) && - !JAPANESE (wc)) || - (!JAPANESE (last_word_letter) && - JAPANESE (wc))) - attrs[i].is_word_end = TRUE; - } - } - else - { - /* end the number word, start the letter word */ - attrs[i].is_word_end = TRUE; - attrs[i].is_word_start = TRUE; - current_word_type = WordLetters; - } - - last_word_letter = wc; - break; - - case G_UNICODE_DECIMAL_NUMBER: - case G_UNICODE_LETTER_NUMBER: - case G_UNICODE_OTHER_NUMBER: - if (current_word_type != WordNumbers) - { - attrs[i].is_word_end = TRUE; - attrs[i].is_word_start = TRUE; - current_word_type = WordNumbers; - } - - last_word_letter = wc; - break; - - default: - /* Punctuation, control/format chars, etc. all end a word. */ - attrs[i].is_word_end = TRUE; + /* nothing, we just eat these up as part of the word */ + break; + + case G_UNICODE_LOWERCASE_LETTER: + case G_UNICODE_MODIFIER_LETTER: + case G_UNICODE_OTHER_LETTER: + case G_UNICODE_TITLECASE_LETTER: + case G_UNICODE_UPPERCASE_LETTER: + if (current_word_type == WordLetters) + { + /* Japanese special cases for ending the word */ + if (JAPANESE (last_word_letter) || + JAPANESE (wc)) + { + if ((HIRAGANA (last_word_letter) && + !HIRAGANA (wc)) || + (KATAKANA (last_word_letter) && + !(KATAKANA (wc) || HIRAGANA (wc))) || + (KANJI (last_word_letter) && + !(HIRAGANA (wc) || KANJI (wc))) || + (JAPANESE (last_word_letter) && + !JAPANESE (wc)) || + (!JAPANESE (last_word_letter) && + JAPANESE (wc))) + attrs[i].is_word_end = TRUE; + } + } + else + { + /* end the number word, start the letter word */ + attrs[i].is_word_end = TRUE; + attrs[i].is_word_start = TRUE; + current_word_type = WordLetters; + } + + last_word_letter = wc; + break; + + case G_UNICODE_DECIMAL_NUMBER: + case G_UNICODE_LETTER_NUMBER: + case G_UNICODE_OTHER_NUMBER: + if (current_word_type != WordNumbers) + { + attrs[i].is_word_end = TRUE; + attrs[i].is_word_start = TRUE; + current_word_type = WordNumbers; + } + + last_word_letter = wc; + break; + + default: + /* Punctuation, control/format chars, etc. all end a word. */ + attrs[i].is_word_end = TRUE; current_word_type = WordNone; - break; - } - } + break; + } + } else - { - /* Check for a word start */ - switch (type) - { - case G_UNICODE_LOWERCASE_LETTER: - case G_UNICODE_MODIFIER_LETTER: - case G_UNICODE_OTHER_LETTER: - case G_UNICODE_TITLECASE_LETTER: - case G_UNICODE_UPPERCASE_LETTER: - current_word_type = WordLetters; - last_word_letter = wc; - attrs[i].is_word_start = TRUE; - break; - - case G_UNICODE_DECIMAL_NUMBER: - case G_UNICODE_LETTER_NUMBER: - case G_UNICODE_OTHER_NUMBER: - current_word_type = WordNumbers; - last_word_letter = wc; - attrs[i].is_word_start = TRUE; - break; - - default: - /* No word here */ - break; - } - } + { + /* Check for a word start */ + switch (type) + { + case G_UNICODE_LOWERCASE_LETTER: + case G_UNICODE_MODIFIER_LETTER: + case G_UNICODE_OTHER_LETTER: + case G_UNICODE_TITLECASE_LETTER: + case G_UNICODE_UPPERCASE_LETTER: + current_word_type = WordLetters; + last_word_letter = wc; + attrs[i].is_word_start = TRUE; + break; + + case G_UNICODE_DECIMAL_NUMBER: + case G_UNICODE_LETTER_NUMBER: + case G_UNICODE_OTHER_NUMBER: + current_word_type = WordNumbers; + last_word_letter = wc; + attrs[i].is_word_start = TRUE; + break; + + default: + /* No word here */ + break; + } + } /* ---- Sentence breaks ---- */ @@ -1050,21 +1050,21 @@ pango_default_break (const gchar *text, */ #define MAYBE_START_NEW_SENTENCE \ - switch (type) \ - { \ - case G_UNICODE_LINE_SEPARATOR: \ - case G_UNICODE_PARAGRAPH_SEPARATOR: \ - case G_UNICODE_CONTROL: \ - case G_UNICODE_FORMAT: \ - case G_UNICODE_SPACE_SEPARATOR: \ - sentence_state = STATE_SENTENCE_OUTSIDE; \ - break; \ - \ - default: \ - sentence_state = STATE_SENTENCE_BODY; \ - attrs[i].is_sentence_start = TRUE; \ - break; \ - } + switch (type) \ + { \ + case G_UNICODE_LINE_SEPARATOR: \ + case G_UNICODE_PARAGRAPH_SEPARATOR: \ + case G_UNICODE_CONTROL: \ + case G_UNICODE_FORMAT: \ + case G_UNICODE_SPACE_SEPARATOR: \ + sentence_state = STATE_SENTENCE_OUTSIDE; \ + break; \ + \ + default: \ + sentence_state = STATE_SENTENCE_BODY; \ + attrs[i].is_sentence_start = TRUE; \ + break; \ + } /* No sentence break at the start of the text */ @@ -1084,374 +1084,374 @@ pango_default_break (const gchar *text, * followed by newline */ switch (prev_type) - { - case G_UNICODE_LINE_SEPARATOR: - case G_UNICODE_PARAGRAPH_SEPARATOR: - case G_UNICODE_CONTROL: - case G_UNICODE_FORMAT: - if (wc == '\r') - { - if (next_wc != '\n') - attrs[i].is_sentence_boundary = TRUE; - } - else - attrs[i].is_sentence_boundary = TRUE; - break; - - default: - break; - } + { + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + case G_UNICODE_CONTROL: + case G_UNICODE_FORMAT: + if (wc == '\r') + { + if (next_wc != '\n') + attrs[i].is_sentence_boundary = TRUE; + } + else + attrs[i].is_sentence_boundary = TRUE; + break; + + default: + break; + } /* break before para/line separators except newline following * carriage return */ switch (type) - { - case G_UNICODE_LINE_SEPARATOR: - case G_UNICODE_PARAGRAPH_SEPARATOR: - case G_UNICODE_CONTROL: - case G_UNICODE_FORMAT: - if (wc == '\n') - { - if (prev_wc != '\r') - attrs[i].is_sentence_boundary = TRUE; - } - else - attrs[i].is_sentence_boundary = TRUE; - break; - - default: - break; - } + { + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + case G_UNICODE_CONTROL: + case G_UNICODE_FORMAT: + if (wc == '\n') + { + if (prev_wc != '\r') + attrs[i].is_sentence_boundary = TRUE; + } + else + attrs[i].is_sentence_boundary = TRUE; + break; + + default: + break; + } switch (sentence_state) - { - case STATE_SENTENCE_OUTSIDE: - /* Start sentence if we have non-whitespace/format/control */ - switch (type) - { - case G_UNICODE_LINE_SEPARATOR: - case G_UNICODE_PARAGRAPH_SEPARATOR: - case G_UNICODE_CONTROL: - case G_UNICODE_FORMAT: - case G_UNICODE_SPACE_SEPARATOR: - break; - - default: - attrs[i].is_sentence_start = TRUE; - sentence_state = STATE_SENTENCE_BODY; - break; - } - break; - - case STATE_SENTENCE_BODY: - /* If we already broke here due to separators, end the sentence. */ - if (attrs[i].is_sentence_boundary) - { - attrs[i].is_sentence_end = TRUE; - - MAYBE_START_NEW_SENTENCE; - } - else - { - if (wc == '.') - sentence_state = STATE_SENTENCE_DOT; - else if (wc == '?' || wc == '!') - sentence_state = STATE_SENTENCE_TERM; - } - break; - - case STATE_SENTENCE_TERM: - /* End sentence on anything but close punctuation and some - * loosely-specified OTHER_PUNCTUATION such as period, - * comma, etc.; follow Unicode rules for breaks - */ - switch (type) - { - case G_UNICODE_OTHER_PUNCTUATION: - case G_UNICODE_CLOSE_PUNCTUATION: - if (type == G_UNICODE_CLOSE_PUNCTUATION || - wc == '.' || - wc == ',' || - wc == '?' || - wc == '!') - sentence_state = STATE_SENTENCE_POST_TERM_CLOSE; - else - { - attrs[i].is_sentence_end = TRUE; - attrs[i].is_sentence_boundary = TRUE; - - MAYBE_START_NEW_SENTENCE; - } - break; - - case G_UNICODE_SPACE_SEPARATOR: - attrs[i].is_sentence_end = TRUE; - sentence_state = STATE_SENTENCE_POST_TERM_SPACE; - break; - - case G_UNICODE_LINE_SEPARATOR: - case G_UNICODE_PARAGRAPH_SEPARATOR: - attrs[i].is_sentence_end = TRUE; - sentence_state = STATE_SENTENCE_POST_TERM_SEP; - break; - - default: - attrs[i].is_sentence_end = TRUE; - attrs[i].is_sentence_boundary = TRUE; - - MAYBE_START_NEW_SENTENCE; - - break; - } - break; - - case STATE_SENTENCE_POST_TERM_CLOSE: - /* End sentence on anything besides more punctuation; follow - * rules for breaks - */ - switch (type) - { - case G_UNICODE_OTHER_PUNCTUATION: - case G_UNICODE_CLOSE_PUNCTUATION: - if (type == G_UNICODE_CLOSE_PUNCTUATION || - wc == '.' || - wc == ',' || - wc == '?' || - wc == '!') - /* continue in this state */ - ; - else - { - attrs[i].is_sentence_end = TRUE; - attrs[i].is_sentence_boundary = TRUE; - - MAYBE_START_NEW_SENTENCE; - } - break; - - case G_UNICODE_SPACE_SEPARATOR: - attrs[i].is_sentence_end = TRUE; - sentence_state = STATE_SENTENCE_POST_TERM_SPACE; - break; - - case G_UNICODE_LINE_SEPARATOR: - case G_UNICODE_PARAGRAPH_SEPARATOR: - attrs[i].is_sentence_end = TRUE; - /* undo the unconditional break-at-all-line/para-separators - * from above; I'm not sure this is what the Unicode spec - * intends, but it seems right - we get to include - * a single line/para separator in the sentence according - * to their rules - */ - attrs[i].is_sentence_boundary = FALSE; - sentence_state = STATE_SENTENCE_POST_TERM_SEP; - break; - - default: - attrs[i].is_sentence_end = TRUE; - attrs[i].is_sentence_boundary = TRUE; - - MAYBE_START_NEW_SENTENCE; - - break; - } - break; - - case STATE_SENTENCE_POST_TERM_SPACE: - - /* Sentence is definitely already ended; to enter this state - * we had to see a space, which ends the sentence. - */ - - switch (type) - { - case G_UNICODE_SPACE_SEPARATOR: - /* continue in this state */ - break; - - case G_UNICODE_LINE_SEPARATOR: - case G_UNICODE_PARAGRAPH_SEPARATOR: - /* undo the unconditional break-at-all-line/para-separators - * from above; I'm not sure this is what the Unicode spec - * intends, but it seems right - */ - attrs[i].is_sentence_boundary = FALSE; - sentence_state = STATE_SENTENCE_POST_TERM_SEP; - break; - - default: - attrs[i].is_sentence_boundary = TRUE; - - MAYBE_START_NEW_SENTENCE; - - break; - } - break; - - case STATE_SENTENCE_POST_TERM_SEP: - /* Break is forced at this point, unless we're a newline - * after a CR, then we will break after the newline on the - * next iteration. Only a single Sep can be in the - * sentence. - */ - if (!(prev_wc == '\r' && wc == '\n')) - attrs[i].is_sentence_boundary = TRUE; - - MAYBE_START_NEW_SENTENCE; - - break; - - case STATE_SENTENCE_DOT: - switch (type) - { - case G_UNICODE_CLOSE_PUNCTUATION: - sentence_state = STATE_SENTENCE_POST_DOT_CLOSE; - break; - - case G_UNICODE_SPACE_SEPARATOR: - possible_sentence_end = i; - sentence_state = STATE_SENTENCE_POST_DOT_SPACE; - break; - - default: - /* If we broke on a control/format char, end the - * sentence; else this was not a sentence end, since - * we didn't enter the POST_DOT_SPACE state. - */ - if (attrs[i].is_sentence_boundary) - { - attrs[i].is_sentence_end = TRUE; - - MAYBE_START_NEW_SENTENCE; - } - else - sentence_state = STATE_SENTENCE_BODY; - break; - } - break; - - case STATE_SENTENCE_POST_DOT_CLOSE: - switch (type) - { - case G_UNICODE_SPACE_SEPARATOR: - possible_sentence_end = i; - sentence_state = STATE_SENTENCE_POST_DOT_SPACE; - break; - - default: - /* If we broke on a control/format char, end the - * sentence; else this was not a sentence end, since - * we didn't enter the POST_DOT_SPACE state. - */ - if (attrs[i].is_sentence_boundary) - { - attrs[i].is_sentence_end = TRUE; - - MAYBE_START_NEW_SENTENCE; - } - else - sentence_state = STATE_SENTENCE_BODY; - break; - } - break; - - case STATE_SENTENCE_POST_DOT_SPACE: - - possible_sentence_boundary = i; - - switch (type) - { - case G_UNICODE_SPACE_SEPARATOR: - /* remain in current state */ - break; - - case G_UNICODE_OPEN_PUNCTUATION: - sentence_state = STATE_SENTENCE_POST_DOT_OPEN; - break; - - case G_UNICODE_LOWERCASE_LETTER: - /* wasn't a sentence-ending period; so re-enter the sentence - * body - */ - sentence_state = STATE_SENTENCE_BODY; - break; - - default: - /* End the sentence, break, maybe start a new one */ - - g_assert (possible_sentence_end >= 0); - g_assert (possible_sentence_boundary >= 0); - - attrs[possible_sentence_boundary].is_sentence_boundary = TRUE; - attrs[possible_sentence_end].is_sentence_end = TRUE; - - possible_sentence_end = -1; - possible_sentence_boundary = -1; - - MAYBE_START_NEW_SENTENCE; - - break; - } - break; - - case STATE_SENTENCE_POST_DOT_OPEN: - switch (type) - { - case G_UNICODE_OPEN_PUNCTUATION: - /* continue in current state */ - break; - - case G_UNICODE_LOWERCASE_LETTER: - /* wasn't a sentence-ending period; so re-enter the sentence - * body - */ - sentence_state = STATE_SENTENCE_BODY; - break; - - default: - /* End the sentence, break, maybe start a new one */ - - g_assert (possible_sentence_end >= 0); - g_assert (possible_sentence_boundary >= 0); - - attrs[possible_sentence_boundary].is_sentence_boundary = TRUE; - attrs[possible_sentence_end].is_sentence_end = TRUE; - - possible_sentence_end = -1; - possible_sentence_boundary = -1; - - MAYBE_START_NEW_SENTENCE; - - break; - } - break; - - case STATE_SENTENCE_POST_DOT_SEP: - /* Break is forced at this point, unless we're a newline - * after a CR, then we will break after the newline on the - * next iteration. Only a single Sep can be in the - * sentence. - */ - if (!(prev_wc == '\r' && wc == '\n')) - attrs[i].is_sentence_boundary = TRUE; + { + case STATE_SENTENCE_OUTSIDE: + /* Start sentence if we have non-whitespace/format/control */ + switch (type) + { + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + case G_UNICODE_CONTROL: + case G_UNICODE_FORMAT: + case G_UNICODE_SPACE_SEPARATOR: + break; - g_assert (possible_sentence_end >= 0); - g_assert (possible_sentence_boundary >= 0); + default: + attrs[i].is_sentence_start = TRUE; + sentence_state = STATE_SENTENCE_BODY; + break; + } + break; - attrs[possible_sentence_end].is_sentence_end = TRUE; + case STATE_SENTENCE_BODY: + /* If we already broke here due to separators, end the sentence. */ + if (attrs[i].is_sentence_boundary) + { + attrs[i].is_sentence_end = TRUE; - possible_sentence_end = -1; - possible_sentence_boundary = -1; + MAYBE_START_NEW_SENTENCE; + } + else + { + if (wc == '.') + sentence_state = STATE_SENTENCE_DOT; + else if (wc == '?' || wc == '!') + sentence_state = STATE_SENTENCE_TERM; + } + break; - MAYBE_START_NEW_SENTENCE; + case STATE_SENTENCE_TERM: + /* End sentence on anything but close punctuation and some + * loosely-specified OTHER_PUNCTUATION such as period, + * comma, etc.; follow Unicode rules for breaks + */ + switch (type) + { + case G_UNICODE_OTHER_PUNCTUATION: + case G_UNICODE_CLOSE_PUNCTUATION: + if (type == G_UNICODE_CLOSE_PUNCTUATION || + wc == '.' || + wc == ',' || + wc == '?' || + wc == '!') + sentence_state = STATE_SENTENCE_POST_TERM_CLOSE; + else + { + attrs[i].is_sentence_end = TRUE; + attrs[i].is_sentence_boundary = TRUE; + + MAYBE_START_NEW_SENTENCE; + } + break; + + case G_UNICODE_SPACE_SEPARATOR: + attrs[i].is_sentence_end = TRUE; + sentence_state = STATE_SENTENCE_POST_TERM_SPACE; + break; + + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + attrs[i].is_sentence_end = TRUE; + sentence_state = STATE_SENTENCE_POST_TERM_SEP; + break; + + default: + attrs[i].is_sentence_end = TRUE; + attrs[i].is_sentence_boundary = TRUE; + + MAYBE_START_NEW_SENTENCE; + + break; + } + break; + + case STATE_SENTENCE_POST_TERM_CLOSE: + /* End sentence on anything besides more punctuation; follow + * rules for breaks + */ + switch (type) + { + case G_UNICODE_OTHER_PUNCTUATION: + case G_UNICODE_CLOSE_PUNCTUATION: + if (type == G_UNICODE_CLOSE_PUNCTUATION || + wc == '.' || + wc == ',' || + wc == '?' || + wc == '!') + /* continue in this state */ + ; + else + { + attrs[i].is_sentence_end = TRUE; + attrs[i].is_sentence_boundary = TRUE; + + MAYBE_START_NEW_SENTENCE; + } + break; + + case G_UNICODE_SPACE_SEPARATOR: + attrs[i].is_sentence_end = TRUE; + sentence_state = STATE_SENTENCE_POST_TERM_SPACE; + break; + + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + attrs[i].is_sentence_end = TRUE; + /* undo the unconditional break-at-all-line/para-separators + * from above; I'm not sure this is what the Unicode spec + * intends, but it seems right - we get to include + * a single line/para separator in the sentence according + * to their rules + */ + attrs[i].is_sentence_boundary = FALSE; + sentence_state = STATE_SENTENCE_POST_TERM_SEP; + break; + + default: + attrs[i].is_sentence_end = TRUE; + attrs[i].is_sentence_boundary = TRUE; + + MAYBE_START_NEW_SENTENCE; + + break; + } + break; + + case STATE_SENTENCE_POST_TERM_SPACE: + + /* Sentence is definitely already ended; to enter this state + * we had to see a space, which ends the sentence. + */ + + switch (type) + { + case G_UNICODE_SPACE_SEPARATOR: + /* continue in this state */ + break; + + case G_UNICODE_LINE_SEPARATOR: + case G_UNICODE_PARAGRAPH_SEPARATOR: + /* undo the unconditional break-at-all-line/para-separators + * from above; I'm not sure this is what the Unicode spec + * intends, but it seems right + */ + attrs[i].is_sentence_boundary = FALSE; + sentence_state = STATE_SENTENCE_POST_TERM_SEP; + break; + + default: + attrs[i].is_sentence_boundary = TRUE; + + MAYBE_START_NEW_SENTENCE; + + break; + } + break; + + case STATE_SENTENCE_POST_TERM_SEP: + /* Break is forced at this point, unless we're a newline + * after a CR, then we will break after the newline on the + * next iteration. Only a single Sep can be in the + * sentence. + */ + if (!(prev_wc == '\r' && wc == '\n')) + attrs[i].is_sentence_boundary = TRUE; - break; + MAYBE_START_NEW_SENTENCE; - default: - g_assert_not_reached (); - break; - } + break; + + case STATE_SENTENCE_DOT: + switch (type) + { + case G_UNICODE_CLOSE_PUNCTUATION: + sentence_state = STATE_SENTENCE_POST_DOT_CLOSE; + break; + + case G_UNICODE_SPACE_SEPARATOR: + possible_sentence_end = i; + sentence_state = STATE_SENTENCE_POST_DOT_SPACE; + break; + + default: + /* If we broke on a control/format char, end the + * sentence; else this was not a sentence end, since + * we didn't enter the POST_DOT_SPACE state. + */ + if (attrs[i].is_sentence_boundary) + { + attrs[i].is_sentence_end = TRUE; + + MAYBE_START_NEW_SENTENCE; + } + else + sentence_state = STATE_SENTENCE_BODY; + break; + } + break; + + case STATE_SENTENCE_POST_DOT_CLOSE: + switch (type) + { + case G_UNICODE_SPACE_SEPARATOR: + possible_sentence_end = i; + sentence_state = STATE_SENTENCE_POST_DOT_SPACE; + break; + + default: + /* If we broke on a control/format char, end the + * sentence; else this was not a sentence end, since + * we didn't enter the POST_DOT_SPACE state. + */ + if (attrs[i].is_sentence_boundary) + { + attrs[i].is_sentence_end = TRUE; + + MAYBE_START_NEW_SENTENCE; + } + else + sentence_state = STATE_SENTENCE_BODY; + break; + } + break; + + case STATE_SENTENCE_POST_DOT_SPACE: + + possible_sentence_boundary = i; + + switch (type) + { + case G_UNICODE_SPACE_SEPARATOR: + /* remain in current state */ + break; + + case G_UNICODE_OPEN_PUNCTUATION: + sentence_state = STATE_SENTENCE_POST_DOT_OPEN; + break; + + case G_UNICODE_LOWERCASE_LETTER: + /* wasn't a sentence-ending period; so re-enter the sentence + * body + */ + sentence_state = STATE_SENTENCE_BODY; + break; + + default: + /* End the sentence, break, maybe start a new one */ + + g_assert (possible_sentence_end >= 0); + g_assert (possible_sentence_boundary >= 0); + + attrs[possible_sentence_boundary].is_sentence_boundary = TRUE; + attrs[possible_sentence_end].is_sentence_end = TRUE; + + possible_sentence_end = -1; + possible_sentence_boundary = -1; + + MAYBE_START_NEW_SENTENCE; + + break; + } + break; + + case STATE_SENTENCE_POST_DOT_OPEN: + switch (type) + { + case G_UNICODE_OPEN_PUNCTUATION: + /* continue in current state */ + break; + + case G_UNICODE_LOWERCASE_LETTER: + /* wasn't a sentence-ending period; so re-enter the sentence + * body + */ + sentence_state = STATE_SENTENCE_BODY; + break; + + default: + /* End the sentence, break, maybe start a new one */ + + g_assert (possible_sentence_end >= 0); + g_assert (possible_sentence_boundary >= 0); + + attrs[possible_sentence_boundary].is_sentence_boundary = TRUE; + attrs[possible_sentence_end].is_sentence_end = TRUE; + + possible_sentence_end = -1; + possible_sentence_boundary = -1; + + MAYBE_START_NEW_SENTENCE; + + break; + } + break; + + case STATE_SENTENCE_POST_DOT_SEP: + /* Break is forced at this point, unless we're a newline + * after a CR, then we will break after the newline on the + * next iteration. Only a single Sep can be in the + * sentence. + */ + if (!(prev_wc == '\r' && wc == '\n')) + attrs[i].is_sentence_boundary = TRUE; + + g_assert (possible_sentence_end >= 0); + g_assert (possible_sentence_boundary >= 0); + + attrs[possible_sentence_end].is_sentence_end = TRUE; + + possible_sentence_end = -1; + possible_sentence_boundary = -1; + + MAYBE_START_NEW_SENTENCE; + + break; + + default: + g_assert_not_reached (); + break; + } prev_type = type; prev_wc = wc; @@ -1459,18 +1459,18 @@ pango_default_break (const gchar *text, /* wc might not be a valid Unicode base character, but really all we * need to know is the last non-combining character */ if (type != G_UNICODE_COMBINING_MARK && - type != G_UNICODE_ENCLOSING_MARK && - type != G_UNICODE_NON_SPACING_MARK) - base_character = wc; + type != G_UNICODE_ENCLOSING_MARK && + type != G_UNICODE_NON_SPACING_MARK) + base_character = wc; } } static gboolean tailor_break (const gchar *text, - gint length, - PangoAnalysis *analysis, - PangoLogAttr *attrs, - int attrs_len) + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) { if (analysis->lang_engine && PANGO_ENGINE_LANG_GET_CLASS (analysis->lang_engine)->script_break) { @@ -1499,10 +1499,10 @@ tailor_break (const gchar *text, */ void pango_break (const gchar *text, - gint length, - PangoAnalysis *analysis, - PangoLogAttr *attrs, - int attrs_len) + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len) { g_return_if_fail (analysis != NULL); g_return_if_fail (attrs != NULL); @@ -1531,9 +1531,9 @@ pango_break (const gchar *text, **/ void pango_find_paragraph_boundary (const gchar *text, - gint length, - gint *paragraph_delimiter_index, - gint *next_paragraph_start) + gint length, + gint *paragraph_delimiter_index, + gint *next_paragraph_start) { const gchar *p = text; const gchar *end; @@ -1570,29 +1570,29 @@ pango_find_paragraph_boundary (const gchar *text, while (p != end) { if (prev_sep == '\n' || - prev_sep == PARAGRAPH_SEPARATOR_STRING[0]) - { - g_assert (delimiter); - start = p; - break; - } + prev_sep == PARAGRAPH_SEPARATOR_STRING[0]) + { + g_assert (delimiter); + start = p; + break; + } else if (prev_sep == '\r') - { - /* don't break between \r and \n */ - if (*p != '\n') - { - g_assert (delimiter); - start = p; - break; - } - } + { + /* don't break between \r and \n */ + if (*p != '\n') + { + g_assert (delimiter); + start = p; + break; + } + } if (*p == '\n' || - *p == '\r' || - !strncmp(p, PARAGRAPH_SEPARATOR_STRING, + *p == '\r' || + !strncmp(p, PARAGRAPH_SEPARATOR_STRING, strlen(PARAGRAPH_SEPARATOR_STRING))) - { - if (delimiter == NULL) + { + if (delimiter == NULL) delimiter = p; prev_sep = *p; } @@ -1663,11 +1663,11 @@ tailor_segment (const char *range_start, */ void pango_get_log_attrs (const char *text, - int length, - int level, - PangoLanguage *language, - PangoLogAttr *log_attrs, - int attrs_len) + int length, + int level, + PangoLanguage *language, + PangoLogAttr *log_attrs, + int attrs_len) { PangoMap *lang_map; int chars_broken; @@ -1711,15 +1711,15 @@ pango_get_log_attrs (const char *text, g_assert (range_end == run_start); if (range_engine != run_engine) - { - /* Engine has changed; do the tailoring for the current range, - * then start a new range. - */ + { + /* Engine has changed; do the tailoring for the current range, + * then start a new range. + */ chars_broken += tailor_segment (range_start, range_end, range_engine, chars_broken, &analysis, log_attrs); - range_start = run_start; + range_start = run_start; range_engine = run_engine; - } + } range_end = run_end; } pango_script_iter_free (iter); diff --git a/pango/fonts.c b/pango/fonts.c index e34b1df7..13041245 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -899,7 +899,7 @@ find_field_any (const char *str, int len, PangoFontDescription *desc) { \ found = TRUE; \ if (desc) \ - desc->mask |= MASK; \ + desc->mask |= MASK; \ } \ } G_STMT_END @@ -949,7 +949,7 @@ parse_size (const char *word, *pango_size = (int)(size * PANGO_SCALE + 0.5); if (size_is_absolute) - *size_is_absolute = end < word + wordlen; + *size_is_absolute = end < word + wordlen; return TRUE; } @@ -988,9 +988,9 @@ pango_font_description_from_string (const char *str) desc = pango_font_description_new (); desc->mask = PANGO_FONT_MASK_STYLE | - PANGO_FONT_MASK_WEIGHT | - PANGO_FONT_MASK_VARIANT | - PANGO_FONT_MASK_STRETCH; + PANGO_FONT_MASK_WEIGHT | + PANGO_FONT_MASK_VARIANT | + PANGO_FONT_MASK_STRETCH; len = strlen (str); last = str + len; @@ -1293,19 +1293,19 @@ pango_font_get_glyph_extents (PangoFont *font, { if (!_pango_warning_history.get_glyph_extents) - { + { _pango_warning_history.get_glyph_extents = TRUE; g_warning (bad_font_warning, "pango_font_get_glyph_extents"); } if (ink_rect) - { + { ink_rect->x = PANGO_SCALE; ink_rect->y = - (PANGO_UNKNOWN_GLYPH_HEIGHT - 1) * PANGO_SCALE; ink_rect->height = (PANGO_UNKNOWN_GLYPH_HEIGHT - 2) * PANGO_SCALE; ink_rect->width = (PANGO_UNKNOWN_GLYPH_WIDTH - 2) * PANGO_SCALE; - } + } if (logical_rect) - { + { logical_rect->x = logical_rect->y = 0; logical_rect->y = - PANGO_UNKNOWN_GLYPH_HEIGHT * PANGO_SCALE; logical_rect->height = PANGO_UNKNOWN_GLYPH_HEIGHT * PANGO_SCALE; @@ -1340,7 +1340,7 @@ pango_font_get_metrics (PangoFont *font, { if (!_pango_warning_history.get_metrics) - { + { _pango_warning_history.get_metrics = TRUE; g_warning (bad_font_warning, "pango_font_get_metrics"); } @@ -1367,7 +1367,7 @@ pango_font_get_font_map (PangoFont *font) { if (!_pango_warning_history.get_font_map) - { + { _pango_warning_history.get_font_map = TRUE; g_warning (bad_font_warning, "pango_font_get_font_map"); } @@ -1772,8 +1772,8 @@ pango_font_face_get_face_name (PangoFontFace *face) **/ void pango_font_face_list_sizes (PangoFontFace *face, - int **sizes, - int *n_sizes) + int **sizes, + int *n_sizes) { g_return_if_fail (PANGO_IS_FONT_FACE (face)); g_return_if_fail (sizes == NULL || n_sizes != NULL); diff --git a/pango/glyphstring.c b/pango/glyphstring.c index e079a6e2..caff9d77 100644 --- a/pango/glyphstring.c +++ b/pango/glyphstring.c @@ -61,12 +61,12 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) while (new_len > string->space) { if (string->space == 0) - string->space = 1; + string->space = 1; else - string->space *= 2; + string->space *= 2; if (string->space < 0) - { + { g_warning ("glyph string length overflows maximum integer size, truncated"); new_len = string->space = G_MAXINT - 8; } @@ -133,7 +133,7 @@ pango_glyph_string_free (PangoGlyphString *string) * @glyphs: a #PangoGlyphString * @start: start index * @end: end index (the range is the set of bytes with - indices such that start <= index < end) + indices such that start <= index < end) * @font: a #PangoFont * @ink_rect: rectangle used to store the extents of the glyph string range as drawn * or %NULL to indicate that the result is not needed. @@ -147,11 +147,11 @@ pango_glyph_string_free (PangoGlyphString *string) **/ void pango_glyph_string_extents_range (PangoGlyphString *glyphs, - int start, - int end, - PangoFont *font, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) + int start, + int end, + PangoFont *font, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { int x_pos = 0; int i; @@ -263,7 +263,7 @@ pango_glyph_string_extents (PangoGlyphString *glyphs, PangoRectangle *logical_rect) { pango_glyph_string_extents_range (glyphs, 0, glyphs->num_glyphs, - font, ink_rect, logical_rect); + font, ink_rect, logical_rect); } /** diff --git a/pango/modules.c b/pango/modules.c index 4b48af20..5a9d6883 100644 --- a/pango/modules.c +++ b/pango/modules.c @@ -262,7 +262,7 @@ pango_engine_pair_get_engine (PangoEnginePair *pair) } if (!pair->engine) - { + { /* If a module cannot be used, or doesn't not create an engine * correctly, we print out an error containing module name and id, * but to not flood the terminal with zillions of the message, we diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 00b5d870..0e0e3c40 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -41,15 +41,15 @@ struct _PangoAttrIterator }; static PangoAttribute *pango_attr_color_new (const PangoAttrClass *klass, - guint16 red, - guint16 green, - guint16 blue); + guint16 red, + guint16 green, + guint16 blue); static PangoAttribute *pango_attr_string_new (const PangoAttrClass *klass, - const char *str); + const char *str); static PangoAttribute *pango_attr_int_new (const PangoAttrClass *klass, - int value); + int value); static PangoAttribute *pango_attr_float_new (const PangoAttrClass *klass, - double value); + double value); static PangoAttribute *pango_attr_size_new_internal (int size, gboolean absolute); @@ -248,8 +248,8 @@ pango_attr_color_copy (const PangoAttribute *attr) return pango_attr_color_new (attr->klass, color_attr->color.red, - color_attr->color.green, - color_attr->color.blue); + color_attr->color.green, + color_attr->color.blue); } static void @@ -404,7 +404,7 @@ pango_attr_float_equal (const PangoAttribute *attr1, static PangoAttribute* pango_attr_float_new (const PangoAttrClass *klass, - double value) + double value) { PangoAttrFloat *result = g_slice_new (PangoAttrFloat); result->attr.klass = klass; @@ -1136,7 +1136,7 @@ pango_attr_list_copy (PangoAttrList *list) while (iter != NULL) { new_attrs = g_slist_prepend (new_attrs, - pango_attribute_copy (iter->data)); + pango_attribute_copy (iter->data)); iter = g_slist_next (iter); } @@ -1416,7 +1416,7 @@ pango_attr_list_change (PangoAttrList *list, if (tmp_attr2->start_index >= tmp_attr->start_index) break; - prev2 = tmp_list2; + prev2 = tmp_list2; tmp_list2 = tmp_list2->next; } @@ -1775,7 +1775,7 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator, pango_font_description_merge_static (desc, ((PangoAttrFontDesc *)attr)->desc, FALSE); break; - } + } case PANGO_ATTR_FAMILY: if (!(mask & PANGO_FONT_MASK_FAMILY)) { @@ -1825,7 +1825,7 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator, pango_font_description_set_absolute_size (desc, ((PangoAttrSize *)attr)->size); } break; - case PANGO_ATTR_SCALE: + case PANGO_ATTR_SCALE: if (!have_scale) { have_scale = TRUE; diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h index 85baf724..50c7dd24 100644 --- a/pango/pango-attributes.h +++ b/pango/pango-attributes.h @@ -214,7 +214,7 @@ PangoAttribute *pango_attr_fallback_new (gboolean enable PangoAttribute *pango_attr_letter_spacing_new (int letter_spacing); PangoAttribute *pango_attr_shape_new (const PangoRectangle *ink_rect, - const PangoRectangle *logical_rect); + const PangoRectangle *logical_rect); PangoAttribute *pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, const PangoRectangle *logical_rect, gpointer data, @@ -247,27 +247,27 @@ PangoAttrList *pango_attr_list_filter (PangoAttrList *list, PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list); void pango_attr_iterator_range (PangoAttrIterator *iterator, - gint *start, - gint *end); + gint *start, + gint *end); gboolean pango_attr_iterator_next (PangoAttrIterator *iterator); PangoAttrIterator *pango_attr_iterator_copy (PangoAttrIterator *iterator); void pango_attr_iterator_destroy (PangoAttrIterator *iterator); PangoAttribute * pango_attr_iterator_get (PangoAttrIterator *iterator, - PangoAttrType type); + PangoAttrType type); void pango_attr_iterator_get_font (PangoAttrIterator *iterator, - PangoFontDescription *desc, + PangoFontDescription *desc, PangoLanguage **language, - GSList **extra_attrs); + GSList **extra_attrs); GSList * pango_attr_iterator_get_attrs (PangoAttrIterator *iterator); gboolean pango_parse_markup (const char *markup_text, - int length, - gunichar accel_marker, - PangoAttrList **attr_list, - char **text, - gunichar *accel_char, - GError **error); + int length, + gunichar accel_marker, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error); G_END_DECLS diff --git a/pango/pango-break.h b/pango/pango-break.h index ce9bd850..9711166d 100644 --- a/pango/pango-break.h +++ b/pango/pango-break.h @@ -78,19 +78,19 @@ void pango_break (const gchar *text, int length, PangoAnalysis *analysis, PangoLogAttr *attrs, - int attrs_len); + int attrs_len); void pango_find_paragraph_boundary (const gchar *text, - gint length, - gint *paragraph_delimiter_index, - gint *next_paragraph_start); + gint length, + gint *paragraph_delimiter_index, + gint *next_paragraph_start); void pango_get_log_attrs (const char *text, - int length, - int level, - PangoLanguage *language, - PangoLogAttr *log_attrs, - int attrs_len); + int length, + int level, + PangoLanguage *language, + PangoLogAttr *log_attrs, + int attrs_len); #ifdef PANGO_ENABLE_ENGINE @@ -100,10 +100,10 @@ void pango_get_log_attrs (const char *text, * from a language engine override. */ void pango_default_break (const gchar *text, - int length, - PangoAnalysis *analysis, - PangoLogAttr *attrs, - int attrs_len); + int length, + PangoAnalysis *analysis, + PangoLogAttr *attrs, + int attrs_len); #endif /* PANGO_ENABLE_ENGINE */ diff --git a/pango/pango-color.c b/pango/pango-color.c index a2a88530..b469e83c 100644 --- a/pango/pango-color.c +++ b/pango/pango-color.c @@ -163,8 +163,8 @@ find_color(const char *name, ColorEntry *found; found = bsearch (name, color_entries, G_N_ELEMENTS (color_entries), - sizeof (ColorEntry), - compare_xcolor_entries); + sizeof (ColorEntry), + compare_xcolor_entries); if (found == NULL) return FALSE; @@ -223,7 +223,7 @@ pango_color_parse (PangoColor *color, spec++; len = strlen (spec); if (len % 3 || len < 3 || len > 12) - return FALSE; + return FALSE; len /= 3; @@ -248,12 +248,12 @@ pango_color_parse (PangoColor *color, color->red = r; color->green = g; color->blue = b; - } + } } else { if (!find_color (spec, color)) - return FALSE; + return FALSE; } return TRUE; } diff --git a/pango/pango-context.c b/pango/pango-context.c index f11ac213..b92f96ff 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -538,13 +538,13 @@ advance_attr_iterator_to (PangoAttrIterator *iterator, while (start_index >= end_range) { if (!pango_attr_iterator_next (iterator)) - return FALSE; + return FALSE; pango_attr_iterator_range (iterator, &start_range, &end_range); } if (start_range > start_index) g_warning ("In pango_itemize(), the cached iterator passed in " - "had already moved beyond the start_index"); + "had already moved beyond the start_index"); return TRUE; } @@ -710,7 +710,7 @@ update_embedding_end (ItemizeState *state) static PangoAttribute * find_attribute (GSList *attr_list, - PangoAttrType type) + PangoAttrType type) { GSList *node; @@ -1082,8 +1082,8 @@ get_base_font (ItemizeState *state) { if (!state->base_font) state->base_font = pango_font_map_load_font (state->context->font_map, - state->context, - state->font_desc); + state->context, + state->font_desc); return state->base_font; } @@ -1108,9 +1108,9 @@ get_shaper_and_font (ItemizeState *state, PangoScript script; if (PANGO_GRAVITY_IS_VERTICAL (state->resolved_gravity)) - script = PANGO_SCRIPT_COMMON; + script = PANGO_SCRIPT_COMMON; else - script = state->script; + script = state->script; get_engines (state->context, state->derived_lang, script, &state->exact_engines, &state->fallback_engines); @@ -1134,7 +1134,7 @@ get_shaper_and_font (ItemizeState *state, /* skip caching if fallback disabled (see above) */ if (state->enable_fallback) - shaper_font_cache_insert (state->cache, wc, *shape_engine, *font); + shaper_font_cache_insert (state->cache, wc, *shape_engine, *font); return TRUE; } @@ -1218,12 +1218,12 @@ itemize_state_update_for_new_run (ItemizeState *state) PangoGravity old_gravity = state->resolved_gravity; if (state->font_desc_gravity != PANGO_GRAVITY_AUTO) - { + { state->resolved_gravity = state->font_desc_gravity; state->centered_baseline = PANGO_GRAVITY_IS_VERTICAL (state->resolved_gravity); } else - { + { PangoGravity gravity = state->gravity; PangoGravityHint gravity_hint = state->gravity_hint; @@ -1237,9 +1237,9 @@ itemize_state_update_for_new_run (ItemizeState *state) } if (old_gravity != state->resolved_gravity) - { + { pango_font_description_set_gravity (state->font_desc, state->resolved_gravity); - state->changed |= FONT_CHANGED; + state->changed |= FONT_CHANGED; } } @@ -1336,7 +1336,7 @@ itemize_state_process_run (ItemizeState *state) font = NULL; } else - { + { get_shaper_and_font (state, wc, &shape_engine, &font); } @@ -1385,7 +1385,7 @@ itemize_state_finish (ItemizeState *state) /** * pango_itemize_with_base_dir: * @context: a structure holding information that affects - the itemization process. + the itemization process. * @text: the text to itemize. * @start_index: first byte in @text to process * @length: the number of bytes (not characters) to process @@ -1461,7 +1461,7 @@ itemize_with_font (PangoContext *context, /** * pango_itemize: * @context: a structure holding information that affects - the itemization process. + the itemization process. * @text: the text to itemize. * @start_index: first byte in @text to process * @length: the number of bytes (not characters) to process @@ -1486,10 +1486,10 @@ itemize_with_font (PangoContext *context, GList * pango_itemize (PangoContext *context, const char *text, - int start_index, + int start_index, int length, PangoAttrList *attrs, - PangoAttrIterator *cached_iter) + PangoAttrIterator *cached_iter) { g_return_val_if_fail (context != NULL, NULL); g_return_val_if_fail (start_index >= 0, NULL); diff --git a/pango/pango-coverage.c b/pango/pango-coverage.c index 889de9c8..340ccf7c 100644 --- a/pango/pango-coverage.c +++ b/pango/pango-coverage.c @@ -201,8 +201,8 @@ pango_coverage_get (PangoCoverage *coverage, **/ void pango_coverage_set (PangoCoverage *coverage, - int index, - PangoCoverageLevel level) + int index, + PangoCoverageLevel level) { int block_index, i; guchar *data; @@ -239,7 +239,7 @@ pango_coverage_set (PangoCoverage *coverage, byte = coverage->blocks[block_index].level | (coverage->blocks[block_index].level << 2) | (coverage->blocks[block_index].level << 4) | - (coverage->blocks[block_index].level << 6); + (coverage->blocks[block_index].level << 6); memset (data, byte, 64); } @@ -259,7 +259,7 @@ pango_coverage_set (PangoCoverage *coverage, **/ void pango_coverage_max (PangoCoverage *coverage, - PangoCoverage *other) + PangoCoverage *other) { int block_index, i; int old_blocks; diff --git a/pango/pango-engine.c b/pango/pango-engine.c index 20dbacda..c8461892 100644 --- a/pango/pango-engine.c +++ b/pango/pango-engine.c @@ -97,10 +97,10 @@ typedef PangoEngineShapeClass PangoFallbackEngineClass; static void fallback_engine_shape (PangoEngineShape *engine, PangoFont *font, - const char *text, - gint length, - const PangoAnalysis *analysis, - PangoGlyphString *glyphs) + const char *text, + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) { int n_chars; int i; diff --git a/pango/pango-engine.h b/pango/pango-engine.h index 057a9652..c620db94 100644 --- a/pango/pango-engine.h +++ b/pango/pango-engine.h @@ -120,7 +120,7 @@ struct _PangoEngineLangClass int len, PangoAnalysis *analysis, PangoLogAttr *attrs, - int attrs_len); + int attrs_len); }; GType pango_engine_lang_get_type (void) G_GNUC_CONST; @@ -289,7 +289,7 @@ prefix ## _register_type (GTypeModule *module) \ }; \ \ prefix ## _type = g_type_module_register_type (module, parent_type, \ - # name, \ + # name, \ &object_info, 0); \ } @@ -321,7 +321,7 @@ prefix ## _register_type (GTypeModule *module) \ #define PANGO_ENGINE_LANG_DEFINE_TYPE(name, prefix, class_init, instance_init) \ PANGO_ENGINE_DEFINE_TYPE (name, prefix, \ class_init, instance_init, \ - PANGO_TYPE_ENGINE_LANG) + PANGO_TYPE_ENGINE_LANG) /** * PANGO_ENGINE_SHAPE_DEFINE_TYPE: @@ -351,7 +351,7 @@ prefix ## _register_type (GTypeModule *module) \ #define PANGO_ENGINE_SHAPE_DEFINE_TYPE(name, prefix, class_init, instance_init) \ PANGO_ENGINE_DEFINE_TYPE (name, prefix, \ class_init, instance_init, \ - PANGO_TYPE_ENGINE_SHAPE) + PANGO_TYPE_ENGINE_SHAPE) /* Macro used for possibly builtin Pango modules. Not useful * for externally build modules. If we are compiling a module standaline, diff --git a/pango/pango-font.h b/pango/pango-font.h index e9b571b7..4b00fb1f 100644 --- a/pango/pango-font.h +++ b/pango/pango-font.h @@ -231,8 +231,8 @@ struct _PangoFontFamilyClass /*< public >*/ void (*list_faces) (PangoFontFamily *family, - PangoFontFace ***faces, - int *n_faces); + PangoFontFace ***faces, + int *n_faces); const char * (*get_name) (PangoFontFamily *family); gboolean (*is_monospace) (PangoFontFamily *family); @@ -259,8 +259,8 @@ GType pango_font_face_get_type (void) G_GNUC_CONST; PangoFontDescription *pango_font_face_describe (PangoFontFace *face); G_CONST_RETURN char *pango_font_face_get_face_name (PangoFontFace *face); void pango_font_face_list_sizes (PangoFontFace *face, - int **sizes, - int *n_sizes); + int **sizes, + int *n_sizes); #ifdef PANGO_ENABLE_BACKEND @@ -284,8 +284,8 @@ struct _PangoFontFaceClass const char * (*get_face_name) (PangoFontFace *face); PangoFontDescription * (*describe) (PangoFontFace *face); void (*list_sizes) (PangoFontFace *face, - int **sizes, - int *n_sizes); + int **sizes, + int *n_sizes); /*< private >*/ diff --git a/pango/pango-fontmap.c b/pango/pango-fontmap.c index c181eb63..e50e440d 100644 --- a/pango/pango-fontmap.c +++ b/pango/pango-fontmap.c @@ -181,7 +181,7 @@ pango_font_map_real_load_fontset (PangoFontMap *fontmap, pango_font_description_set_family_static (tmp_desc, "Sans"); if (!warned_fonts || !g_hash_table_lookup (warned_fonts, ctmp1)) - { + { if (!warned_fonts) warned_fonts = g_hash_table_new (g_str_hash, g_str_equal); @@ -191,7 +191,7 @@ pango_font_map_real_load_fontset (PangoFontMap *fontmap, g_warning ("couldn't load font \"%s\", falling back to \"%s\", " "expect ugly output.", ctmp1, ctmp2); g_free (ctmp2); - } + } g_free (ctmp1); pango_font_map_fontset_add_fonts (fontmap, @@ -215,7 +215,7 @@ pango_font_map_real_load_fontset (PangoFontMap *fontmap, pango_font_description_set_stretch (tmp_desc, PANGO_STRETCH_NORMAL); if (!warned_fonts || !g_hash_table_lookup (warned_fonts, ctmp1)) - { + { g_hash_table_insert (warned_fonts, g_strdup (ctmp1), GINT_TO_POINTER (1)); ctmp2 = pango_font_description_to_string (tmp_desc); diff --git a/pango/pango-glyph.h b/pango/pango-glyph.h index 16d9e35e..3fb6d94e 100644 --- a/pango/pango-glyph.h +++ b/pango/pango-glyph.h @@ -94,11 +94,11 @@ void pango_glyph_string_extents (PangoGlyphString *glyphs, int pango_glyph_string_get_width(PangoGlyphString *glyphs); void pango_glyph_string_extents_range (PangoGlyphString *glyphs, - int start, - int end, - PangoFont *font, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); + int start, + int end, + PangoFont *font, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, const char *text, diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c index 159ce8a9..1b59a500 100644 --- a/pango/pango-gravity.c +++ b/pango/pango-gravity.c @@ -274,12 +274,12 @@ pango_gravity_get_for_script (PangoScript script, default: case PANGO_GRAVITY_HINT_NATURAL: if (props.vert_dir == PANGO_VERTICAL_DIRECTION_NONE) - return PANGO_GRAVITY_SOUTH; + return PANGO_GRAVITY_SOUTH; if ((base_gravity == PANGO_GRAVITY_EAST) ^ (props.vert_dir == PANGO_VERTICAL_DIRECTION_BTT)) - return PANGO_GRAVITY_SOUTH; + return PANGO_GRAVITY_SOUTH; else - return PANGO_GRAVITY_NORTH; + return PANGO_GRAVITY_NORTH; case PANGO_GRAVITY_HINT_STRONG: return base_gravity; @@ -287,8 +287,8 @@ pango_gravity_get_for_script (PangoScript script, case PANGO_GRAVITY_HINT_LINE: if ((base_gravity == PANGO_GRAVITY_EAST) ^ (props.horiz_dir == PANGO_DIRECTION_RTL)) - return PANGO_GRAVITY_SOUTH; + return PANGO_GRAVITY_SOUTH; else - return PANGO_GRAVITY_NORTH; + return PANGO_GRAVITY_NORTH; } } diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h index 759fdffe..ac6a8e5f 100644 --- a/pango/pango-impl-utils.h +++ b/pango/pango-impl-utils.h @@ -61,14 +61,14 @@ prefix ## _get_type (void) \ } #define PANGO_DEFINE_TYPE(name, prefix, \ - class_init, instance_init, \ + class_init, instance_init, \ parent_type) \ PANGO_DEFINE_TYPE_FULL (name, prefix, \ class_init, instance_init, \ parent_type, 0) #define PANGO_DEFINE_TYPE_ABSTRACT(name, prefix, \ - class_init, instance_init, \ + class_init, instance_init, \ parent_type) \ PANGO_DEFINE_TYPE_FULL (name, prefix, \ class_init, instance_init, \ diff --git a/pango/pango-item.c b/pango/pango-item.c index 4abe6337..177d60d0 100644 --- a/pango/pango-item.c +++ b/pango/pango-item.c @@ -104,8 +104,8 @@ pango_item_get_type (void) if (our_type == 0) our_type = g_boxed_type_register_static (I_("PangoItem"), - (GBoxedCopyFunc) pango_item_copy, - (GBoxedFreeFunc) pango_item_free); + (GBoxedCopyFunc) pango_item_copy, + (GBoxedFreeFunc) pango_item_free); return our_type; } @@ -131,8 +131,8 @@ pango_item_get_type (void) **/ PangoItem* pango_item_split (PangoItem *orig, - int split_index, - int split_offset) + int split_index, + int split_offset) { PangoItem *new_item; diff --git a/pango/pango-item.h b/pango/pango-item.h index cdc887e4..c07dc670 100644 --- a/pango/pango-item.h +++ b/pango/pango-item.h @@ -62,8 +62,8 @@ PangoItem *pango_item_new (void); PangoItem *pango_item_copy (PangoItem *item); void pango_item_free (PangoItem *item); PangoItem *pango_item_split (PangoItem *orig, - int split_index, - int split_offset); + int split_index, + int split_offset); G_END_DECLS diff --git a/pango/pango-layout.c b/pango/pango-layout.c index afc2fe86..309d6e2e 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -140,7 +140,7 @@ struct _PangoLayoutClass #define ITER_IS_INVALID(iter) G_UNLIKELY (check_invalid ((iter), G_STRLOC)) static gboolean check_invalid (PangoLayoutIter *iter, - const char *loc) + const char *loc) { if (iter->line->layout == NULL) { @@ -382,7 +382,7 @@ pango_layout_get_width (PangoLayout *layout) **/ void pango_layout_set_wrap (PangoLayout *layout, - PangoWrapMode wrap) + PangoWrapMode wrap) { g_return_if_fail (PANGO_IS_LAYOUT (layout)); @@ -488,7 +488,7 @@ pango_layout_get_indent (PangoLayout *layout) **/ void pango_layout_set_spacing (PangoLayout *layout, - int spacing) + int spacing) { g_return_if_fail (layout != NULL); @@ -754,7 +754,7 @@ pango_layout_get_alignment (PangoLayout *layout) **/ void pango_layout_set_tabs (PangoLayout *layout, - PangoTabArray *tabs) + PangoTabArray *tabs) { g_return_if_fail (PANGO_IS_LAYOUT (layout)); @@ -799,7 +799,7 @@ pango_layout_get_tabs (PangoLayout *layout) **/ void pango_layout_set_single_paragraph_mode (PangoLayout *layout, - gboolean setting) + gboolean setting) { g_return_if_fail (PANGO_IS_LAYOUT (layout)); @@ -1001,8 +1001,8 @@ pango_layout_get_text (PangoLayout *layout) **/ void pango_layout_set_markup (PangoLayout *layout, - const char *markup, - int length) + const char *markup, + int length) { pango_layout_set_markup_with_accel (layout, markup, length, 0, NULL); } @@ -1031,10 +1031,10 @@ pango_layout_set_markup (PangoLayout *layout, **/ void pango_layout_set_markup_with_accel (PangoLayout *layout, - const char *markup, - int length, - gunichar accel_marker, - gunichar *accel_char) + const char *markup, + int length, + gunichar accel_marker, + gunichar *accel_char) { PangoAttrList *list = NULL; char *text = NULL; @@ -1045,10 +1045,10 @@ pango_layout_set_markup_with_accel (PangoLayout *layout, error = NULL; if (!pango_parse_markup (markup, length, - accel_marker, - &list, &text, - accel_char, - &error)) + accel_marker, + &list, &text, + accel_char, + &error)) { g_warning ("pango_layout_set_markup_with_accel: %s", error->message); g_error_free (error); @@ -1092,22 +1092,22 @@ pango_layout_get_unknown_glyphs_count (PangoLayout *layout) lines_list = layout->lines; while (lines_list) { - line = lines_list->data; - runs_list = line->runs; - - while (runs_list) - { - run = runs_list->data; - - for (i = 0; i < run->glyphs->num_glyphs; i++) - { - if (run->glyphs->glyphs[i].glyph & PANGO_GLYPH_UNKNOWN_FLAG) - count++; - } - - runs_list = runs_list->next; - } - lines_list = lines_list->next; + line = lines_list->data; + runs_list = line->runs; + + while (runs_list) + { + run = runs_list->data; + + for (i = 0; i < run->glyphs->num_glyphs; i++) + { + if (run->glyphs->glyphs[i].glyph & PANGO_GLYPH_UNKNOWN_FLAG) + count++; + } + + runs_list = runs_list->next; + } + lines_list = lines_list->next; } layout->unknown_glyphs_count = count; @@ -1392,7 +1392,7 @@ pango_layout_line_index_to_x (PangoLayoutLine *line, &run->item->analysis, index - run->item->offset, trailing, x_pos); if (x_pos) - *x_pos += width; + *x_pos += width; } return; @@ -1429,7 +1429,7 @@ pango_layout_index_to_line (PangoLayout *layout, PangoLayoutLine *tmp_line = tmp_list->data; if (tmp_line->start_index > index) - break; /* index was in paragraph delimiters */ + break; /* index was in paragraph delimiters */ prev_line = line; line = tmp_line; @@ -1437,7 +1437,7 @@ pango_layout_index_to_line (PangoLayout *layout, i++; if (line->start_index + line->length > index) - break; + break; tmp_list = tmp_list->next; } @@ -1781,34 +1781,34 @@ pango_layout_xy_to_index (PangoLayout *layout, pango_layout_iter_get_line_yrange (iter, &first_y, &last_y); if (y < first_y) - { - if (prev_line && y < (prev_last + (first_y - prev_last) / 2)) - { - found = prev_line; - found_line_x = prev_line_x; - } - else - { - if (prev_line == NULL) - outside = TRUE; /* off the top */ - - found = _pango_layout_iter_get_line (iter); - found_line_x = x - line_logical.x; - } - } + { + if (prev_line && y < (prev_last + (first_y - prev_last) / 2)) + { + found = prev_line; + found_line_x = prev_line_x; + } + else + { + if (prev_line == NULL) + outside = TRUE; /* off the top */ + + found = _pango_layout_iter_get_line (iter); + found_line_x = x - line_logical.x; + } + } else if (y >= first_y && - y < last_y) - { - found = _pango_layout_iter_get_line (iter); - found_line_x = x - line_logical.x; - } + y < last_y) + { + found = _pango_layout_iter_get_line (iter); + found_line_x = x - line_logical.x; + } prev_line = _pango_layout_iter_get_line (iter); prev_last = last_y; prev_line_x = x - line_logical.x; if (found != NULL) - break; + break; } while (pango_layout_iter_next_line (iter)); @@ -1824,8 +1824,8 @@ pango_layout_xy_to_index (PangoLayout *layout, } retval = pango_layout_line_x_to_index (found, - found_line_x, - index, trailing); + found_line_x, + index, trailing); if (outside) retval = FALSE; @@ -2101,9 +2101,9 @@ pango_layout_get_cursor_pos (PangoLayout *layout, { dir1 = layout_line->resolved_dir; if (layout_line->resolved_dir == PANGO_DIRECTION_LTR) - x1_trailing = 0; + x1_trailing = 0; else - x1_trailing = line_rect.width; + x1_trailing = line_rect.width; } else { @@ -2116,9 +2116,9 @@ pango_layout_get_cursor_pos (PangoLayout *layout, if (index >= layout_line->start_index + layout_line->length) { if (layout_line->resolved_dir == PANGO_DIRECTION_LTR) - x2 = line_rect.width; + x2 = line_rect.width; else - x2 = 0; + x2 = 0; } else { @@ -2196,10 +2196,10 @@ get_alignment (PangoLayout *layout, static void get_x_offset (PangoLayout *layout, - PangoLayoutLine *line, - int layout_width, - int line_width, - int *x_offset) + PangoLayoutLine *line, + int layout_width, + int line_width, + int *x_offset) { PangoAlignment alignment = get_alignment (layout, line); @@ -2226,33 +2226,33 @@ get_x_offset (PangoLayout *layout, if (line->is_paragraph_start) { if (layout->indent > 0) - { - if (alignment == PANGO_ALIGN_LEFT) - *x_offset += layout->indent; - else - *x_offset -= layout->indent; - } + { + if (alignment == PANGO_ALIGN_LEFT) + *x_offset += layout->indent; + else + *x_offset -= layout->indent; + } } else { if (layout->indent < 0) - { - if (alignment == PANGO_ALIGN_LEFT) - *x_offset -= layout->indent; - else - *x_offset += layout->indent; - } + { + if (alignment == PANGO_ALIGN_LEFT) + *x_offset -= layout->indent; + else + *x_offset += layout->indent; + } } } static void get_line_extents_layout_coords (PangoLayout *layout, - PangoLayoutLine *line, - int layout_width, - int y_offset, - int *baseline, - PangoRectangle *line_ink_layout, - PangoRectangle *line_logical_layout) + PangoLayoutLine *line, + int layout_width, + int y_offset, + int *baseline, + PangoRectangle *line_ink_layout, + PangoRectangle *line_logical_layout) { int x_offset; /* Line extents in line coords (origin at line baseline) */ @@ -2260,7 +2260,7 @@ get_line_extents_layout_coords (PangoLayout *layout, PangoRectangle line_logical; pango_layout_line_get_extents (line, line_ink_layout ? &line_ink : NULL, - &line_logical); + &line_logical); get_x_offset (layout, line, layout_width, line_logical.width, &x_offset); @@ -2288,9 +2288,9 @@ get_line_extents_layout_coords (PangoLayout *layout, */ static void pango_layout_get_extents_internal (PangoLayout *layout, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect, - GSList **line_extents) + PangoRectangle *ink_rect, + PangoRectangle *logical_rect, + GSList **line_extents) { GSList *line_list; int y_offset = 0; @@ -2368,48 +2368,48 @@ pango_layout_get_extents_internal (PangoLayout *layout, /* This block gets the line extents in layout coords */ { - int baseline; - - get_line_extents_layout_coords (layout, line, - width, y_offset, - &baseline, - ink_rect ? &line_ink_layout : NULL, - &line_logical_layout); - - if (line_extents) - { - Extents *ext = g_slice_new (Extents); - ext->baseline = baseline; - ext->ink_rect = line_ink_layout; - ext->logical_rect = line_logical_layout; - *line_extents = g_slist_prepend (*line_extents, ext); - } + int baseline; + + get_line_extents_layout_coords (layout, line, + width, y_offset, + &baseline, + ink_rect ? &line_ink_layout : NULL, + &line_logical_layout); + + if (line_extents) + { + Extents *ext = g_slice_new (Extents); + ext->baseline = baseline; + ext->ink_rect = line_ink_layout; + ext->logical_rect = line_logical_layout; + *line_extents = g_slist_prepend (*line_extents, ext); + } } if (ink_rect) { - /* Compute the union of the current ink_rect with - * line_ink_layout - */ + /* Compute the union of the current ink_rect with + * line_ink_layout + */ if (line_list == layout->lines) { - *ink_rect = line_ink_layout; + *ink_rect = line_ink_layout; } else { new_pos = MIN (ink_rect->x, line_ink_layout.x); ink_rect->width = - MAX (ink_rect->x + ink_rect->width, - line_ink_layout.x + line_ink_layout.width) - new_pos; + MAX (ink_rect->x + ink_rect->width, + line_ink_layout.x + line_ink_layout.width) - new_pos; ink_rect->x = new_pos; new_pos = MIN (ink_rect->y, line_ink_layout.y); ink_rect->height = - MAX (ink_rect->y + ink_rect->height, - line_ink_layout.y + line_ink_layout.height) - new_pos; + MAX (ink_rect->y + ink_rect->height, + line_ink_layout.y + line_ink_layout.height) - new_pos; ink_rect->y = new_pos; - } + } } if (logical_rect) @@ -2444,9 +2444,9 @@ pango_layout_get_extents_internal (PangoLayout *layout, logical_rect->height += line_logical_layout.height; - /* No space after the last line, of course. */ - if (line_list->next != NULL) - logical_rect->height += layout->spacing; + /* No space after the last line, of course. */ + if (line_list->next != NULL) + logical_rect->height += layout->spacing; } y_offset += line_logical_layout.height + layout->spacing; @@ -2473,7 +2473,7 @@ pango_layout_get_extents_internal (PangoLayout *layout, * @ink_rect: rectangle used to store the extents of the layout as drawn * or %NULL to indicate that the result is not needed. * @logical_rect: rectangle used to store the logical extents of the layout - or %NULL to indicate that the result is not needed. + or %NULL to indicate that the result is not needed. * * Computes the logical and ink extents of @layout. Logical extents * are usually what you want for positioning things. Note that both extents @@ -2829,9 +2829,9 @@ get_tab_pos (PangoLayout *layout, int index) pango_tab_array_get_tab (layout->tabs, index, NULL, &pos); if (in_pixels) - return pos * PANGO_SCALE; + return pos * PANGO_SCALE; else - return pos; + return pos; } if (n_tabs > 0) @@ -2846,9 +2846,9 @@ get_tab_pos (PangoLayout *layout, int index) pango_tab_array_get_tab (layout->tabs, n_tabs - 1, NULL, &last_pos); if (n_tabs > 1) - pango_tab_array_get_tab (layout->tabs, n_tabs - 2, NULL, &next_to_last_pos); + pango_tab_array_get_tab (layout->tabs, n_tabs - 2, NULL, &next_to_last_pos); else - next_to_last_pos = 0; + next_to_last_pos = 0; if (in_pixels) { @@ -3227,7 +3227,7 @@ process_item (PangoLayout *layout, length = g_utf8_offset_to_pointer (layout->text + item->offset, break_num_chars) - (layout->text + item->offset); - new_item = pango_item_split (item, length, break_num_chars); + new_item = pango_item_split (item, length, break_num_chars); insert_run (line, state, new_item, FALSE); @@ -3294,7 +3294,7 @@ line_set_resolved_dir (PangoLayoutLine *line, break; case PANGO_GRAVITY_NORTH: line->resolved_dir = PANGO_DIRECTION_LTR - + PANGO_DIRECTION_RTL + + PANGO_DIRECTION_RTL - line->resolved_dir; break; case PANGO_GRAVITY_EAST: @@ -3389,10 +3389,10 @@ process_line (PangoLayout *layout, layout->is_wrapped = TRUE; goto done; - case BREAK_LINE_SEPARATOR: - state->items = g_list_delete_link (state->items, state->items); - state->start_offset += old_num_chars; - goto done; + case BREAK_LINE_SEPARATOR: + state->items = g_list_delete_link (state->items, state->items); + state->start_offset += old_num_chars; + goto done; } } @@ -3405,9 +3405,9 @@ process_line (PangoLayout *layout, static void get_items_log_attrs (const char *text, - GList *items, - PangoLogAttr *log_attrs, - int para_delimiter_len) + GList *items, + PangoLogAttr *log_attrs, + int para_delimiter_len) { int offset = 0; int index = 0; @@ -3443,7 +3443,7 @@ get_items_log_attrs (const char *text, } pango_break (text + index, tmp_item.length, &tmp_item.analysis, - log_attrs + offset, tmp_item.num_chars + 1); + log_attrs + offset, tmp_item.num_chars + 1); offset += tmp_item.num_chars; index += tmp_item.length; @@ -3581,17 +3581,17 @@ pango_layout_check_lines (PangoLayout *layout) ParaBreakState state; if (layout->single_paragraph) - { - delimiter_index = layout->length; - next_para_index = layout->length; - } + { + delimiter_index = layout->length; + next_para_index = layout->length; + } else - { - pango_find_paragraph_boundary (start, - (layout->text + layout->length) - start, - &delimiter_index, - &next_para_index); - } + { + pango_find_paragraph_boundary (start, + (layout->text + layout->length) - start, + &delimiter_index, + &next_para_index); + } g_assert (next_para_index >= delimiter_index); @@ -3628,37 +3628,37 @@ pango_layout_check_lines (PangoLayout *layout) iter); get_items_log_attrs (start, state.items, - layout->log_attrs + start_offset, - delim_len); + layout->log_attrs + start_offset, + delim_len); if (state.items) { state.first_line = TRUE; state.base_dir = base_dir; state.start_offset = start_offset; - state.line_start_index = start - layout->text; + state.line_start_index = start - layout->text; state.glyphs = NULL; state.log_widths = NULL; while (state.items) - process_line (layout, &state); + process_line (layout, &state); } else - { - PangoLayoutLine *empty_line; + { + PangoLayoutLine *empty_line; - empty_line = pango_layout_line_new (layout); - empty_line->start_index = start - layout->text; + empty_line = pango_layout_line_new (layout); + empty_line->start_index = start - layout->text; empty_line->is_paragraph_start = TRUE; line_set_resolved_dir (empty_line, base_dir); - layout->lines = g_slist_prepend (layout->lines, - empty_line); - } + layout->lines = g_slist_prepend (layout->lines, + empty_line); + } if (!done) - start_offset += g_utf8_strlen (start, (end - start) + delim_len); + start_offset += g_utf8_strlen (start, (end - start) + delim_len); start = end + delim_len; } @@ -3730,8 +3730,8 @@ pango_layout_line_get_type(void) if (our_type == 0) our_type = g_boxed_type_register_static (I_("PangoLayoutLine"), - (GBoxedCopyFunc) pango_layout_line_ref, - (GBoxedFreeFunc) pango_layout_line_unref); + (GBoxedCopyFunc) pango_layout_line_ref, + (GBoxedFreeFunc) pango_layout_line_unref); return our_type; } @@ -4221,8 +4221,8 @@ pango_layout_run_get_width (PangoLayoutRun *run) static void pango_layout_run_get_extents (PangoLayoutRun *run, - PangoRectangle *run_ink, - PangoRectangle *run_logical) + PangoRectangle *run_ink, + PangoRectangle *run_logical) { PangoRectangle logical; ItemProperties properties; @@ -4270,7 +4270,7 @@ pango_layout_run_get_extents (PangoLayoutRun *run, */ if (properties.strikethrough) - { + { if (run_ink->height == 0) { run_ink->height = strikethrough_thickness; @@ -4311,7 +4311,7 @@ pango_layout_run_get_extents (PangoLayoutRun *run, if (properties.rise != 0) { if (run_ink) - run_ink->y -= properties.rise; + run_ink->y -= properties.rise; if (run_logical) run_logical->y -= properties.rise; @@ -4360,7 +4360,7 @@ pango_layout_line_get_extents (PangoLayoutLine *line, } case NOT_CACHED: { - caching = TRUE; + caching = TRUE; if (!ink_rect) ink_rect = &private->ink_rect; if (!logical_rect) @@ -4369,7 +4369,7 @@ pango_layout_line_get_extents (PangoLayoutLine *line, } case LEAKED: { - break; + break; } } @@ -4398,8 +4398,8 @@ pango_layout_line_get_extents (PangoLayoutLine *line, PangoRectangle run_logical; pango_layout_run_get_extents (run, - ink_rect ? &run_ink : NULL, - &run_logical); + ink_rect ? &run_ink : NULL, + &run_logical); if (ink_rect) { @@ -4734,9 +4734,9 @@ pango_layout_get_item_properties (PangoItem *item, properties->strikethrough = ((PangoAttrInt *)attr)->value; break; - case PANGO_ATTR_RISE: + case PANGO_ATTR_RISE: properties->rise = ((PangoAttrInt *)attr)->value; - break; + break; case PANGO_ATTR_LETTER_SPACING: properties->letter_spacing = ((PangoAttrInt *)attr)->value; @@ -4757,7 +4757,7 @@ pango_layout_get_item_properties (PangoItem *item, static int next_cluster_start (PangoGlyphString *gs, - int cluster_start) + int cluster_start) { int i; @@ -4765,7 +4765,7 @@ next_cluster_start (PangoGlyphString *gs, while (i < gs->num_glyphs) { if (gs->glyphs[i].attr.is_cluster_start) - return i; + return i; i++; } @@ -4785,7 +4785,7 @@ cluster_width (PangoGlyphString *gs, while (i < gs->num_glyphs) { if (gs->glyphs[i].attr.is_cluster_start) - break; + break; width += gs->glyphs[i].geometry.width; i++; @@ -4796,7 +4796,7 @@ cluster_width (PangoGlyphString *gs, static inline void offset_y (PangoLayoutIter *iter, - int *y) + int *y) { Extents *line_ext; @@ -5006,9 +5006,9 @@ pango_layout_get_iter (PangoLayout *layout) iter->line_extents = NULL; pango_layout_get_extents_internal (layout, - NULL, - &logical_rect, - &iter->line_extents); + NULL, + &logical_rect, + &iter->line_extents); iter->layout_width = layout->width == -1 ? logical_rect.width : layout->width; iter->line_extents_link = iter->line_extents; @@ -5441,7 +5441,7 @@ pango_layout_iter_next_line (PangoLayoutIter *iter) **/ void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, - PangoRectangle *logical_rect) + PangoRectangle *logical_rect) { PangoRectangle cluster_rect; int x0, x1; @@ -5484,8 +5484,8 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter, **/ void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { if (ITER_IS_INVALID (iter)) return; @@ -5500,11 +5500,11 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, } pango_glyph_string_extents_range (iter->run->glyphs, - iter->cluster_start, - iter->next_cluster_glyph, - iter->run->item->analysis.font, - ink_rect, - logical_rect); + iter->cluster_start, + iter->next_cluster_glyph, + iter->run->item->analysis.font, + ink_rect, + logical_rect); if (ink_rect) { @@ -5532,8 +5532,8 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, **/ void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { if (G_UNLIKELY (!ink_rect && !logical_rect)) return; @@ -5564,10 +5564,10 @@ pango_layout_iter_get_run_extents (PangoLayoutIter *iter, pango_layout_iter_get_line_extents (iter, ink_rect, logical_rect); if (ink_rect) - { - ink_rect->x = iter->run_x; - ink_rect->width = 0; - } + { + ink_rect->x = iter->run_x; + ink_rect->width = 0; + } if (logical_rect) { @@ -5593,8 +5593,8 @@ pango_layout_iter_get_run_extents (PangoLayoutIter *iter, **/ void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { Extents *ext; @@ -5606,11 +5606,11 @@ pango_layout_iter_get_line_extents (PangoLayoutIter *iter, if (ink_rect) { get_line_extents_layout_coords (iter->layout, iter->line, - iter->layout_width, - ext->logical_rect.y, - NULL, - ink_rect, - NULL); + iter->layout_width, + ext->logical_rect.y, + NULL, + ink_rect, + NULL); } if (logical_rect) @@ -5634,8 +5634,8 @@ pango_layout_iter_get_line_extents (PangoLayoutIter *iter, **/ void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, - int *y0, - int *y1) + int *y0, + int *y1) { Extents *ext; int half_spacing; @@ -5656,18 +5656,18 @@ pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, /* No spacing above the first line */ if (iter->line_extents_link == iter->line_extents) - *y0 = ext->logical_rect.y; + *y0 = ext->logical_rect.y; else - *y0 = ext->logical_rect.y - (iter->layout->spacing - half_spacing); + *y0 = ext->logical_rect.y - (iter->layout->spacing - half_spacing); } if (y1) { /* No spacing below the last line */ if (iter->line_extents_link->next == NULL) - *y1 = ext->logical_rect.y + ext->logical_rect.height; + *y1 = ext->logical_rect.y + ext->logical_rect.height; else - *y1 = ext->logical_rect.y + ext->logical_rect.height + half_spacing; + *y1 = ext->logical_rect.y + ext->logical_rect.height + half_spacing; } } @@ -5706,8 +5706,8 @@ pango_layout_iter_get_baseline (PangoLayoutIter *iter) **/ void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { if (ITER_IS_INVALID (iter)) return; diff --git a/pango/pango-layout.h b/pango/pango-layout.h index 752d624b..ff8389eb 100644 --- a/pango/pango-layout.h +++ b/pango/pango-layout.h @@ -105,14 +105,14 @@ void pango_layout_set_text (PangoLayout *layout, const char *pango_layout_get_text (PangoLayout *layout); void pango_layout_set_markup (PangoLayout *layout, - const char *markup, - int length); + const char *markup, + int length); void pango_layout_set_markup_with_accel (PangoLayout *layout, - const char *markup, - int length, - gunichar accel_marker, - gunichar *accel_char); + const char *markup, + int length, + gunichar accel_marker, + gunichar *accel_char); void pango_layout_set_font_description (PangoLayout *layout, const PangoFontDescription *desc); @@ -123,7 +123,7 @@ void pango_layout_set_width (PangoLayout *la int width); int pango_layout_get_width (PangoLayout *layout); void pango_layout_set_wrap (PangoLayout *layout, - PangoWrapMode wrap); + PangoWrapMode wrap); PangoWrapMode pango_layout_get_wrap (PangoLayout *layout); gboolean pango_layout_is_wrapped (PangoLayout *layout); void pango_layout_set_indent (PangoLayout *layout, @@ -143,12 +143,12 @@ void pango_layout_set_alignment (PangoLayout *la PangoAlignment pango_layout_get_alignment (PangoLayout *layout); void pango_layout_set_tabs (PangoLayout *layout, - PangoTabArray *tabs); + PangoTabArray *tabs); PangoTabArray* pango_layout_get_tabs (PangoLayout *layout); void pango_layout_set_single_paragraph_mode (PangoLayout *layout, - gboolean setting); + gboolean setting); gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout); void pango_layout_set_ellipsize (PangoLayout *layout, @@ -168,10 +168,10 @@ void pango_layout_index_to_pos (PangoLayout *layout, int index_, PangoRectangle *pos); void pango_layout_index_to_line_x (PangoLayout *layout, - int index_, - gboolean trailing, - int *line, - int *x_pos); + int index_, + gboolean trailing, + int *line, + int *x_pos); void pango_layout_get_cursor_pos (PangoLayout *layout, int index_, PangoRectangle *strong_pos, @@ -259,25 +259,25 @@ gboolean pango_layout_iter_next_run (PangoLayoutIter *iter); gboolean pango_layout_iter_next_line (PangoLayoutIter *iter); void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, - PangoRectangle *logical_rect); + PangoRectangle *logical_rect); void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); /* All the yranges meet, unlike the logical_rect's (i.e. the yranges * assign between-line spacing to the nearest line) */ void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, - int *y0_, - int *y1_); + int *y0_, + int *y1_); void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect); + PangoRectangle *ink_rect, + PangoRectangle *logical_rect); int pango_layout_iter_get_baseline (PangoLayoutIter *iter); G_END_DECLS diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 077bb3b1..31086214 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -82,78 +82,78 @@ struct _OpenTag }; typedef gboolean (*TagParseFunc) (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean b_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean big_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean span_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean i_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean markup_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean s_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean sub_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean sup_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean small_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean tt_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static gboolean u_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error); + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error); static double scale_factor (int scale_level, double base) @@ -167,21 +167,21 @@ scale_factor (int scale_level, double base) { i = 0; while (i < scale_level) - { - factor *= 1.2; + { + factor *= 1.2; - ++i; - } + ++i; + } } else if (scale_level < 0) { i = scale_level; while (i < 0) - { - factor /= 1.2; + { + factor /= 1.2; - ++i; - } + ++i; + } } return factor; @@ -197,7 +197,7 @@ open_tag_free (OpenTag *ot) static void open_tag_set_absolute_font_size (OpenTag *ot, - int font_size) + int font_size) { ot->base_font_size = font_size; ot->has_base_font_size = TRUE; @@ -207,7 +207,7 @@ open_tag_set_absolute_font_size (OpenTag *ot, static void open_tag_set_absolute_font_scale (OpenTag *ot, - double scale) + double scale) { ot->base_scale_factor = scale; ot->has_base_font_size = FALSE; @@ -264,7 +264,7 @@ markup_data_close_tag (MarkupData *md) /* pop the stack */ ot = md->tag_stack->data; md->tag_stack = g_slist_delete_link (md->tag_stack, - md->tag_stack); + md->tag_stack); /* Adjust end indexes, and push each attr onto the front of the * to_apply list. This means that outermost tags are on the front of @@ -292,22 +292,22 @@ markup_data_close_tag (MarkupData *md) PangoAttribute *a; if (ot->has_base_font_size) - { - /* Create a font using the absolute point size - * as the base size to be scaled from - */ - a = pango_attr_size_new (scale_factor (ot->scale_level, - 1.0) * - ot->base_font_size); - } + { + /* Create a font using the absolute point size + * as the base size to be scaled from + */ + a = pango_attr_size_new (scale_factor (ot->scale_level, + 1.0) * + ot->base_font_size); + } else - { - /* Create a font using the current scale factor - * as the base size to be scaled from - */ - a = pango_attr_scale_new (scale_factor (ot->scale_level, - ot->base_scale_factor)); - } + { + /* Create a font using the current scale factor + * as the base size to be scaled from + */ + a = pango_attr_scale_new (scale_factor (ot->scale_level, + ot->base_scale_factor)); + } a->start_index = ot->start_index; a->end_index = md->index; @@ -321,11 +321,11 @@ markup_data_close_tag (MarkupData *md) static void start_element_handler (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - gpointer user_data, - GError **error) + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **error) { TagParseFunc parse_func = NULL; OpenTag *ot; @@ -334,42 +334,42 @@ start_element_handler (GMarkupParseContext *context, { case 'b': if (strcmp ("b", element_name) == 0) - parse_func = b_parse_func; + parse_func = b_parse_func; else if (strcmp ("big", element_name) == 0) - parse_func = big_parse_func; + parse_func = big_parse_func; break; case 'i': if (strcmp ("i", element_name) == 0) - parse_func = i_parse_func; + parse_func = i_parse_func; break; case 'm': if (strcmp ("markup", element_name) == 0) - parse_func = markup_parse_func; + parse_func = markup_parse_func; break; case 's': if (strcmp ("span", element_name) == 0) - parse_func = span_parse_func; + parse_func = span_parse_func; else if (strcmp ("s", element_name) == 0) - parse_func = s_parse_func; + parse_func = s_parse_func; else if (strcmp ("sub", element_name) == 0) - parse_func = sub_parse_func; + parse_func = sub_parse_func; else if (strcmp ("sup", element_name) == 0) - parse_func = sup_parse_func; + parse_func = sup_parse_func; else if (strcmp ("small", element_name) == 0) - parse_func = small_parse_func; + parse_func = small_parse_func; break; case 't': if (strcmp ("tt", element_name) == 0) - parse_func = tt_parse_func; + parse_func = tt_parse_func; break; case 'u': if (strcmp ("u", element_name) == 0) - parse_func = u_parse_func; + parse_func = u_parse_func; break; } @@ -378,14 +378,14 @@ start_element_handler (GMarkupParseContext *context, gint line_number, char_number; g_markup_parse_context_get_position (context, - &line_number, &char_number); + &line_number, &char_number); g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_UNKNOWN_ELEMENT, - _("Unknown tag '%s' on line %d char %d"), - element_name, - line_number, char_number); + G_MARKUP_ERROR, + G_MARKUP_ERROR_UNKNOWN_ELEMENT, + _("Unknown tag '%s' on line %d char %d"), + element_name, + line_number, char_number); return; } @@ -395,8 +395,8 @@ start_element_handler (GMarkupParseContext *context, /* note ot may be NULL if the user didn't want the attribute list */ if (!(*parse_func) (user_data, ot, - attribute_names, attribute_values, - context, error)) + attribute_names, attribute_values, + context, error)) { /* there's nothing to do; we return an error, and end up * freeing ot off the tag stack later. @@ -406,19 +406,19 @@ start_element_handler (GMarkupParseContext *context, static void end_element_handler (GMarkupParseContext *context, - const gchar *element_name, - gpointer user_data, - GError **error) + const gchar *element_name, + gpointer user_data, + GError **error) { markup_data_close_tag (user_data); } static void text_handler (GMarkupParseContext *context, - const gchar *text, - gsize text_len, - gpointer user_data, - GError **error) + const gchar *text, + gsize text_len, + gpointer user_data, + GError **error) { MarkupData *md = user_data; @@ -446,90 +446,90 @@ text_handler (GMarkupParseContext *context, end = text + text_len; while (p != end) - { - gunichar c; - - c = g_utf8_get_char (p); - - if (range_end) - { - if (c == md->accel_marker) - { - /* escaped accel marker; move range_end - * past the accel marker that came before, - * append the whole thing - */ - range_end = g_utf8_next_char (range_end); - g_string_append_len (md->text, - range_start, - range_end - range_start); - md->index += range_end - range_start; - - /* set next range_start, skipping accel marker */ - range_start = g_utf8_next_char (p); - } - else - { - /* Don't append the accel marker (leave range_end - * alone); set the accel char to c; record location for - * underline attribute - */ - if (md->accel_char == 0) - md->accel_char = c; - - g_string_append_len (md->text, - range_start, - range_end - range_start); - md->index += range_end - range_start; - - /* The underline should go underneath the char - * we're setting as the next range_start - */ - uline_index = md->index; - uline_len = g_utf8_next_char (p) - p; - - /* set next range_start to include this char */ - range_start = p; - } - - /* reset range_end */ - range_end = NULL; - } - else if (c == md->accel_marker) - { - range_end = p; - } - - p = g_utf8_next_char (p); - } + { + gunichar c; + + c = g_utf8_get_char (p); + + if (range_end) + { + if (c == md->accel_marker) + { + /* escaped accel marker; move range_end + * past the accel marker that came before, + * append the whole thing + */ + range_end = g_utf8_next_char (range_end); + g_string_append_len (md->text, + range_start, + range_end - range_start); + md->index += range_end - range_start; + + /* set next range_start, skipping accel marker */ + range_start = g_utf8_next_char (p); + } + else + { + /* Don't append the accel marker (leave range_end + * alone); set the accel char to c; record location for + * underline attribute + */ + if (md->accel_char == 0) + md->accel_char = c; + + g_string_append_len (md->text, + range_start, + range_end - range_start); + md->index += range_end - range_start; + + /* The underline should go underneath the char + * we're setting as the next range_start + */ + uline_index = md->index; + uline_len = g_utf8_next_char (p) - p; + + /* set next range_start to include this char */ + range_start = p; + } + + /* reset range_end */ + range_end = NULL; + } + else if (c == md->accel_marker) + { + range_end = p; + } + + p = g_utf8_next_char (p); + } if (range_end) - { - g_string_append_len (md->text, - range_start, - range_end - range_start); - md->index += range_end - range_start; - } + { + g_string_append_len (md->text, + range_start, + range_end - range_start); + md->index += range_end - range_start; + } else - { - g_string_append_len (md->text, - range_start, - end - range_start); - md->index += end - range_start; - } + { + g_string_append_len (md->text, + range_start, + end - range_start); + md->index += end - range_start; + } if (md->attr_list != NULL && uline_index >= 0) - { - /* Add the underline indicating the accelerator */ - PangoAttribute *attr; + { + /* Add the underline indicating the accelerator */ + PangoAttribute *attr; - attr = pango_attr_underline_new (PANGO_UNDERLINE_LOW); + attr = pango_attr_underline_new (PANGO_UNDERLINE_LOW); - attr->start_index = uline_index; - attr->end_index = uline_index + uline_len; + attr->start_index = uline_index; + attr->end_index = uline_index + uline_len; - pango_attr_list_change (md->attr_list, attr); - } + pango_attr_list_change (md->attr_list, attr); + } } } @@ -574,12 +574,12 @@ static const GMarkupParser pango_markup_parser = { **/ gboolean pango_parse_markup (const char *markup_text, - int length, - gunichar accel_marker, - PangoAttrList **attr_list, - char **text, - gunichar *accel_char, - GError **error) + int length, + gunichar accel_marker, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error) { GMarkupParseContext *context = NULL; MarkupData *md = NULL; @@ -614,7 +614,7 @@ pango_parse_markup (const char *markup_text, md->to_apply = NULL; context = g_markup_parse_context_new (&pango_markup_parser, - 0, md, NULL); + 0, md, NULL); if (length < 0) length = strlen (markup_text); @@ -629,23 +629,23 @@ pango_parse_markup (const char *markup_text, if (needs_root) if (!g_markup_parse_context_parse (context, - "<markup>", - -1, - error)) + "<markup>", + -1, + error)) goto error; if (!g_markup_parse_context_parse (context, - markup_text, - length, - error)) + markup_text, + length, + error)) goto error; if (needs_root) if (!g_markup_parse_context_parse (context, - "</markup>", - -1, - error)) + "</markup>", + -1, + error)) goto error; if (!g_markup_parse_context_end_parse (context, error)) @@ -660,14 +660,14 @@ pango_parse_markup (const char *markup_text, */ tmp_list = md->to_apply; while (tmp_list != NULL) - { - PangoAttribute *attr = tmp_list->data; + { + PangoAttribute *attr = tmp_list->data; - /* Innermost tags before outermost */ - pango_attr_list_change (md->attr_list, attr); + /* Innermost tags before outermost */ + pango_attr_list_change (md->attr_list, attr); - tmp_list = g_slist_next (tmp_list); - } + tmp_list = g_slist_next (tmp_list); + } g_slist_free (md->to_apply); md->to_apply = NULL; } @@ -709,27 +709,27 @@ pango_parse_markup (const char *markup_text, static void set_bad_attribute (GError **error, - GMarkupParseContext *context, - const char *element_name, - const char *attribute_name) + GMarkupParseContext *context, + const char *element_name, + const char *attribute_name) { gint line_number, char_number; g_markup_parse_context_get_position (context, - &line_number, &char_number); + &line_number, &char_number); g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, - _("Tag '%s' does not support attribute '%s' on line %d char %d"), - element_name, - attribute_name, - line_number, char_number); + G_MARKUP_ERROR, + G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, + _("Tag '%s' does not support attribute '%s' on line %d char %d"), + element_name, + attribute_name, + line_number, char_number); } static void add_attribute (OpenTag *ot, - PangoAttribute *attr) + PangoAttribute *attr) { if (ot == NULL) pango_attribute_destroy (attr); @@ -738,18 +738,18 @@ add_attribute (OpenTag *ot, } #define CHECK_NO_ATTRS(elem) G_STMT_START { \ - if (*names != NULL) { \ - set_bad_attribute (error, context, (elem), *names); \ - return FALSE; \ - } }G_STMT_END + if (*names != NULL) { \ + set_bad_attribute (error, context, (elem), *names); \ + return FALSE; \ + } }G_STMT_END static gboolean b_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("b"); add_attribute (tag, pango_attr_weight_new (PANGO_WEIGHT_BOLD)); @@ -758,11 +758,11 @@ b_parse_func (MarkupData *md, static gboolean big_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("big"); @@ -778,7 +778,7 @@ big_parse_func (MarkupData *md, static gboolean parse_absolute_size (OpenTag *tag, - const char *size) + const char *size) { SizeLevel level = Medium; double factor; @@ -828,13 +828,13 @@ attr_strcmp (gconstpointer pa, cb = *b++; if (ca == cb) - continue; + continue; ca = ca == '_' ? '-' : ca; cb = cb == '_' ? '-' : cb; if (ca != cb) - return cb - ca; + return cb - ca; } ca = *a; @@ -882,9 +882,9 @@ span_parse_boolean (const char *attr_name, strcmp (attr_val, "y") == 0) *val = TRUE; else if (strcmp (attr_val, "false") == 0 || - strcmp (attr_val, "no") == 0 || - strcmp (attr_val, "f") == 0 || - strcmp (attr_val, "n") == 0) + strcmp (attr_val, "no") == 0 || + strcmp (attr_val, "f") == 0 || + strcmp (attr_val, "n") == 0) *val = FALSE; else { @@ -951,11 +951,11 @@ span_parse_enum (const char *attr_name, static gboolean span_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { int line_number, char_number; int i; @@ -981,17 +981,17 @@ span_parse_func (MarkupData *md, const char *gravity_hint = NULL; g_markup_parse_context_get_position (context, - &line_number, &char_number); + &line_number, &char_number); #define CHECK_DUPLICATE(var) G_STMT_START{ \ - if ((var) != NULL) { \ - g_set_error (error, G_MARKUP_ERROR, \ - G_MARKUP_ERROR_INVALID_CONTENT, \ - _("Attribute '%s' occurs twice on <span> tag " \ - "on line %d char %d, may only occur once"), \ - names[i], line_number, char_number); \ - return FALSE; \ - }}G_STMT_END + if ((var) != NULL) { \ + g_set_error (error, G_MARKUP_ERROR, \ + G_MARKUP_ERROR_INVALID_CONTENT, \ + _("Attribute '%s' occurs twice on <span> tag " \ + "on line %d char %d, may only occur once"), \ + names[i], line_number, char_number); \ + return FALSE; \ + }}G_STMT_END #define CHECK_ATTRIBUTE2(var, name) \ if (attr_strcmp (names[i], (name)) == 0) { \ CHECK_DUPLICATE (var); \ @@ -1008,49 +1008,49 @@ span_parse_func (MarkupData *md, switch (names[i][0]) { case 'f': - CHECK_ATTRIBUTE2(family, "face"); - CHECK_ATTRIBUTE (fallback); - CHECK_ATTRIBUTE2(desc, "font_desc"); - CHECK_ATTRIBUTE2(family, "font_family"); - CHECK_ATTRIBUTE (foreground); + CHECK_ATTRIBUTE2(family, "face"); + CHECK_ATTRIBUTE (fallback); + CHECK_ATTRIBUTE2(desc, "font_desc"); + CHECK_ATTRIBUTE2(family, "font_family"); + CHECK_ATTRIBUTE (foreground); break; case 's': - CHECK_ATTRIBUTE (size); - CHECK_ATTRIBUTE (stretch); - CHECK_ATTRIBUTE (strikethrough); - CHECK_ATTRIBUTE (strikethrough_color); - CHECK_ATTRIBUTE (style); + CHECK_ATTRIBUTE (size); + CHECK_ATTRIBUTE (stretch); + CHECK_ATTRIBUTE (strikethrough); + CHECK_ATTRIBUTE (strikethrough_color); + CHECK_ATTRIBUTE (style); break; case 'g': - CHECK_ATTRIBUTE (gravity); - CHECK_ATTRIBUTE (gravity_hint); + CHECK_ATTRIBUTE (gravity); + CHECK_ATTRIBUTE (gravity_hint); break; case 'l': - CHECK_ATTRIBUTE (lang); - CHECK_ATTRIBUTE (letter_spacing); + CHECK_ATTRIBUTE (lang); + CHECK_ATTRIBUTE (letter_spacing); break; case 'u': - CHECK_ATTRIBUTE (underline); - CHECK_ATTRIBUTE (underline_color); + CHECK_ATTRIBUTE (underline); + CHECK_ATTRIBUTE (underline_color); break; default: - CHECK_ATTRIBUTE (background); - CHECK_ATTRIBUTE2(foreground, "color"); - CHECK_ATTRIBUTE (rise); - CHECK_ATTRIBUTE (variant); - CHECK_ATTRIBUTE (weight); + CHECK_ATTRIBUTE (background); + CHECK_ATTRIBUTE2(foreground, "color"); + CHECK_ATTRIBUTE (rise); + CHECK_ATTRIBUTE (variant); + CHECK_ATTRIBUTE (weight); break; } if (!found) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, - _("Attribute '%s' is not allowed on the <span> tag " - "on line %d char %d"), - names[i], line_number, char_number); - return FALSE; - } + { + g_set_error (error, G_MARKUP_ERROR, + G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, + _("Attribute '%s' is not allowed on the <span> tag " + "on line %d char %d"), + names[i], line_number, char_number); + return FALSE; + } ++i; } @@ -1062,12 +1062,12 @@ span_parse_func (MarkupData *md, parsed = pango_font_description_from_string (desc); if (parsed) - { - add_attribute (tag, pango_attr_font_desc_new (parsed)); + { + add_attribute (tag, pango_attr_font_desc_new (parsed)); if (tag) open_tag_set_absolute_font_size (tag, pango_font_description_get_size (parsed)); - pango_font_description_free (parsed); - } + pango_font_description_free (parsed); + } } if (G_UNLIKELY (family)) @@ -1078,57 +1078,57 @@ span_parse_func (MarkupData *md, if (G_UNLIKELY (size)) { if (g_ascii_isdigit (*size)) - { - char *end = NULL; - gulong n; - - n = strtoul (size, &end, 10); - - if (*end != '\0' || n < 0 || n > 1000000) - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - _("Value of 'size' attribute on <span> tag on line %d" - "could not be parsed; should be an integer, or a " - "string such as 'small', not '%s'"), - line_number, size); - goto error; - } - - add_attribute (tag, pango_attr_size_new (n)); + { + char *end = NULL; + gulong n; + + n = strtoul (size, &end, 10); + + if (*end != '\0' || n < 0 || n > 1000000) + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of 'size' attribute on <span> tag on line %d" + "could not be parsed; should be an integer, or a " + "string such as 'small', not '%s'"), + line_number, size); + goto error; + } + + add_attribute (tag, pango_attr_size_new (n)); if (tag) open_tag_set_absolute_font_size (tag, n); - } + } else if (strcmp (size, "smaller") == 0) - { + { if (tag) { tag->scale_level_delta -= 1; tag->scale_level -= 1; } - } + } else if (strcmp (size, "larger") == 0) - { + { if (tag) { tag->scale_level_delta += 1; tag->scale_level += 1; } - } + } else if (parse_absolute_size (tag, size)) - ; /* nothing */ + ; /* nothing */ else - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - _("Value of 'size' attribute on <span> tag on line %d" - "could not be parsed; should be an integer, or a " - "string such as 'small', not '%s'"), - line_number, size); - goto error; - } + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("Value of 'size' attribute on <span> tag on line %d" + "could not be parsed; should be an integer, or a " + "string such as 'small', not '%s'"), + line_number, size); + goto error; + } } if (G_UNLIKELY (style)) @@ -1136,18 +1136,18 @@ span_parse_func (MarkupData *md, PangoStyle pango_style; if (pango_parse_style (style, &pango_style, FALSE)) - add_attribute (tag, pango_attr_style_new (pango_style)); + add_attribute (tag, pango_attr_style_new (pango_style)); else - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - _("'%s' is not a valid value for the 'style' attribute " - "on <span> tag, line %d; valid values are " - "'normal', 'oblique', 'italic'"), - style, line_number); - goto error; - } + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'style' attribute " + "on <span> tag, line %d; valid values are " + "'normal', 'oblique', 'italic'"), + style, line_number); + goto error; + } } if (G_UNLIKELY (weight)) @@ -1155,19 +1155,19 @@ span_parse_func (MarkupData *md, PangoWeight pango_weight; if (pango_parse_weight (weight, &pango_weight, FALSE)) - add_attribute (tag, - pango_attr_weight_new (pango_weight)); + add_attribute (tag, + pango_attr_weight_new (pango_weight)); else - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - _("'%s' is not a valid value for the 'weight' " - "attribute on <span> tag, line %d; valid " - "values are for example 'light', 'ultrabold' or a number"), - weight, line_number); - goto error; - } + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'weight' " + "attribute on <span> tag, line %d; valid " + "values are for example 'light', 'ultrabold' or a number"), + weight, line_number); + goto error; + } } if (G_UNLIKELY (variant)) @@ -1175,18 +1175,18 @@ span_parse_func (MarkupData *md, PangoVariant pango_variant; if (pango_parse_variant (variant, &pango_variant, FALSE)) - add_attribute (tag, pango_attr_variant_new (pango_variant)); + add_attribute (tag, pango_attr_variant_new (pango_variant)); else - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - _("'%s' is not a valid value for the 'variant' " - "attribute on <span> tag, line %d; valid values are " - "'normal', 'smallcaps'"), - variant, line_number); - goto error; - } + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'variant' " + "attribute on <span> tag, line %d; valid values are " + "'normal', 'smallcaps'"), + variant, line_number); + goto error; + } } if (G_UNLIKELY (stretch)) @@ -1194,19 +1194,19 @@ span_parse_func (MarkupData *md, PangoStretch pango_stretch; if (pango_parse_stretch (stretch, &pango_stretch, FALSE)) - add_attribute (tag, pango_attr_stretch_new (pango_stretch)); + add_attribute (tag, pango_attr_stretch_new (pango_stretch)); else - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - _("'%s' is not a valid value for the 'stretch' " - "attribute on <span> tag, line %d; valid " - "values are for example 'condensed', " - "'ultraexpanded', 'normal'"), - stretch, line_number); - goto error; - } + { + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + _("'%s' is not a valid value for the 'stretch' " + "attribute on <span> tag, line %d; valid " + "values are for example 'condensed', " + "'ultraexpanded', 'normal'"), + stretch, line_number); + goto error; + } } if (G_UNLIKELY (foreground)) @@ -1214,7 +1214,7 @@ span_parse_func (MarkupData *md, PangoColor color; if (!span_parse_color ("foreground", foreground, &color, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_foreground_new (color.red, color.green, color.blue)); } @@ -1224,7 +1224,7 @@ span_parse_func (MarkupData *md, PangoColor color; if (!span_parse_color ("background", background, &color, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_background_new (color.red, color.green, color.blue)); } @@ -1234,7 +1234,7 @@ span_parse_func (MarkupData *md, PangoUnderline ul = PANGO_UNDERLINE_NONE; if (!span_parse_enum ("underline", underline, PANGO_TYPE_UNDERLINE, &ul, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_underline_new (ul)); } @@ -1244,7 +1244,7 @@ span_parse_func (MarkupData *md, PangoColor color; if (!span_parse_color ("underline_color", underline_color, &color, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_underline_color_new (color.red, color.green, color.blue)); } @@ -1254,7 +1254,7 @@ span_parse_func (MarkupData *md, PangoGravity gr = PANGO_GRAVITY_SOUTH; if (!span_parse_enum ("gravity", gravity, PANGO_TYPE_GRAVITY, &gr, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_gravity_new (gr)); } @@ -1264,7 +1264,7 @@ span_parse_func (MarkupData *md, PangoGravityHint hint = PANGO_GRAVITY_HINT_NATURAL; if (!span_parse_enum ("gravity_hint", gravity_hint, PANGO_TYPE_GRAVITY_HINT, &hint, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_gravity_hint_new (hint)); } @@ -1274,7 +1274,7 @@ span_parse_func (MarkupData *md, gboolean b = FALSE; if (!span_parse_boolean ("strikethrough", strikethrough, &b, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_strikethrough_new (b)); } @@ -1284,7 +1284,7 @@ span_parse_func (MarkupData *md, PangoColor color; if (!span_parse_color ("strikethrough_color", strikethrough_color, &color, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_strikethrough_color_new (color.red, color.green, color.blue)); } @@ -1294,7 +1294,7 @@ span_parse_func (MarkupData *md, gboolean b = FALSE; if (!span_parse_boolean ("fallback", fallback, &b, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_fallback_new (b)); } @@ -1304,7 +1304,7 @@ span_parse_func (MarkupData *md, gint n = 0; if (!span_parse_int ("rise", rise, &n, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_rise_new (n)); } @@ -1314,7 +1314,7 @@ span_parse_func (MarkupData *md, gint n = 0; if (!span_parse_int ("letter_spacing", letter_spacing, &n, line_number, error)) - goto error; + goto error; add_attribute (tag, pango_attr_letter_spacing_new (n)); } @@ -1334,11 +1334,11 @@ span_parse_func (MarkupData *md, static gboolean i_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("i"); add_attribute (tag, pango_attr_style_new (PANGO_STYLE_ITALIC)); @@ -1348,11 +1348,11 @@ i_parse_func (MarkupData *md, static gboolean markup_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { /* We don't do anything with this tag at the moment. */ @@ -1361,11 +1361,11 @@ markup_parse_func (MarkupData *md, static gboolean s_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("s"); add_attribute (tag, pango_attr_strikethrough_new (TRUE)); @@ -1377,11 +1377,11 @@ s_parse_func (MarkupData *md, static gboolean sub_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("sub"); @@ -1399,11 +1399,11 @@ sub_parse_func (MarkupData *md, static gboolean sup_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("sup"); @@ -1421,11 +1421,11 @@ sup_parse_func (MarkupData *md, static gboolean small_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("small"); @@ -1441,11 +1441,11 @@ small_parse_func (MarkupData *md, static gboolean tt_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("tt"); @@ -1456,11 +1456,11 @@ tt_parse_func (MarkupData *md, static gboolean u_parse_func (MarkupData *md, - OpenTag *tag, - const gchar **names, - const gchar **values, - GMarkupParseContext *context, - GError **error) + OpenTag *tag, + const gchar **names, + const gchar **values, + GMarkupParseContext *context, + GError **error) { CHECK_NO_ATTRS("u"); add_attribute (tag, pango_attr_underline_new (PANGO_UNDERLINE_SINGLE)); diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index b2f4dac6..5f3ff33f 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -46,21 +46,21 @@ pango_ot_info_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoOTInfoClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc)pango_ot_info_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoOTInfo), - 0, /* n_preallocs */ + sizeof (PangoOTInfoClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc)pango_ot_info_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoOTInfo), + 0, /* n_preallocs */ NULL, /* init */ NULL, /* value_table */ }; object_type = g_type_register_static (G_TYPE_OBJECT, - I_("PangoOTInfo"), - &object_info, 0); + I_("PangoOTInfo"), + &object_info, 0); } return object_type; diff --git a/pango/pango-ot-ruleset.c b/pango/pango-ot-ruleset.c index 666dfcf5..a54c87ef 100644 --- a/pango/pango-ot-ruleset.c +++ b/pango/pango-ot-ruleset.c @@ -48,21 +48,21 @@ pango_ot_ruleset_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoOTRulesetClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc)pango_ot_ruleset_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoOTRuleset), - 0, /* n_preallocs */ - (GInstanceInitFunc)pango_ot_ruleset_init, + sizeof (PangoOTRulesetClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc)pango_ot_ruleset_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoOTRuleset), + 0, /* n_preallocs */ + (GInstanceInitFunc)pango_ot_ruleset_init, NULL /* value_table */ }; object_type = g_type_register_static (G_TYPE_OBJECT, - I_("PangoOTRuleset"), - &object_info, 0); + I_("PangoOTRuleset"), + &object_info, 0); } return object_type; @@ -220,14 +220,14 @@ pango_ot_ruleset_position (PangoOTRuleset *ruleset, continue; if (!gpos) - { + { gpos = pango_ot_info_get_gpos (ruleset->info); if (gpos) HB_GPOS_Clear_Features (gpos); else return; - } + } HB_GPOS_Add_Feature (gpos, rule->feature_index, rule->property_bit); } diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c index 702af77c..daa877fb 100644 --- a/pango/pango-renderer.c +++ b/pango/pango-renderer.c @@ -393,10 +393,10 @@ get_item_properties (PangoItem *item, *shape_attr = (PangoAttrShape *)attr; break; - case PANGO_ATTR_RISE: - if (rise) - *rise = ((PangoAttrInt *)attr)->value; - break; + case PANGO_ATTR_RISE: + if (rise) + *rise = ((PangoAttrInt *)attr)->value; + break; default: break; @@ -482,7 +482,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer, PangoRectangle logical_rect, *logical = NULL; if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) - logical = &logical_rect; + logical = &logical_rect; pango_renderer_prepare_run (renderer, run); @@ -516,7 +516,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer, state.logical_rect_end = x + x_off + glyph_string_width; if (run->item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE) - rise += logical_rect.y + logical_rect.height / 2; + rise += logical_rect.y + logical_rect.height / 2; if (renderer->priv->color_set[PANGO_RENDER_PART_BACKGROUND]) diff --git a/pango/pango-script.c b/pango/pango-script.c index 88b2ef64..1ee63055 100644 --- a/pango/pango-script.c +++ b/pango/pango-script.c @@ -364,7 +364,7 @@ pango_script_iter_next (PangoScriptIter *iter) if (iter->paren_sp < start_sp) start_sp = iter->paren_sp; - } + } } else { diff --git a/pango/pango-tabs.c b/pango/pango-tabs.c index f582b232..fbb9037a 100644 --- a/pango/pango-tabs.c +++ b/pango/pango-tabs.c @@ -29,11 +29,11 @@ typedef struct _PangoTab PangoTab; struct _PangoTab { gint location; /* Offset in pixels of this tab stop - * from the left margin of the text. - */ + * from the left margin of the text. + */ PangoTabAlign alignment; /* Where the tab stop appears relative - * to the text. - */ + * to the text. + */ }; struct _PangoTabArray @@ -69,7 +69,7 @@ init_tabs (PangoTabArray *array, gint start, gint end) **/ PangoTabArray* pango_tab_array_new (gint initial_size, - gboolean positions_in_pixels) + gboolean positions_in_pixels) { PangoTabArray *array; @@ -115,10 +115,10 @@ pango_tab_array_new (gint initial_size, **/ PangoTabArray * pango_tab_array_new_with_positions (gint size, - gboolean positions_in_pixels, - PangoTabAlign first_alignment, - gint first_position, - ...) + gboolean positions_in_pixels, + PangoTabAlign first_alignment, + gint first_position, + ...) { PangoTabArray *array; va_list args; @@ -163,8 +163,8 @@ pango_tab_array_get_type (void) if (our_type == 0) our_type = g_boxed_type_register_static (I_("PangoTabArray"), - (GBoxedCopyFunc)pango_tab_array_copy, - (GBoxedFreeFunc)pango_tab_array_free); + (GBoxedCopyFunc)pango_tab_array_copy, + (GBoxedFreeFunc)pango_tab_array_free); return our_type; } @@ -235,7 +235,7 @@ pango_tab_array_get_size (PangoTabArray *tab_array) **/ void pango_tab_array_resize (PangoTabArray *tab_array, - gint new_size) + gint new_size) { if (new_size > tab_array->allocated) { @@ -243,10 +243,10 @@ pango_tab_array_resize (PangoTabArray *tab_array, /* Ratchet allocated size up above the index. */ if (tab_array->allocated == 0) - tab_array->allocated = 2; + tab_array->allocated = 2; while (new_size > tab_array->allocated) - tab_array->allocated = tab_array->allocated * 2; + tab_array->allocated = tab_array->allocated * 2; tab_array->tabs = g_renew (PangoTab, tab_array->tabs, tab_array->allocated); @@ -271,9 +271,9 @@ pango_tab_array_resize (PangoTabArray *tab_array, **/ void pango_tab_array_set_tab (PangoTabArray *tab_array, - gint tab_index, - PangoTabAlign alignment, - gint location) + gint tab_index, + PangoTabAlign alignment, + gint location) { g_return_if_fail (tab_array != NULL); g_return_if_fail (tab_index >= 0); @@ -299,9 +299,9 @@ pango_tab_array_set_tab (PangoTabArray *tab_array, **/ void pango_tab_array_get_tab (PangoTabArray *tab_array, - gint tab_index, - PangoTabAlign *alignment, - gint *location) + gint tab_index, + PangoTabAlign *alignment, + gint *location) { g_return_if_fail (tab_array != NULL); g_return_if_fail (tab_index < tab_array->size); @@ -327,8 +327,8 @@ pango_tab_array_get_tab (PangoTabArray *tab_array, **/ void pango_tab_array_get_tabs (PangoTabArray *tab_array, - PangoTabAlign **alignments, - gint **locations) + PangoTabAlign **alignments, + gint **locations) { gint i; @@ -344,9 +344,9 @@ pango_tab_array_get_tabs (PangoTabArray *tab_array, while (i < tab_array->size) { if (alignments) - (*alignments)[i] = tab_array->tabs[i].alignment; + (*alignments)[i] = tab_array->tabs[i].alignment; if (locations) - (*locations)[i] = tab_array->tabs[i].location; + (*locations)[i] = tab_array->tabs[i].location; ++i; } diff --git a/pango/pango-tabs.h b/pango/pango-tabs.h index f60949e8..160fff73 100644 --- a/pango/pango-tabs.h +++ b/pango/pango-tabs.h @@ -44,29 +44,29 @@ typedef enum #define PANGO_TYPE_TAB_ARRAY (pango_tab_array_get_type ()) PangoTabArray *pango_tab_array_new (gint initial_size, - gboolean positions_in_pixels); + gboolean positions_in_pixels); PangoTabArray *pango_tab_array_new_with_positions (gint size, - gboolean positions_in_pixels, - PangoTabAlign first_alignment, - gint first_position, - ...); + gboolean positions_in_pixels, + PangoTabAlign first_alignment, + gint first_position, + ...); GType pango_tab_array_get_type (void); PangoTabArray *pango_tab_array_copy (PangoTabArray *src); void pango_tab_array_free (PangoTabArray *tab_array); gint pango_tab_array_get_size (PangoTabArray *tab_array); void pango_tab_array_resize (PangoTabArray *tab_array, - gint new_size); + gint new_size); void pango_tab_array_set_tab (PangoTabArray *tab_array, - gint tab_index, - PangoTabAlign alignment, - gint location); + gint tab_index, + PangoTabAlign alignment, + gint location); void pango_tab_array_get_tab (PangoTabArray *tab_array, - gint tab_index, - PangoTabAlign *alignment, - gint *location); + gint tab_index, + PangoTabAlign *alignment, + gint *location); void pango_tab_array_get_tabs (PangoTabArray *tab_array, - PangoTabAlign **alignments, - gint **locations); + PangoTabAlign **alignments, + gint **locations); gboolean pango_tab_array_get_positions_in_pixels (PangoTabArray *tab_array); diff --git a/pango/pango-utils.c b/pango/pango-utils.c index 02444755..46c18e52 100644 --- a/pango/pango-utils.c +++ b/pango/pango-utils.c @@ -133,8 +133,8 @@ pango_version_string (void) **/ const gchar* pango_version_check (int required_major, - int required_minor, - int required_micro) + int required_minor, + int required_micro) { gint pango_effective_micro = 100 * PANGO_VERSION_MINOR + PANGO_VERSION_MICRO; gint required_effective_micro = 100 * required_minor + required_micro; @@ -763,13 +763,13 @@ pango_parse_enum (GType type, if (v) { if (G_LIKELY (value)) - *value = v->value; + *value = v->value; } else { ret = FALSE; if (warn || possible_values) - { + { int i; GString *s = g_string_new (NULL); @@ -777,7 +777,7 @@ pango_parse_enum (GType type, i++ , v = g_enum_get_value (class, i)) { if (i) - g_string_append_c (s, '/'); + g_string_append_c (s, '/'); g_string_append (s, v->value_nick); } @@ -1149,8 +1149,8 @@ pango_language_get_type (void) if (our_type == 0) our_type = g_boxed_type_register_static (I_("PangoLanguage"), - (GBoxedCopyFunc)pango_language_copy, - (GBoxedFreeFunc)pango_language_free); + (GBoxedCopyFunc)pango_language_copy, + (GBoxedFreeFunc)pango_language_free); return our_type; } diff --git a/pango/pango-utils.h b/pango/pango-utils.h index 7756f093..f44f2b55 100644 --- a/pango/pango-utils.h +++ b/pango/pango-utils.h @@ -135,8 +135,8 @@ G_CONST_RETURN char * pango_version_string (void); /* Check that run-time Pango is as new as required */ G_CONST_RETURN char * pango_version_check (int required_major, - int required_minor, - int required_micro); + int required_minor, + int required_micro); G_END_DECLS diff --git a/pango/pangoatsui-fontmap.c b/pango/pangoatsui-fontmap.c index c9bbfe6a..0ba5caec 100644 --- a/pango/pangoatsui-fontmap.c +++ b/pango/pangoatsui-fontmap.c @@ -202,20 +202,20 @@ pango_atsui_family_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFamilyClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_atsui_family_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoATSUIFamily), - 0, /* n_preallocs */ - (GInstanceInitFunc) pango_atsui_family_init, + sizeof (PangoFontFamilyClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_atsui_family_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoATSUIFamily), + 0, /* n_preallocs */ + (GInstanceInitFunc) pango_atsui_family_init, }; object_type = g_type_register_static (PANGO_TYPE_FONT_FAMILY, - I_("PangoATSUIFamily"), - &object_info, 0); + I_("PangoATSUIFamily"), + &object_info, 0); } return object_type; @@ -280,8 +280,8 @@ pango_atsui_face_get_face_name (PangoFontFace *face) static void pango_atsui_face_list_sizes (PangoFontFace *face, - int **sizes, - int *n_sizes) + int **sizes, + int *n_sizes) { *n_sizes = 0; *sizes = NULL; @@ -321,20 +321,20 @@ pango_atsui_face_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFaceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_atsui_face_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoATSUIFace), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, + sizeof (PangoFontFaceClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_atsui_face_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoATSUIFace), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, }; object_type = g_type_register_static (PANGO_TYPE_FONT_FACE, - I_("PangoATSUIFace"), - &object_info, 0); + I_("PangoATSUIFace"), + &object_info, 0); } return object_type; @@ -579,7 +579,7 @@ pango_atsui_font_map_load_font (PangoFontMap *fontmap, } if (best_desc == NULL || best_face == NULL) - return NULL; + return NULL; pango_font_description_set_size (best_desc, size); diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c index ccce9be5..72130e41 100644 --- a/pango/pangocairo-atsuifont.c +++ b/pango/pangocairo-atsuifont.c @@ -165,7 +165,7 @@ pango_cairo_atsui_font_get_glyph_extents (PangoFont *font, ink_rect->x = ink_rect->y = ink_rect->width = ink_rect->height = 0; } if (logical_rect) - { + { logical_rect->x = 0; logical_rect->y = - font_extents.ascent * PANGO_SCALE; logical_rect->width = 0; diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c index 6fb61fc7..65b9e038 100644 --- a/pango/pangocairo-fcfont.c +++ b/pango/pangocairo-fcfont.c @@ -100,7 +100,7 @@ pango_cairo_fc_font_get_font_face (PangoCairoFont *font) * This means out of memory or a cairo/fontconfig/FreeType bug, */ if (!cffont->font_face) - return NULL; + return NULL; } return cffont->font_face; @@ -118,7 +118,7 @@ pango_cairo_fc_font_get_scaled_font (PangoCairoFont *font) font_face = pango_cairo_fc_font_get_font_face (font); if (!font_face) - return NULL; + return NULL; cffont->scaled_font = cairo_scaled_font_create (font_face, &cffont->font_matrix, @@ -130,7 +130,7 @@ pango_cairo_fc_font_get_scaled_font (PangoCairoFont *font) * or a missing font... */ if (!cffont->scaled_font) - return NULL; + return NULL; } return cffont->scaled_font; @@ -249,7 +249,7 @@ pango_cairo_fc_font_get_metrics (PangoFont *font, } shift = (height - info->metrics->ascent) - info->metrics->descent; if (fcfont->is_hinted) - shift &= ~(PANGO_SCALE - 1); + shift &= ~(PANGO_SCALE - 1); info->metrics->descent += shift; info->metrics->underline_position -= shift; info->metrics->strikethrough_position -= shift; @@ -300,14 +300,14 @@ pango_cairo_fc_font_glyph_extents_cache_init (PangoCairoFcFont *cffont) default: case PANGO_GRAVITY_AUTO: case PANGO_GRAVITY_SOUTH: - cffont->font_extents.y = - pango_units_from_double (font_extents.ascent); + cffont->font_extents.y = - pango_units_from_double (font_extents.ascent); break; case PANGO_GRAVITY_NORTH: - cffont->font_extents.y = - pango_units_from_double (font_extents.descent); + cffont->font_extents.y = - pango_units_from_double (font_extents.descent); break; case PANGO_GRAVITY_EAST: case PANGO_GRAVITY_WEST: - cffont->font_extents.y = - pango_units_from_double ((font_extents.ascent + font_extents.descent) * 0.5); + cffont->font_extents.y = - pango_units_from_double ((font_extents.ascent + font_extents.descent) * 0.5); } cffont->glyph_extents_cache = g_new0 (GlyphExtentsCacheEntry, GLYPH_CACHE_NUM_ENTRIES); diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c index 87dccd35..68130e28 100644 --- a/pango/pangocairo-font.c +++ b/pango/pangocairo-font.c @@ -75,7 +75,7 @@ _pango_cairo_font_install (PangoCairoFont *font, if (G_UNLIKELY (!PANGO_IS_CAIRO_FONT (font))) { if (!_pango_cairo_warning_history.font_install) - { + { _pango_cairo_warning_history.font_install = TRUE; g_warning ("_pango_cairo_font_install called with bad font, expect ugly output"); cairo_set_font_face (cr, NULL); @@ -101,7 +101,7 @@ _pango_cairo_font_get_scaled_font (PangoCairoFont *font) if (G_UNLIKELY (!PANGO_IS_CAIRO_FONT (font))) { if (!_pango_cairo_warning_history.font_get_scaled_font) - { + { _pango_cairo_warning_history.font_get_scaled_font = TRUE; g_warning ("_pango_cairo_font_get_scaled_font called with bad font, expect ugly output"); } @@ -301,9 +301,9 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont) void _pango_cairo_get_glyph_extents_missing (PangoCairoFont *cfont, - PangoGlyph glyph, - PangoRectangle *ink_rect, - PangoRectangle *logical_rect) + PangoGlyph glyph, + PangoRectangle *ink_rect, + PangoRectangle *logical_rect) { PangoCairoHexBoxInfo *hbi; gint rows, cols; diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c index 595ff0ce..9ec2e682 100644 --- a/pango/pangocairo-render.c +++ b/pango/pangocairo-render.c @@ -235,22 +235,22 @@ pango_cairo_renderer_draw_glyphs (PangoRenderer *renderer, PangoGlyphInfo *gi = &glyphs->glyphs[i]; if (gi->glyph != PANGO_GLYPH_EMPTY) - { - double cx = base_x + (double)(x_position + gi->geometry.x_offset) / PANGO_SCALE; - double cy = gi->geometry.y_offset == 0 ? + { + double cx = base_x + (double)(x_position + gi->geometry.x_offset) / PANGO_SCALE; + double cy = gi->geometry.y_offset == 0 ? base_y : base_y + (double)(gi->geometry.y_offset) / PANGO_SCALE; - if (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG) + if (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG) _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy); - else - { - cairo_glyphs[count].index = gi->glyph; - cairo_glyphs[count].x = cx; - cairo_glyphs[count].y = cy; - count++; - } - } + else + { + cairo_glyphs[count].index = gi->glyph; + cairo_glyphs[count].x = cx; + cairo_glyphs[count].y = cy; + count++; + } + } x_position += gi->geometry.width; } @@ -433,7 +433,7 @@ acquire_renderer (gboolean *free_renderer) if (G_LIKELY (G_TRYLOCK (cached_renderer))) { if (G_UNLIKELY (!cached_renderer)) - cached_renderer = g_object_new (PANGO_TYPE_CAIRO_RENDERER, NULL); + cached_renderer = g_object_new (PANGO_TYPE_CAIRO_RENDERER, NULL); renderer = cached_renderer; *free_renderer = FALSE; @@ -651,10 +651,10 @@ pango_cairo_show_layout (cairo_t *cr, **/ void pango_cairo_show_error_underline (cairo_t *cr, - double x, - double y, - double width, - double height) + double x, + double y, + double width, + double height) { g_return_if_fail (cr != NULL); g_return_if_fail ((width >= 0) && (height >= 0)); @@ -745,10 +745,10 @@ pango_cairo_layout_path (cairo_t *cr, **/ void pango_cairo_error_underline_path (cairo_t *cr, - double x, - double y, - double width, - double height) + double x, + double y, + double width, + double height) { g_return_if_fail (cr != NULL); g_return_if_fail ((width >= 0) && (height >= 0)); diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c index 297012db..edfce056 100644 --- a/pango/pangocairo-win32font.c +++ b/pango/pangocairo-win32font.c @@ -288,14 +288,14 @@ max_glyph_width (PangoLayout *layout) PangoLayoutLine *line = l->data; for (r = line->runs; r; r = r->next) - { - PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; - int i; - - for (i = 0; i < glyphs->num_glyphs; i++) - if (glyphs->glyphs[i].geometry.width > max_width) - max_width = glyphs->glyphs[i].geometry.width; - } + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } } return max_width; diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c index d552c485..175c104c 100644 --- a/pango/pangofc-font.c +++ b/pango/pangofc-font.c @@ -419,14 +419,14 @@ max_glyph_width (PangoLayout *layout) PangoLayoutLine *line = l->data; for (r = line->runs; r; r = r->next) - { - PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; - int i; - - for (i = 0; i < glyphs->num_glyphs; i++) - if (glyphs->glyphs[i].geometry.width > max_width) - max_width = glyphs->glyphs[i].geometry.width; - } + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } } return max_width; @@ -470,7 +470,7 @@ pango_fc_font_create_metrics_for_context (PangoFcFont *fcfont, */ static PangoFontMetrics * pango_fc_font_get_metrics (PangoFont *font, - PangoLanguage *language) + PangoLanguage *language) { PangoFcFont *fcfont = PANGO_FC_FONT (font); PangoFcMetricsInfo *info = NULL; /* Quiet gcc */ @@ -529,7 +529,7 @@ pango_fc_font_real_has_char (PangoFcFont *font, FcCharSet *charset; if (FcPatternGetCharSet (font->font_pattern, - FC_CHARSET, 0, &charset) != FcResultMatch) + FC_CHARSET, 0, &charset) != FcResultMatch) return FALSE; return FcCharSetHasChar (charset, wc); @@ -562,7 +562,7 @@ pango_fc_font_real_get_glyph (PangoFcFont *font, face = PANGO_FC_FONT_LOCK_FACE (font); index = FcFreeTypeCharIndex (face, wc); if (index > (FT_UInt)face->num_glyphs) - index = 0; + index = 0; entry->ch = wc; entry->glyph = index; diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index f1f3a56a..de73ecf9 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -177,7 +177,7 @@ pango_fc_font_map_init (PangoFcFontMap *fcfontmap) registered_modules = TRUE; for (i = 0; _pango_included_fc_modules[i].list; i++) - pango_module_register (&_pango_included_fc_modules[i]); + pango_module_register (&_pango_included_fc_modules[i]); } priv->n_families = -1; @@ -614,7 +614,7 @@ _pango_fc_font_map_remove (PangoFcFontMap *fcfontmap, static PangoFcFamily * create_family (PangoFcFontMap *fcfontmap, const char *family_name, - int spacing) + int spacing) { PangoFcFamily *family = g_object_new (PANGO_FC_TYPE_FAMILY, NULL); family->fontmap = fcfontmap; @@ -683,22 +683,22 @@ pango_fc_font_map_list_families (PangoFontMap *fontmap, { FcChar8 *s; FcResult res; - int spacing; + int spacing; res = FcPatternGetString (fontset->fonts[i], FC_FAMILY, 0, (FcChar8 **) &s); g_assert (res == FcResultMatch); - res = FcPatternGetInteger (fontset->fonts[i], FC_SPACING, 0, &spacing); - g_assert (res == FcResultMatch || res == FcResultNoMatch); - if (res == FcResultNoMatch) - spacing = FC_PROPORTIONAL; + res = FcPatternGetInteger (fontset->fonts[i], FC_SPACING, 0, &spacing); + g_assert (res == FcResultMatch || res == FcResultNoMatch); + if (res == FcResultNoMatch) + spacing = FC_PROPORTIONAL; if (!is_alias_family (s) && !g_hash_table_lookup (temp_family_hash, s)) - { - PangoFcFamily *temp_family = create_family (fcfontmap, (gchar *)s, spacing); - g_hash_table_insert (temp_family_hash, g_strdup (s), s); - priv->families[count++] = temp_family; - } + { + PangoFcFamily *temp_family = create_family (fcfontmap, (gchar *)s, spacing); + g_hash_table_insert (temp_family_hash, g_strdup (s), s); + priv->families[count++] = temp_family; + } } FcFontSetDestroy (fontset); @@ -1723,7 +1723,7 @@ pango_fc_face_get_face_name (PangoFontFace *face) static int compare_ints (gconstpointer ap, - gconstpointer bp) + gconstpointer bp) { int a = *(int *)ap; int b = *(int *)bp; @@ -1738,8 +1738,8 @@ compare_ints (gconstpointer ap, static void pango_fc_face_list_sizes (PangoFontFace *face, - int **sizes, - int *n_sizes) + int **sizes, + int *n_sizes) { PangoFcFace *fcface = PANGO_FC_FACE (face); FcPattern *pattern; @@ -1764,37 +1764,37 @@ pango_fc_face_list_sizes (PangoFontFace *face, size_array = g_array_new (FALSE, FALSE, sizeof (int)); for (i = 0; i < fontset->nfont; i++) - { - if (FcPatternGetDouble (fontset->fonts[i], FC_PIXEL_SIZE, 0, &size) == FcResultMatch) - { - if (dpi < 0) + { + if (FcPatternGetDouble (fontset->fonts[i], FC_PIXEL_SIZE, 0, &size) == FcResultMatch) + { + if (dpi < 0) dpi = pango_fc_font_map_get_resolution (fcface->family->fontmap, NULL); - size_i = (int) (PANGO_SCALE * size * 72.0 / dpi); - g_array_append_val (size_array, size_i); - } - } + size_i = (int) (PANGO_SCALE * size * 72.0 / dpi); + g_array_append_val (size_array, size_i); + } + } g_array_sort (size_array, compare_ints); if (size_array->len == 0) - { - *n_sizes = 0; - if (sizes) - *sizes = NULL; - g_array_free (size_array, TRUE); - } + { + *n_sizes = 0; + if (sizes) + *sizes = NULL; + g_array_free (size_array, TRUE); + } else - { - *n_sizes = size_array->len; - if (sizes) - { - *sizes = (int *) size_array->data; - g_array_free (size_array, FALSE); - } - else - g_array_free (size_array, TRUE); - } + { + *n_sizes = size_array->len; + if (sizes) + { + *sizes = (int *) size_array->data; + g_array_free (size_array, FALSE); + } + else + g_array_free (size_array, TRUE); + } FcFontSetDestroy (fontset); } @@ -1802,7 +1802,7 @@ pango_fc_face_list_sizes (PangoFontFace *face, { *n_sizes = 0; if (sizes) - *sizes = NULL; + *sizes = NULL; } FcPatternDestroy (pattern); @@ -1816,9 +1816,9 @@ pango_fc_family_is_monospace (PangoFontFamily *family) return fcfamily->spacing == FC_MONO || #ifdef FC_DUAL - fcfamily->spacing == FC_DUAL || + fcfamily->spacing == FC_DUAL || #endif - fcfamily->spacing == FC_CHARCELL; + fcfamily->spacing == FC_CHARCELL; } static void @@ -1838,21 +1838,21 @@ pango_fc_face_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFaceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_fc_face_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoFcFace), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, + sizeof (PangoFontFaceClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_fc_face_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoFcFace), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, NULL /* value_table */ }; object_type = g_type_register_static (PANGO_TYPE_FONT_FACE, - I_("PangoFcFace"), - &object_info, 0); + I_("PangoFcFace"), + &object_info, 0); } return object_type; @@ -1937,11 +1937,11 @@ pango_fc_family_list_faces (PangoFontFamily *family, slant = FC_SLANT_ROMAN; if (FcPatternGetString (fontset->fonts[i], FC_STYLE, 0, &font_style) != FcResultMatch) - font_style = NULL; + font_style = NULL; if (weight <= FC_WEIGHT_MEDIUM) { - if (slant == FC_SLANT_ROMAN) + if (slant == FC_SLANT_ROMAN) { has_face[REGULAR] = TRUE; style = "Regular"; @@ -1954,7 +1954,7 @@ pango_fc_family_list_faces (PangoFontFamily *family, } else { - if (slant == FC_SLANT_ROMAN) + if (slant == FC_SLANT_ROMAN) { has_face[BOLD] = TRUE; style = "Bold"; @@ -1967,7 +1967,7 @@ pango_fc_family_list_faces (PangoFontFamily *family, } if (!font_style) - font_style = style; + font_style = style; faces[num++] = create_face (fcfamily, font_style, FALSE); } @@ -2029,21 +2029,21 @@ pango_fc_family_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFamilyClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_fc_family_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoFcFamily), - 0, /* n_preallocs */ - (GInstanceInitFunc) pango_fc_family_init, + sizeof (PangoFontFamilyClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_fc_family_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoFcFamily), + 0, /* n_preallocs */ + (GInstanceInitFunc) pango_fc_family_init, NULL /* value_table */ }; object_type = g_type_register_static (PANGO_TYPE_FONT_FAMILY, - I_("PangoFcFamily"), - &object_info, 0); + I_("PangoFcFamily"), + &object_info, 0); } return object_type; diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h index 0fa7ab58..50c59887 100644 --- a/pango/pangofc-fontmap.h +++ b/pango/pangofc-fontmap.h @@ -107,10 +107,10 @@ struct _PangoFcFontMapClass /*< public >*/ /* Deprecated in favor of context_substitute */ void (*default_substitute) (PangoFcFontMap *fontmap, - FcPattern *pattern); + FcPattern *pattern); /* Deprecated in favor of create_font */ PangoFcFont *(*new_font) (PangoFcFontMap *fontmap, - FcPattern *pattern); + FcPattern *pattern); double (*get_resolution) (PangoFcFontMap *fcfontmap, PangoContext *context); @@ -129,11 +129,11 @@ struct _PangoFcFontMapClass void (*context_substitute) (PangoFcFontMap *fontmap, PangoContext *context, - FcPattern *pattern); + FcPattern *pattern); PangoFcFont *(*create_font) (PangoFcFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc, - FcPattern *pattern); + FcPattern *pattern); /*< private >*/ /* Padding for future expansion */ diff --git a/pango/pangoft2-render.c b/pango/pangoft2-render.c index 0a7b172b..ef052efa 100644 --- a/pango/pangoft2-render.c +++ b/pango/pangoft2-render.c @@ -233,7 +233,7 @@ pango_ft2_renderer_draw_glyph (PangoRenderer *renderer, { glyph = pango_ft2_get_unknown_glyph (font); if (glyph == PANGO_GLYPH_EMPTY) - { + { /* No unknown glyph found for the font, draw a box */ /* Since we only draw an empty box for FT2 renderer, diff --git a/pango/pangoft2.c b/pango/pangoft2.c index d6833e06..5430c323 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -178,7 +178,7 @@ pango_ft2_font_get_face (PangoFont *font) if (G_UNLIKELY (!PANGO_FT2_IS_FONT (font))) { if (!_pango_ft2_warning_history.get_face) - { + { _pango_ft2_warning_history.get_face = TRUE; g_warning ("pango_ft2_font_get_face called with bad font, expect ugly output"); } @@ -193,29 +193,29 @@ pango_ft2_font_get_face (PangoFont *font) /* disable antialiasing if requested */ if (FcPatternGetBool (pattern, - FC_ANTIALIAS, 0, &antialias) != FcResultMatch) + FC_ANTIALIAS, 0, &antialias) != FcResultMatch) antialias = FcTrue; if (antialias) - ft2font->load_flags |= FT_LOAD_NO_BITMAP; + ft2font->load_flags |= FT_LOAD_NO_BITMAP; else ft2font->load_flags |= FT_LOAD_TARGET_MONO; /* disable hinting if requested */ if (FcPatternGetBool (pattern, - FC_HINTING, 0, &hinting) != FcResultMatch) + FC_HINTING, 0, &hinting) != FcResultMatch) hinting = FcTrue; if (!hinting) - ft2font->load_flags |= FT_LOAD_NO_HINTING; + ft2font->load_flags |= FT_LOAD_NO_HINTING; /* force autohinting if requested */ if (FcPatternGetBool (pattern, - FC_AUTOHINT, 0, &autohint) != FcResultMatch) + FC_AUTOHINT, 0, &autohint) != FcResultMatch) autohint = FcFalse; if (autohint) - ft2font->load_flags |= FT_LOAD_FORCE_AUTOHINT; + ft2font->load_flags |= FT_LOAD_FORCE_AUTOHINT; if (FcPatternGetString (pattern, FC_FILE, 0, &filename) != FcResultMatch) goto bail0; @@ -320,7 +320,7 @@ pango_ft2_font_get_glyph_extents (PangoFont *font, { glyph = pango_ft2_get_unknown_glyph (font); if (glyph == PANGO_GLYPH_EMPTY) - { + { /* No unknown glyph found for the font, draw a box */ PangoFontMetrics *metrics = pango_font_get_metrics (font, NULL); @@ -530,7 +530,7 @@ _pango_ft2_ft_strerror (FT_Error error) static char *default_msg = NULL; if (!default_msg) - default_msg = g_malloc (60); + default_msg = g_malloc (60); g_sprintf (default_msg, "Unknown FreeType2 error %#x", error); return default_msg; diff --git a/pango/pangoft2.h b/pango/pangoft2.h index ffa50cae..cd285afa 100644 --- a/pango/pangoft2.h +++ b/pango/pangoft2.h @@ -41,7 +41,7 @@ G_BEGIN_DECLS typedef struct _PangoFT2FontMap PangoFT2FontMap; typedef void (*PangoFT2SubstituteFunc) (FcPattern *pattern, - gpointer data); + gpointer data); /* Calls for applications */ diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index 554ee71f..05a51468 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -67,8 +67,8 @@ GType pango_win32_family_get_type (void); GType pango_win32_face_get_type (void); static void pango_win32_face_list_sizes (PangoFontFace *face, - int **sizes, - int *n_sizes); + int **sizes, + int *n_sizes); static void pango_win32_font_map_finalize (GObject *object); static PangoFont *pango_win32_font_map_load_font (PangoFontMap *fontmap, @@ -178,7 +178,7 @@ pango_win32_enum_proc (LOGFONT *lfp, static gboolean first_match (gpointer key, - gpointer value, + gpointer value, gpointer user_data) { LOGFONT *lfp = (LOGFONT *)key; @@ -198,8 +198,8 @@ typedef struct _ItalicHelper static void ensure_italic (gpointer key, - gpointer value, - gpointer user_data) + gpointer value, + gpointer user_data) { ItalicHelper *helper = (ItalicHelper *)user_data; /* PangoWin32Family *win32family = (PangoWin32Family *)value; */ @@ -210,16 +210,16 @@ ensure_italic (gpointer key, GSList *list = sip->logfonts; while (list) - { + { LOGFONT *lfp = (LOGFONT *)list->data; - if (!lfp->lfItalic) - { + if (!lfp->lfItalic) + { /* we have a non italic variant, look if there is an italic */ LOGFONT logfont = *lfp; logfont.lfItalic = 1; sip = (PangoWin32SizeInfo *)g_hash_table_find (helper->fontmap->size_infos, first_match, &logfont); if (!sip) - { + { /* remember the non italic variant to be added later as italic */ helper->list = g_slist_append (helper->list, lfp); } @@ -400,20 +400,20 @@ pango_win32_family_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFamilyClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_win32_family_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoWin32Family), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, + sizeof (PangoFontFamilyClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_win32_family_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoWin32Family), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, }; object_type = g_type_register_static (PANGO_TYPE_FONT_FAMILY, - I_("PangoWin32Family"), - &object_info, 0); + I_("PangoWin32Family"), + &object_info, 0); } return object_type; @@ -518,7 +518,7 @@ pango_win32_font_map_load_font (PangoFontMap *fontmap, result = PANGO_WIN32_FONT_MAP_GET_CLASS (win32fontmap)->find_font (win32fontmap, context, best_match, description); - /* TODO: Handle the case that result == NULL. */ + /* TODO: Handle the case that result == NULL. */ else PING(("no best match!")); } @@ -1024,8 +1024,8 @@ pango_win32_face_class_init (PangoFontFaceClass *class) static void pango_win32_face_list_sizes (PangoFontFace *face, - int **sizes, - int *n_sizes) + int **sizes, + int *n_sizes) { /* * for scalable fonts it's simple, and currently we only have such @@ -1044,20 +1044,20 @@ pango_win32_face_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFaceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_win32_face_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoWin32Face), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, + sizeof (PangoFontFaceClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_win32_face_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoWin32Face), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, }; object_type = g_type_register_static (PANGO_TYPE_FONT_FACE, - I_("PangoWin32Face"), - &object_info, 0); + I_("PangoWin32Face"), + &object_info, 0); } return object_type; diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 26ca290e..b34182ae 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -442,7 +442,7 @@ pango_win32_render_transformed (HDC hdc, xForm.eDx = matrix->x0; xForm.eDy = matrix->y0; if (!SetWorldTransform (hdc, &xForm)) - g_warning ("GetWorldTransform() failed"); + g_warning ("GetWorldTransform() failed"); } pango_win32_render (hdc, font, glyphs, x/PANGO_SCALE, y/PANGO_SCALE); @@ -538,14 +538,14 @@ max_glyph_width (PangoLayout *layout) PangoLayoutLine *line = l->data; for (r = line->runs; r; r = r->next) - { - PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; - int i; - - for (i = 0; i < glyphs->num_glyphs; i++) - if (glyphs->glyphs[i].geometry.width > max_width) - max_width = glyphs->glyphs[i].geometry.width; - } + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } } return max_width; @@ -984,27 +984,27 @@ pango_win32_render_layout_line (HDC hdc, Polyline (hdc, points, 2); break; case PANGO_UNDERLINE_ERROR: - { - int point_x; - int counter = 0; + { + int point_x; + int counter = 0; int end_x = x + PANGO_PIXELS (x_off + ink_rect.x + ink_rect.width); - for (point_x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; - point_x <= end_x; - point_x += 2) - { + for (point_x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; + point_x <= end_x; + point_x += 2) + { points[0].x = point_x; points[1].x = MAX (point_x + 1, end_x); - if (counter) - points[0].y = points[1].y = y + 2; - else - points[0].y = points[1].y = y + 3; + if (counter) + points[0].y = points[1].y = y + 2; + else + points[0].y = points[1].y = y + 3; Polyline (hdc, points, 2); - counter = (counter + 1) % 2; - } - } + counter = (counter + 1) % 2; + } + } break; case PANGO_UNDERLINE_LOW: points[0].x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; @@ -1058,9 +1058,9 @@ pango_win32_render_layout (HDC hdc, baseline = pango_layout_iter_get_baseline (iter); pango_win32_render_layout_line (hdc, - line, - x + PANGO_PIXELS (logical_rect.x), - y + PANGO_PIXELS (baseline)); + line, + x + PANGO_PIXELS (logical_rect.x), + y + PANGO_PIXELS (baseline)); } while (pango_layout_iter_next_line (iter)); @@ -1167,7 +1167,7 @@ get_format_4_cmap (HDC hdc) struct format_4_cmap *table; /* FIXME: Could look here at the CRC for the font in the DC - and return a cached copy if the same */ + and return a cached copy if the same */ offset = get_cmap_offset (hdc, UNICODE_ENCODING_ID); if (offset == 0) diff --git a/pango/pangowin32.h b/pango/pangowin32.h index 64f0ed19..5831393b 100644 --- a/pango/pangowin32.h +++ b/pango/pangowin32.h @@ -58,11 +58,11 @@ void pango_win32_render_layout (HDC hdc, int y); void pango_win32_render_transformed (HDC hdc, - const PangoMatrix *matrix, - PangoFont *font, - PangoGlyphString *glyphs, - int x, - int y); + const PangoMatrix *matrix, + PangoFont *font, + PangoGlyphString *glyphs, + int x, + int y); #ifdef PANGO_ENABLE_ENGINE @@ -96,7 +96,7 @@ PangoWin32FontCache *pango_win32_font_cache_new (void); void pango_win32_font_cache_free (PangoWin32FontCache *cache); HFONT pango_win32_font_cache_load (PangoWin32FontCache *cache, - const LOGFONT *logfont); + const LOGFONT *logfont); void pango_win32_font_cache_unload (PangoWin32FontCache *cache, HFONT hfont); diff --git a/pango/pangox-fontmap.c b/pango/pangox-fontmap.c index 360f680c..e4efb05a 100644 --- a/pango/pangox-fontmap.c +++ b/pango/pangox-fontmap.c @@ -182,21 +182,21 @@ pango_x_font_map_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontMapClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_x_font_map_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoXFontMap), - 0, /* n_preallocs */ - (GInstanceInitFunc) pango_x_font_map_init, + sizeof (PangoFontMapClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_x_font_map_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoXFontMap), + 0, /* n_preallocs */ + (GInstanceInitFunc) pango_x_font_map_init, NULL /* value_table */ }; object_type = g_type_register_static (PANGO_TYPE_FONT_MAP, - I_("PangoXFontMap"), - &object_info, 0); + I_("PangoXFontMap"), + &object_info, 0); } return object_type; @@ -1494,21 +1494,21 @@ pango_x_face_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFaceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_x_face_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoXFace), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, + sizeof (PangoFontFaceClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_x_face_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoXFace), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, NULL /* value_table */ }; object_type = g_type_register_static (PANGO_TYPE_FONT_FACE, - I_("PangoXFace"), - &object_info, 0); + I_("PangoXFace"), + &object_info, 0); } return object_type; @@ -1653,21 +1653,21 @@ pango_x_family_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoFontFamilyClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_x_family_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoXFamily), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, + sizeof (PangoFontFamilyClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_x_family_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoXFamily), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, NULL /* value_table */ }; object_type = g_type_register_static (PANGO_TYPE_FONT_FAMILY, - I_("PangoXFamily"), - &object_info, 0); + I_("PangoXFamily"), + &object_info, 0); } return object_type; diff --git a/pango/pangox-private.h b/pango/pangox-private.h index 2ce8f58b..4f4e909b 100644 --- a/pango/pangox-private.h +++ b/pango/pangox-private.h @@ -115,8 +115,8 @@ void pango_x_fontmap_cache_remove (PangoFontMap *fontmap, PangoXFont *xfont); Atom pango_x_fontmap_atom_from_name (PangoFontMap *fontmap, - const char *atomname); + const char *atomname); const char *pango_x_fontmap_name_from_atom (PangoFontMap *fontmap, - Atom atom); + Atom atom); #endif /* __PANGOX_PRIVATE_H__ */ diff --git a/pango/pangox.c b/pango/pangox.c index a99b9d86..8f58c861 100644 --- a/pango/pangox.c +++ b/pango/pangox.c @@ -180,7 +180,7 @@ pango_x_get_context (Display *display) registered_modules = TRUE; for (i = 0; _pango_included_x_modules[i].list; i++) - pango_module_register (&_pango_included_x_modules[i]); + pango_module_register (&_pango_included_x_modules[i]); } result = pango_context_new (); @@ -189,8 +189,8 @@ pango_x_get_context (Display *display) info->get_gc_func = NULL; info->free_gc_func = NULL; g_object_set_qdata_full (G_OBJECT (result), - g_quark_from_static_string ("pango-x-info"), - info, (GDestroyNotify)g_free); + g_quark_from_static_string ("pango-x-info"), + info, (GDestroyNotify)g_free); pango_context_set_font_map (result, pango_x_font_map_for_display (display)); @@ -216,7 +216,7 @@ pango_x_context_set_funcs (PangoContext *context, g_return_if_fail (context != NULL); info = g_object_get_qdata (G_OBJECT (context), - g_quark_from_static_string ("pango-x-info")); + g_quark_from_static_string ("pango-x-info")); info->get_gc_func = get_gc_func; info->free_gc_func = free_gc_func; @@ -231,21 +231,21 @@ pango_x_font_get_type (void) { const GTypeInfo object_info = { - sizeof (PangoXFontClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) pango_x_font_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (PangoXFont), - 0, /* n_preallocs */ - (GInstanceInitFunc) pango_x_font_init, + sizeof (PangoXFontClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) pango_x_font_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PangoXFont), + 0, /* n_preallocs */ + (GInstanceInitFunc) pango_x_font_init, NULL /* value_table */ }; object_type = g_type_register_static (PANGO_TYPE_FONT, - I_("PangoXFont"), - &object_info, 0); + I_("PangoXFont"), + &object_info, 0); } return object_type; @@ -444,10 +444,10 @@ pango_x_render (Display *display, goto unknown_glyph; } else { PangoFontMetrics *metrics; - int x1, y1, x2, y2; /* rectangle the character should go inside. */ - int baseline; + int x1, y1, x2, y2; /* rectangle the character should go inside. */ + int baseline; int stroke_thick; - gunichar wc; + gunichar wc; unknown_glyph: FLUSH; @@ -471,7 +471,7 @@ pango_x_render (Display *display, x1 = glyph_x; x2 = x1 + PANGO_PIXELS (glyphs->glyphs[i].geometry.width); - baseline = glyph_y; + baseline = glyph_y; stroke_thick = MAX ((int) (0.5 + 0.075 * (y2 - y1)), 1); if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) @@ -479,16 +479,16 @@ pango_x_render (Display *display, else wc = 0; - switch (wc) - { - case '\n': - case '\r': - case 0x2028: /* Line separator */ - case 0x2029: /* Paragraph separator */ - { - /* Draw a carriage-return thingy */ - PangoRectangle up_stroke; - PangoRectangle across_stroke; + switch (wc) + { + case '\n': + case '\r': + case 0x2028: /* Line separator */ + case 0x2029: /* Paragraph separator */ + { + /* Draw a carriage-return thingy */ + PangoRectangle up_stroke; + PangoRectangle across_stroke; int hborder = (x2 - x1) * 0.1; int arrow_height = 0.25 * (y2 - y1); @@ -504,37 +504,37 @@ pango_x_render (Display *display, for (arrow_x = x1 + hborder; arrow_x < x1 + hborder + arrow_width; arrow_x++) { - XDrawLine (display, d, gc, - arrow_x, + XDrawLine (display, d, gc, + arrow_x, baseline - stroke_thick + (stroke_thick - tmp_height) / 2, - arrow_x, + arrow_x, baseline - stroke_thick + (stroke_thick - tmp_height) / 2 + tmp_height - 1); if ((arrow_x - x1 - hborder) % 2 == 1) tmp_height += 2; } - across_stroke.x = arrow_x; - across_stroke.width = x2 - hborder - arrow_x - stroke_thick; - across_stroke.y = baseline - stroke_thick; - across_stroke.height = stroke_thick; + across_stroke.x = arrow_x; + across_stroke.width = x2 - hborder - arrow_x - stroke_thick; + across_stroke.y = baseline - stroke_thick; + across_stroke.height = stroke_thick; - XFillRectangle (display, d, gc, - across_stroke.x, across_stroke.y, - across_stroke.width, across_stroke.height); + XFillRectangle (display, d, gc, + across_stroke.x, across_stroke.y, + across_stroke.width, across_stroke.height); up_stroke.x = across_stroke.x + across_stroke.width; up_stroke.width = stroke_thick; up_stroke.y = y1 + top_border; up_stroke.height = baseline - up_stroke.y; - XFillRectangle (display, d, gc, - up_stroke.x, up_stroke.y, - up_stroke.width, up_stroke.height); - } - break; + XFillRectangle (display, d, gc, + up_stroke.x, up_stroke.y, + up_stroke.width, up_stroke.height); + } + break; - default: + default: { /* Perhaps we should draw the box-with-numbers as in the * Xft backend, though we have no guarantee of having @@ -571,7 +571,7 @@ pango_x_render (Display *display, } pango_font_metrics_unref (metrics); - } + } next_glyph: x_off += glyphs->glyphs[i].geometry.width; @@ -625,18 +625,18 @@ pango_x_font_get_glyph_extents (PangoFont *font, if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) wc = glyph & (~PANGO_GLYPH_UNKNOWN_FLAG); else - wc = 0; + wc = 0; switch (wc) - { - case '\n': - case '\r': - case 0x2028: /* Line separator */ - case 0x2029: /* Paragraph separator */ - { + { + case '\n': + case '\r': + case 0x2028: /* Line separator */ + case 0x2029: /* Paragraph separator */ + { #define MAGIC_FACTOR 1.2 - /* carriage-return thingy */ + /* carriage-return thingy */ width_factor = MAGIC_FACTOR; break; } @@ -650,7 +650,7 @@ pango_x_font_get_glyph_extents (PangoFont *font, metrics = pango_font_get_metrics (font, NULL); if (metrics) - { + { w = metrics->approximate_char_width * width_factor; w = PANGO_SCALE * PANGO_PIXELS (w); @@ -683,8 +683,8 @@ pango_x_font_get_glyph_extents (PangoFont *font, static gboolean get_int_prop (Atom atom, - XFontStruct *fs, - int *val) + XFontStruct *fs, + int *val) { int i; @@ -694,10 +694,10 @@ get_int_prop (Atom atom, while (i < fs->n_properties) { if (fs->properties[i].name == atom) - { - *val = fs->properties[i].card32; - return TRUE; - } + { + *val = fs->properties[i].card32; + return TRUE; + } ++i; } @@ -779,7 +779,7 @@ itemize_string_foreach (PangoFont *font, last_shaper = shaper; last_level = embedding_levels[i]; i++; - } + } } pango_glyph_string_free (glyph_str); @@ -801,7 +801,7 @@ get_font_metrics_from_subfonts (PangoFont *font, Atom avg_width_atom; avg_width_atom = pango_x_fontmap_atom_from_name (xfont->fontmap, - "AVERAGE_WIDTH"); + "AVERAGE_WIDTH"); metrics->ascent = 0; metrics->descent = 0; @@ -813,7 +813,7 @@ get_font_metrics_from_subfonts (PangoFont *font, if (subfont) { XFontStruct *fs = pango_x_get_font_struct (font, subfont); - gint avg_width = 0; + gint avg_width = 0; if (fs) { @@ -1486,7 +1486,7 @@ pango_x_render_layout_line (Display *display, PangoContext *context = pango_layout_get_context (line->layout); PangoXContextInfo *info = g_object_get_qdata (G_OBJECT (context), - g_quark_from_static_string ("pango-x-info")); + g_quark_from_static_string ("pango-x-info")); int x_off = 0; @@ -1548,14 +1548,14 @@ pango_x_render_layout_line (Display *display, x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 2); break; case PANGO_UNDERLINE_ERROR: - { - int point_x; - int counter = 0; + { + int point_x; + int counter = 0; int end_x = x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE; - for (point_x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; - point_x <= end_x; - point_x += 2) + for (point_x = x + PANGO_PIXELS (x_off + ink_rect.x) - 1; + point_x <= end_x; + point_x += 2) { if (counter) XDrawLine (display, drawable, gc, @@ -1566,7 +1566,7 @@ pango_x_render_layout_line (Display *display, counter = (counter + 1) % 2; } - } + } break; case PANGO_UNDERLINE_LOW: XDrawLine (display, drawable, fg_gc, @@ -1620,9 +1620,9 @@ pango_x_render_layout (Display *display, baseline = pango_layout_iter_get_baseline (iter); pango_x_render_layout_line (display, drawable, gc, - line, - x + PANGO_PIXELS (logical_rect.x), - y + PANGO_PIXELS (baseline)); + line, + x + PANGO_PIXELS (logical_rect.x), + y + PANGO_PIXELS (baseline)); } while (pango_layout_iter_next_line (iter)); @@ -1696,10 +1696,10 @@ pango_x_get_item_properties (PangoItem *item, */ gboolean pango_x_apply_ligatures (PangoFont *font, - PangoXSubfont subfont_id, - gunichar **glyphs, - int *n_glyphs, - int **clusters) + PangoXSubfont subfont_id, + gunichar **glyphs, + int *n_glyphs, + int **clusters) { return FALSE; } @@ -1718,9 +1718,9 @@ pango_x_apply_ligatures (PangoFont *font, */ gboolean pango_x_find_first_subfont (PangoFont *font, - char **charsets, + char **charsets, int n_charsets, - PangoXSubfont *rfont) + PangoXSubfont *rfont) { int n_subfonts; gboolean result = FALSE; @@ -1732,7 +1732,7 @@ pango_x_find_first_subfont (PangoFont *font, g_return_val_if_fail (rfont, 0); n_subfonts = pango_x_list_subfonts (font, charsets, n_charsets, - &subfonts, &subfont_charsets); + &subfonts, &subfont_charsets); if (n_subfonts > 0) { @@ -1758,9 +1758,9 @@ pango_x_find_first_subfont (PangoFont *font, */ void pango_x_fallback_shape (PangoFont *font, - PangoGlyphString *glyphs, - const char *text, - int n_chars) + PangoGlyphString *glyphs, + const char *text, + int n_chars) { PangoGlyph unknown_glyph = pango_x_get_unknown_glyph (font); PangoRectangle logical_rect; @@ -1803,7 +1803,7 @@ pango_x_fallback_shape (PangoFont *font, */ PangoGlyph pango_x_font_get_unknown_glyph (PangoFont *font, - gunichar wc) + gunichar wc) { return PANGO_GET_UNKNOWN_GLYPH (wc); } diff --git a/pango/pangox.h b/pango/pangox.h index c11e1fa1..dc41b61e 100644 --- a/pango/pangox.h +++ b/pango/pangox.h @@ -109,20 +109,20 @@ char *pango_x_font_subfont_xlfd (PangoFont *font, gboolean pango_x_find_first_subfont (PangoFont *font, - char **charsets, + char **charsets, int n_charsets, - PangoXSubfont *rfont); + PangoXSubfont *rfont); void pango_x_fallback_shape (PangoFont *font, - PangoGlyphString *glyphs, - const char *text, - int n_chars); + PangoGlyphString *glyphs, + const char *text, + int n_chars); gboolean pango_x_apply_ligatures (PangoFont *font, - PangoXSubfont subfont, - gunichar **glyphs, - int *n_glyphs, - int **clusters); + PangoXSubfont subfont, + gunichar **glyphs, + int *n_glyphs, + int **clusters); #endif /* PANGO_DISABLE_DEPRECATED */ diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c index b5063d60..9fd22d59 100644 --- a/pango/pangoxft-font.c +++ b/pango/pangoxft-font.c @@ -154,7 +154,7 @@ _pango_xft_font_get_mini_font (PangoXftFont *xfont) xfont->mini_font = pango_font_map_load_font (fcfont->fontmap, context, desc); if (!xfont->mini_font) - return NULL; + return NULL; pango_font_description_free (desc); g_object_unref (context); @@ -363,9 +363,9 @@ load_fallback_font (PangoXftFont *xfont) size = pango_font_description_get_size (fcfont->description) / PANGO_SCALE; xft_font = XftFontOpen (display, screen, - FC_FAMILY, FcTypeString, "sans", + FC_FAMILY, FcTypeString, "sans", size_is_absolute ? FC_PIXEL_SIZE : FC_SIZE, FcTypeDouble, size, - NULL); + NULL); if (!xft_font) { @@ -471,7 +471,7 @@ pango_xft_font_get_font (PangoFont *font) if (G_UNLIKELY (!PANGO_XFT_IS_FONT (font))) { if (!_pango_xft_warning_history.get_font) - { + { _pango_xft_warning_history.get_font = TRUE; g_warning ("pango_xft_font_get_font called with bad font, expect ugly output"); } diff --git a/pango/pangoxft-render.c b/pango/pangoxft-render.c index 22cf71c6..82333e2b 100644 --- a/pango/pangoxft-render.c +++ b/pango/pangoxft-render.c @@ -417,7 +417,7 @@ pango_xft_renderer_draw_glyphs (PangoRenderer *renderer, _pango_xft_renderer_draw_box_glyph (renderer, gi, glyph_x, glyph_y); } - x_off += gi->geometry.width; + x_off += gi->geometry.width; } return; } diff --git a/pango/pangoxft.h b/pango/pangoxft.h index 52c1d496..53387a5a 100644 --- a/pango/pangoxft.h +++ b/pango/pangoxft.h @@ -44,7 +44,7 @@ typedef struct _PangoXftFontMap PangoXftFontMap; typedef struct _PangoXftFont PangoXftFont; typedef void (*PangoXftSubstituteFunc) (FcPattern *pattern, - gpointer data); + gpointer data); /* Calls for applications */ diff --git a/pango/shape.c b/pango/shape.c index 8bf5c366..8e535aca 100644 --- a/pango/shape.c +++ b/pango/shape.c @@ -39,9 +39,9 @@ */ void pango_shape (const gchar *text, - gint length, - const PangoAnalysis *analysis, - PangoGlyphString *glyphs) + gint length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs) { int i; int last_cluster; @@ -52,7 +52,7 @@ pango_shape (const gchar *text, text, length, analysis, glyphs); if (G_UNLIKELY (glyphs->num_glyphs == 0)) - { + { /* If a font has been correctly chosen, but no glyphs are output, * there's probably something wrong with the shaper. Trying to be * informative, we print out the font description, but to not @@ -87,13 +87,13 @@ pango_shape (const gchar *text, { if (!PANGO_IS_ENGINE_SHAPE (analysis->shape_engine) && !_pango_warning_history.shape_shape_engine) - { + { _pango_warning_history.shape_shape_engine = TRUE; g_warning ("pango_shape called with bad shape_engine, expect ugly output"); } if (!PANGO_IS_FONT (analysis->font) && !_pango_warning_history.shape_font) - { + { _pango_warning_history.shape_font = TRUE; g_warning ("pango_shape called with bad font, expect ugly output"); } |