Skip to content
Commits on Source (19)
Overview of changes in 1.50.7, 14-04-2022
=========================================
- coretext: Fix the build
- editing: Fix moving across paragraph boundaries in rtl
- layout: Try harder to survive without fonts
- Windows: Register a sans-serif font
- Windows: Try harder to load a font
Overview of changes in 1.50.6, 19-03-2022
=========================================
- Drop hb-glib dependency
......
project('pango', 'c', 'cpp',
version: '1.50.6',
version: '1.50.7',
license: 'LGPLv2.1+',
default_options: [
'buildtype=debugoptimized',
......
......@@ -10,7 +10,7 @@ option('introspection',
option('install-tests',
description : 'Install tests',
type: 'boolean',
value: 'false')
value: false)
option('fontconfig',
description : 'Build with FontConfig support. Passing \'auto\' or \'disabled\' disables fontconfig where it is optional, i.e. on Windows and macOS. Passing \'disabled\' on platforms where fontconfig is required results in error.',
type: 'feature',
......
......@@ -1164,6 +1164,9 @@ apply_scale_to_item (PangoContext *context,
PangoFontDescription *desc;
double size;
if (!item->analysis.font)
return;
if (is_small_caps)
pango_analysis_set_size_font (&item->analysis, item->analysis.font);
......@@ -1294,11 +1297,14 @@ static PangoVariant
get_font_variant (PangoItem *item)
{
PangoFontDescription *desc;
PangoVariant variant;
PangoVariant variant = PANGO_VARIANT_NORMAL;
desc = pango_font_describe (item->analysis.font);
variant = pango_font_description_get_variant (desc);
pango_font_description_free (desc);
if (item->analysis.font)
{
desc = pango_font_describe (item->analysis.font);
variant = pango_font_description_get_variant (desc);
pango_font_description_free (desc);
}
return variant;
}
......
......@@ -2184,9 +2184,9 @@ pango_layout_move_cursor_visually (PangoLayout *layout,
else
{
if (old_index == line->start_index + line->length && direction < 0)
off_start = TRUE;
if (old_index == line->start_index && direction > 0)
off_end = TRUE;
if (old_index == line->start_index && direction > 0)
off_start = TRUE;
}
if (off_start || off_end)
......@@ -6624,7 +6624,7 @@ collect_baseline_shift (ParaBreakState *state,
int subscript_y_offset = 0;
if (prev)
if (prev && prev->analysis.font)
{
hb_font_t *hb_font = pango_font_get_hb_font (prev->analysis.font);
hb_ot_metrics_get_position (hb_font, HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET, &superscript_y_offset);
......@@ -6716,7 +6716,12 @@ apply_baseline_shift (PangoLayoutLine *line,
hb_tag_t lang_tags[HB_OT_MAX_TAGS_PER_LANGUAGE];
unsigned int script_count = HB_OT_MAX_TAGS_PER_SCRIPT;
unsigned int lang_count = HB_OT_MAX_TAGS_PER_LANGUAGE;
#endif
if (item->analysis.font == NULL)
continue;
#if HB_VERSION_ATLEAST(4,0,0)
hb_font = pango_font_get_hb_font (item->analysis.font);
script = (hb_script_t) g_unicode_script_to_iso15924 (item->analysis.script);
......
......@@ -1696,11 +1696,8 @@ static PangoFont *
pango_core_text_fontset_load_font (PangoCoreTextFontset *ctfontset,
CTFontDescriptorRef ctdescriptor)
{
PangoCoreTextFontsetKey *key;
PangoCoreTextFont *font;
key = pango_core_text_fontset_get_key (ctfontset);
/* For now, we will default the fallbacks to not have synthetic italic,
* in the future this may be improved.
*/
......
......@@ -83,6 +83,9 @@ static void pango_win32_font_map_finalize (GObject
static PangoFont *pango_win32_font_map_load_font (PangoFontMap *fontmap,
PangoContext *context,
const PangoFontDescription *description);
static PangoFont *pango_win32_font_map_real_load_font (PangoFontMap *fontmap,
PangoContext *context,
const PangoFontDescription *description);
static PangoFontset *pango_win32_font_map_load_fontset (PangoFontMap *fontmap,
PangoContext *context,
const PangoFontDescription *desc,
......@@ -729,8 +732,9 @@ _pango_win32_font_map_init (PangoWin32FontMap *win32fontmap)
g_hash_table_foreach (win32fontmap->families, synthesize_foreach, win32fontmap);
/* Create synthetic "Sans", "Serif", "Monospace", "Cursive", "Fantasy" and "System-ui" families */
/* Create synthetic "Sans", "Sans-Serif", "Serif", "Monospace", "Cursive", "Fantasy" and "System-ui" families */
create_standard_family (win32fontmap, "Sans");
create_standard_family (win32fontmap, "Sans-Serif");
create_standard_family (win32fontmap, "Serif");
create_standard_family (win32fontmap, "Monospace");
create_standard_family (win32fontmap, "Cursive");
......@@ -794,7 +798,7 @@ _pango_win32_font_map_class_init (PangoWin32FontMapClass *class)
class->find_font = pango_win32_font_map_real_find_font;
object_class->finalize = pango_win32_font_map_finalize;
fontmap_class->load_font = pango_win32_font_map_load_font;
fontmap_class->load_font = pango_win32_font_map_real_load_font;
/* we now need a load_fontset implementation for the Win32 backend */
fontmap_class->load_fontset = pango_win32_font_map_load_fontset;
fontmap_class->list_families = pango_win32_font_map_list_families;
......@@ -1011,6 +1015,46 @@ pango_win32_get_font_family (PangoWin32FontMap *win32fontmap,
return win32family;
}
static gboolean
get_first_font (PangoFontset *fontset G_GNUC_UNUSED,
PangoFont *font,
gpointer data)
{
*(PangoFont **)data = font;
return TRUE;
}
static PangoFont *
pango_win32_font_map_real_load_font (PangoFontMap *fontmap,
PangoContext *context,
const PangoFontDescription *description)
{
PangoLanguage *language;
PangoFontset *fontset;
PangoFont *font = NULL;
if (context)
language = pango_context_get_language (context);
else
language = NULL;
fontset = pango_font_map_load_fontset (fontmap, context,
description, language);
if (fontset)
{
pango_fontset_foreach (fontset, get_first_font, &font);
if (font)
g_object_ref (font);
g_object_unref (fontset);
}
return font;
}
static PangoFont *
pango_win32_font_map_load_font (PangoFontMap *fontmap,
PangoContext *context,
......
......@@ -21,6 +21,9 @@ not_skip = __init__.py
[*.html]
indent_size = 2
[*.css]
indent_size = 2
[*.json]
indent_size = 2
......
......@@ -1279,13 +1279,15 @@ class TemplateInterface:
self.class_struct = namespace.find_record(interface.type_struct)
if self.class_struct is not None:
if self.class_struct.doc:
self.class_description = utils.preprocess_docs(self.class_struct.doc.content, namespace, md=md)
else:
self.class_description = MISSING_DESCRIPTION
self.class_fields = []
self.class_methods = []
for field in self.class_struct.fields:
if not field.private:
self.class_fields.append(TemplateField(namespace, field))
self.class_methods = []
for method in self.class_struct.methods:
self.class_methods.append(gen_index_func(method, namespace, md))
......@@ -1457,13 +1459,15 @@ class TemplateClass:
if self.class_struct is not None:
self.class_ctype = self.class_struct.ctype
if self.class_struct.doc:
self.class_description = utils.preprocess_docs(self.class_struct.doc.content, namespace, md=md)
else:
self.class_description = MISSING_DESCRIPTION
self.class_fields = []
self.class_methods = []
for field in self.class_struct.fields:
if not field.private:
self.class_fields.append(TemplateField(namespace, field))
self.class_methods = []
for method in self.class_struct.methods:
self.class_methods.append(gen_index_func(method, namespace, md))
......
......@@ -620,6 +620,10 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
}</code></pre>
</div>
<div class="docblock">
{{ class.class_description }}
</div>
{% if class.class_fields %}
<div class="docblock">
<h6>Class members</h6>
......
......@@ -306,6 +306,10 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
}</code></pre>
</div>
<div class="docblock">
{{ interface.class_description }}
</div>
{% if interface.class_fields %}
<div class="docblock">
<h6>Interface members</h6>
......
......@@ -140,7 +140,7 @@
"glyph" : 244,
"width" : 15360,
"x-offset" : 14764,
"y-offset" : 3844,
"y-offset" : 3845,
"is-cluster-start" : true,
"log-cluster" : 0
},
......@@ -156,7 +156,7 @@
"glyph" : 273,
"width" : 15360,
"x-offset" : 14764,
"y-offset" : 3506,
"y-offset" : 3507,
"is-cluster-start" : true,
"log-cluster" : 2
}
......
......@@ -128,7 +128,7 @@
{
"glyph" : 1,
"width" : 32768,
"x-offset" : 28835,
"x-offset" : 28836,
"y-offset" : 9945,
"is-cluster-start" : true,
"log-cluster" : 0
......@@ -136,7 +136,7 @@
{
"glyph" : 2,
"width" : 32768,
"x-offset" : 28835,
"x-offset" : 28836,
"y-offset" : 10764,
"is-cluster-start" : true,
"log-cluster" : 1
......@@ -144,8 +144,8 @@
{
"glyph" : 3,
"width" : 32768,
"x-offset" : 28835,
"y-offset" : 10452,
"x-offset" : 28836,
"y-offset" : 10453,
"is-cluster-start" : true,
"log-cluster" : 2
}
......@@ -179,24 +179,24 @@
{
"glyph" : 4,
"width" : 32768,
"x-offset" : 28835,
"y-offset" : 16383,
"x-offset" : 28836,
"y-offset" : 16384,
"is-cluster-start" : true,
"log-cluster" : 0
},
{
"glyph" : 5,
"width" : 32768,
"x-offset" : 28835,
"y-offset" : 16383,
"x-offset" : 28836,
"y-offset" : 16384,
"is-cluster-start" : true,
"log-cluster" : 3
},
{
"glyph" : 7,
"width" : 32768,
"x-offset" : 28835,
"y-offset" : 16383,
"x-offset" : 28836,
"y-offset" : 16384,
"is-cluster-start" : true,
"log-cluster" : 6
}
......@@ -230,7 +230,7 @@
{
"glyph" : 1,
"width" : 32768,
"x-offset" : 28835,
"x-offset" : 28836,
"y-offset" : 9945,
"is-cluster-start" : true,
"log-cluster" : 0
......@@ -238,7 +238,7 @@
{
"glyph" : 2,
"width" : 32768,
"x-offset" : 28835,
"x-offset" : 28836,
"y-offset" : 10764,
"is-cluster-start" : true,
"log-cluster" : 1
......@@ -246,8 +246,8 @@
{
"glyph" : 3,
"width" : 32768,
"x-offset" : 28835,
"y-offset" : 10452,
"x-offset" : 28836,
"y-offset" : 10453,
"is-cluster-start" : true,
"log-cluster" : 2
}
......
......@@ -348,6 +348,7 @@ test_move_cursor_para (void)
{ "line 1
line 2
line 3\nline 4\r\nline 5", -1 }, // various separators
{ "some text, some more text,\n\n even more text", 60 },
{ "long word", 40 },
{ "זוהי השורה הראשונה" "\n" "זוהי השורה השנייה" "\n" "זוהי השורה השלישית" , 200 },
};
PangoLayout *layout;
PangoRectangle pos, old_pos;
......@@ -399,7 +400,7 @@ test_move_cursor_para (void)
break;
if (index >= strlen (tests[i].text) - 1)
break;
continue;
pango_layout_get_cursor_pos (layout, index, &pos, NULL);
......
......@@ -225,7 +225,7 @@ cairo_vector_view_create (const PangoViewer *klass G_GNUC_UNUSED)
return NULL;
if (0)
;
{}
#ifdef CAIRO_HAS_SVG_SURFACE
else if (0 == g_ascii_strcasecmp (extension, "svg"))
constructor = cairo_svg_surface_create;
......