aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2024-08-03 17:36:58 +0800
committerPo Lu2024-08-03 17:36:58 +0800
commitef8276d4247fdf0b1ee19a2c70328710490dd2d6 (patch)
tree4161b1be4d7e8d215cf570f5543d05ed127e2cde /src
parent5bd30117304413efa30b8af05732f7fca6b63103 (diff)
parent8d073823c61017c581a18853c89ec84432018d60 (diff)
downloademacs-ef8276d4247fdf0b1ee19a2c70328710490dd2d6.tar.gz
emacs-ef8276d4247fdf0b1ee19a2c70328710490dd2d6.zip
Merge from savannah/emacs-30
8d073823c61 Revert "Remove redundant byte-swapping boundary" c25687e860f Fix various typos reported by Pip Cet
Diffstat (limited to 'src')
-rw-r--r--src/ftfont.c10
-rw-r--r--src/sfnt.c20
-rw-r--r--src/sfnt.h2
-rw-r--r--src/sfntfont.c17
4 files changed, 34 insertions, 15 deletions
diff --git a/src/ftfont.c b/src/ftfont.c
index c89feea1d46..882d3eec256 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -174,11 +174,11 @@ get_adstyle_property (FcPattern *p)
174 USE_SAFE_ALLOCA; 174 USE_SAFE_ALLOCA;
175 tmp = SAFE_ALLOCA (end - str); 175 tmp = SAFE_ALLOCA (end - str);
176 for (i = 0; i < end - str; ++i) 176 for (i = 0; i < end - str; ++i)
177 tmp[i] = ((end[i] != '?' 177 tmp[i] = ((str[i] != '?'
178 && end[i] != '*' 178 && str[i] != '*'
179 && end[i] != '"' 179 && str[i] != '"'
180 && end[i] != '-') 180 && str[i] != '-')
181 ? end[i] : ' '); 181 ? str[i] : ' ');
182 adstyle = font_intern_prop (tmp, end - str, 1); 182 adstyle = font_intern_prop (tmp, end - str, 1);
183 SAFE_FREE (); 183 SAFE_FREE ();
184 if (font_style_to_value (FONT_WIDTH_INDEX, adstyle, 0) >= 0) 184 if (font_style_to_value (FONT_WIDTH_INDEX, adstyle, 0) >= 0)
diff --git a/src/sfnt.c b/src/sfnt.c
index 11670f1dd5c..34ff6964c31 100644
--- a/src/sfnt.c
+++ b/src/sfnt.c
@@ -16606,10 +16606,10 @@ sfnt_read_OS_2_table (int fd, struct sfnt_offset_subtable *subtable)
16606 16606
16607 OS_2 = xmalloc (sizeof *OS_2); 16607 OS_2 = xmalloc (sizeof *OS_2);
16608 16608
16609 /* Read data into the structure. */ 16609 /* Read data up to the end of `panose'. */
16610 16610
16611 wanted = SFNT_ENDOF (struct sfnt_OS_2_table, fs_last_char_index, 16611 wanted = SFNT_ENDOF (struct sfnt_OS_2_table, panose,
16612 uint16_t); 16612 unsigned char[10]);
16613 rc = read (fd, OS_2, wanted); 16613 rc = read (fd, OS_2, wanted);
16614 16614
16615 if (rc == -1 || rc != wanted) 16615 if (rc == -1 || rc != wanted)
@@ -16636,6 +16636,20 @@ sfnt_read_OS_2_table (int fd, struct sfnt_offset_subtable *subtable)
16636 sfnt_swap16 (&OS_2->y_strikeout_size); 16636 sfnt_swap16 (&OS_2->y_strikeout_size);
16637 sfnt_swap16 (&OS_2->y_strikeout_position); 16637 sfnt_swap16 (&OS_2->y_strikeout_position);
16638 sfnt_swap16 (&OS_2->s_family_class); 16638 sfnt_swap16 (&OS_2->s_family_class);
16639
16640 /* Read fields between ul_unicode_range and fs_last_char_index. */
16641 wanted = (SFNT_ENDOF (struct sfnt_OS_2_table, fs_last_char_index,
16642 uint16_t)
16643 - offsetof (struct sfnt_OS_2_table, ul_unicode_range));
16644 rc = read (fd, &OS_2->ul_unicode_range, wanted);
16645
16646 if (rc == -1 || rc != wanted)
16647 {
16648 xfree (OS_2);
16649 return NULL;
16650 }
16651
16652 /* Swap the remainder and return the table. */
16639 sfnt_swap32 (&OS_2->ul_unicode_range[0]); 16653 sfnt_swap32 (&OS_2->ul_unicode_range[0]);
16640 sfnt_swap32 (&OS_2->ul_unicode_range[1]); 16654 sfnt_swap32 (&OS_2->ul_unicode_range[1]);
16641 sfnt_swap32 (&OS_2->ul_unicode_range[2]); 16655 sfnt_swap32 (&OS_2->ul_unicode_range[2]);
diff --git a/src/sfnt.h b/src/sfnt.h
index ecc3876b394..444b1dfe427 100644
--- a/src/sfnt.h
+++ b/src/sfnt.h
@@ -1395,6 +1395,8 @@ struct sfnt_OS_2_table
1395 /* Microsoft ``panose'' classification. */ 1395 /* Microsoft ``panose'' classification. */
1396 unsigned char panose[10]; 1396 unsigned char panose[10];
1397 1397
1398 /* Alignment boundary! */
1399
1398 /* Unicode range specification. */ 1400 /* Unicode range specification. */
1399 uint32_t ul_unicode_range[4]; 1401 uint32_t ul_unicode_range[4];
1400 1402
diff --git a/src/sfntfont.c b/src/sfntfont.c
index d1376939a3c..8c02c05e7a6 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -1643,6 +1643,7 @@ sfntfont_list_1 (struct sfnt_font_desc *desc, Lisp_Object spec,
1643 struct sfnt_cmap_encoding_subtable subtable; 1643 struct sfnt_cmap_encoding_subtable subtable;
1644 int instance, num_instance; 1644 int instance, num_instance;
1645 Lisp_Object item; 1645 Lisp_Object item;
1646 bool matching;
1646 1647
1647 /* cmap and subtable are caches for sfntfont_lookup_char. */ 1648 /* cmap and subtable are caches for sfntfont_lookup_char. */
1648 1649
@@ -1788,19 +1789,21 @@ sfntfont_list_1 (struct sfnt_font_desc *desc, Lisp_Object spec,
1788 1789
1789 /* The vector contains characters, of which one must be 1790 /* The vector contains characters, of which one must be
1790 present in the font. */ 1791 present in the font. */
1792 matching = false;
1791 for (i = 0; i < ASIZE (tem); ++i) 1793 for (i = 0; i < ASIZE (tem); ++i)
1792 { 1794 {
1793 if (FIXNUMP (AREF (tem, i))) 1795 if (FIXNUMP (AREF (tem, i)))
1794 { 1796 {
1795 if (!sfntfont_lookup_char (desc, AREF (tem, i), 1797 if (sfntfont_lookup_char (desc, AREF (tem, i),
1796 &cmap, &subtable)) 1798 &cmap, &subtable))
1797 goto fail; 1799 {
1798 1800 matching = true;
1799 /* One character is enough to pass a font. Don't 1801 break;
1800 look at too many. */ 1802 }
1801 break;
1802 } 1803 }
1803 } 1804 }
1805 if (!matching)
1806 goto fail;
1804 } 1807 }
1805 else if (CONSP (tem) && CONSP (XCDR (tem))) 1808 else if (CONSP (tem) && CONSP (XCDR (tem)))
1806 { 1809 {