mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-04 02:50:19 +01:00
Merge branch 'pdf-font-names' into 'master'
pdf font subset: Generate valid font names Closes #449 See merge request cairo/cairo!125
This commit is contained in:
commit
f4e43b6822
1 changed files with 2 additions and 6 deletions
|
|
@ -5310,18 +5310,14 @@ _create_font_subset_tag (cairo_scaled_font_subset_t *font_subset,
|
|||
{
|
||||
uint32_t hash;
|
||||
int i;
|
||||
long numerator;
|
||||
ldiv_t d;
|
||||
|
||||
hash = _hash_data ((unsigned char *) font_name, strlen(font_name), 0);
|
||||
hash = _hash_data ((unsigned char *) (font_subset->glyphs),
|
||||
font_subset->num_glyphs * sizeof(unsigned long), hash);
|
||||
|
||||
numerator = hash;
|
||||
for (i = 0; i < 6; i++) {
|
||||
d = ldiv (numerator, 26);
|
||||
numerator = d.quot;
|
||||
tag[i] = 'A' + d.rem;
|
||||
tag[i] = 'A' + (hash % 26);
|
||||
hash /= 26;
|
||||
}
|
||||
tag[i] = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue