···33 url = "https://cgit.freedesktop.org/fontconfig/patch/?id=1ab5258f7c";
34 sha256 = "0x2a4qx51j3gqcp1kp4lisdzmhrkw1zw0r851d82ksgjlc0vkbaz";
35 })
36-37- # FreeType 2.7 prefixes PCF font family names with the foundry name.
38- # The output of fc-list and fc-query change which breaks the tests.
39- ./test-pcf-family-names-freetype-2.7.patch
40 ];
41 # additionally required for the glibc-2.25 patch; avoid requiring gperf
42 postPatch = ''
···1+diff --git a/devel/ftoption.h b/devel/ftoption.h
2+index 3b63931..b8b0a8d 100644
3+--- a/devel/ftoption.h
4++++ b/devel/ftoption.h
5+@@ -82,8 +82,8 @@ FT_BEGIN_HEADER
6+ /* to control the various font drivers and modules. The controllable */
7+ /* properties are listed in the section `Controlling FreeType Modules' */
8+ /* in the reference's table of contents; currently there are properties */
9+- /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */
10+- /* TrueType (file `ftttdrv.h'). */
11++ /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */
12++ /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */
13+ /* */
14+ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
15+ /* multiple lines for better readability). */
16+@@ -835,6 +835,33 @@ FT_BEGIN_HEADER
17+ /*************************************************************************/
18+ /*************************************************************************/
19+ /**** ****/
20++ /**** P C F D R I V E R C O N F I G U R A T I O N ****/
21++ /**** ****/
22++ /*************************************************************************/
23++ /*************************************************************************/
24++
25++
26++ /*************************************************************************/
27++ /* */
28++ /* There are many PCF fonts just called `Fixed' which look completely */
29++ /* different, and which have nothing to do with each other. When */
30++ /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
31++ /* random, the style changes often if one changes the size and one */
32++ /* cannot select some fonts at all. This option makes the PCF module */
33++ /* prepend the foundry name (plus a space) to the family name. */
34++ /* */
35++ /* We also check whether we have `wide' characters; all put together, we */
36++ /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
37++ /* */
38++ /* If this option is activated, it can be controlled with the */
39++ /* `no-long-family-names' property of the pcf driver module. */
40++ /* */
41++#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
42++
43++
44++ /*************************************************************************/
45++ /*************************************************************************/
46++ /**** ****/
47+ /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
48+ /**** ****/
49+ /*************************************************************************/
50+diff --git a/docs/CHANGES b/docs/CHANGES
51+index cb3b327..3823395 100644
52+--- a/docs/CHANGES
53++++ b/docs/CHANGES
54+@@ -1,4 +1,20 @@
55+56++CHANGES BETWEEN 2.7.1 and 2.7.2
57++
58++ I. IMPORTANT CHANGES
59++
60++ - The PCF change to show more `colourful' family names (introduced
61++ in version 2.7.1) was too radical; it can now be configured with
62++ PCF_CONFIG_OPTION_LONG_FAMILY_NAMES at compile time. If
63++ activated, it can be switched off at run time with the new pcf
64++ property `no-long-family-names'. If the `FREETYPE_PROPERTIES'
65++ environment variable is available, you can say
66++
67++ FREETYPE_PROPERTIES=pcf:no-long-family-names=1
68++
69++
70++======================================================================
71++
72+ CHANGES BETWEEN 2.7 and 2.7.1
73+74+ I. IMPORTANT CHANGES
75+diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
76+index 950d36c..d491af5 100644
77+--- a/include/freetype/config/ftheader.h
78++++ b/include/freetype/config/ftheader.h
79+@@ -357,6 +357,19 @@
80+ /*************************************************************************
81+ *
82+ * @macro:
83++ * FT_PCF_DRIVER_H
84++ *
85++ * @description:
86++ * A macro used in #include statements to name the file containing
87++ * structures and macros related to the PCF driver module.
88++ *
89++ */
90++#define FT_PCF_DRIVER_H <freetype/ftpcfdrv.h>
91++
92++
93++ /*************************************************************************
94++ *
95++ * @macro:
96+ * FT_TYPE1_TABLES_H
97+ *
98+ * @description:
99+diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
100+index f5bc540..5676074 100644
101+--- a/include/freetype/config/ftoption.h
102++++ b/include/freetype/config/ftoption.h
103+@@ -82,8 +82,8 @@ FT_BEGIN_HEADER
104+ /* to control the various font drivers and modules. The controllable */
105+ /* properties are listed in the section `Controlling FreeType Modules' */
106+ /* in the reference's table of contents; currently there are properties */
107+- /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */
108+- /* TrueType (file `ftttdrv.h'). */
109++ /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */
110++ /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */
111+ /* */
112+ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
113+ /* multiple lines for better readability). */
114+@@ -835,6 +835,33 @@ FT_BEGIN_HEADER
115+ /*************************************************************************/
116+ /*************************************************************************/
117+ /**** ****/
118++ /**** P C F D R I V E R C O N F I G U R A T I O N ****/
119++ /**** ****/
120++ /*************************************************************************/
121++ /*************************************************************************/
122++
123++
124++ /*************************************************************************/
125++ /* */
126++ /* There are many PCF fonts just called `Fixed' which look completely */
127++ /* different, and which have nothing to do with each other. When */
128++ /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
129++ /* random, the style changes often if one changes the size and one */
130++ /* cannot select some fonts at all. This option makes the PCF module */
131++ /* prepend the foundry name (plus a space) to the family name. */
132++ /* */
133++ /* We also check whether we have `wide' characters; all put together, we */
134++ /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
135++ /* */
136++ /* If this option is activated, it can be controlled with the */
137++ /* `no-long-family-names' property of the pcf driver module. */
138++ /* */
139++#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
140++
141++
142++ /*************************************************************************/
143++ /*************************************************************************/
144++ /**** ****/
145+ /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
146+ /**** ****/
147+ /*************************************************************************/
148+diff --git a/include/freetype/ftchapters.h b/include/freetype/ftchapters.h
149+index ab43895..a0a121b 100644
150+--- a/include/freetype/ftchapters.h
151++++ b/include/freetype/ftchapters.h
152+@@ -77,6 +77,7 @@
153+ /* auto_hinter */
154+ /* cff_driver */
155+ /* tt_driver */
156++/* pcf_driver */
157+ /* */
158+ /***************************************************************************/
159+160+diff --git a/include/freetype/ftpcfdrv.h b/include/freetype/ftpcfdrv.h
161+new file mode 100644
162+index 0000000..6622c93
163+--- /dev/null
164++++ b/include/freetype/ftpcfdrv.h
165+@@ -0,0 +1,105 @@
166++/***************************************************************************/
167++/* */
168++/* ftpcfdrv.h */
169++/* */
170++/* FreeType API for controlling the PCF driver (specification only). */
171++/* */
172++/* Copyright 2017 by */
173++/* David Turner, Robert Wilhelm, and Werner Lemberg. */
174++/* */
175++/* This file is part of the FreeType project, and may only be used, */
176++/* modified, and distributed under the terms of the FreeType project */
177++/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
178++/* this file you indicate that you have read the license and */
179++/* understand and accept it fully. */
180++/* */
181++/***************************************************************************/
182++
183++
184++#ifndef FTPCFDRV_H_
185++#define FTPCFDRV_H_
186++
187++#include <ft2build.h>
188++#include FT_FREETYPE_H
189++
190++#ifdef FREETYPE_H
191++#error "freetype.h of FreeType 1 has been loaded!"
192++#error "Please fix the directory search order for header files"
193++#error "so that freetype.h of FreeType 2 is found first."
194++#endif
195++
196++
197++FT_BEGIN_HEADER
198++
199++
200++ /**************************************************************************
201++ *
202++ * @section:
203++ * pcf_driver
204++ *
205++ * @title:
206++ * The PCF driver
207++ *
208++ * @abstract:
209++ * Controlling the PCF driver module.
210++ *
211++ * @description:
212++ * While FreeType's PCF driver doesn't expose API functions by itself,
213++ * it is possible to control its behaviour with @FT_Property_Set and
214++ * @FT_Property_Get. Right now, there is a single property
215++ * `no-long-family-names' available if FreeType is compiled with
216++ * PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
217++ *
218++ * The PCF driver's module name is `pcf'.
219++ *
220++ */
221++
222++
223++ /**************************************************************************
224++ *
225++ * @property:
226++ * no-long-family-names
227++ *
228++ * @description:
229++ * If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling
230++ * FreeType, the PCF driver constructs long family names.
231++ *
232++ * There are many PCF fonts just called `Fixed' which look completely
233++ * different, and which have nothing to do with each other. When
234++ * selecting `Fixed' in KDE or Gnome one gets results that appear rather
235++ * random, the style changes often if one changes the size and one
236++ * cannot select some fonts at all. The improve this situation, the PCF
237++ * module prepends the foundry name (plus a space) to the family name.
238++ * It also checks whether there are `wide' characters; all put together,
239++ * family names like `Sony Fixed' or `Misc Fixed Wide' are constructed.
240++ *
241++ * If `no-long-family-names' is set, this feature gets switched off.
242++ *
243++ * {
244++ * FT_Library library;
245++ * FT_Bool no_long_family_names = TRUE;
246++ *
247++ *
248++ * FT_Init_FreeType( &library );
249++ *
250++ * FT_Property_Set( library, "pcf",
251++ * "no-long-family-names",
252++ * &no_long_family_names );
253++ * }
254++ *
255++ * @note:
256++ * This property can be used with @FT_Property_Get also.
257++ *
258++ * This property can be set via the `FREETYPE_PROPERTIES' environment
259++ * variable (using values 1 and 0 for `on' and `off', respectively).
260++ *
261++ */
262++
263++
264++FT_END_HEADER
265++
266++
267++#endif /* FTPCFDRV_H_ */
268++
269++
270++/* END */
271+diff --git a/src/pcf/pcf.h b/src/pcf/pcf.h
272+index 830cabe..f0390cb 100644
273+--- a/src/pcf/pcf.h
274++++ b/src/pcf/pcf.h
275+@@ -167,6 +167,8 @@ FT_BEGIN_HEADER
276+ {
277+ FT_DriverRec root;
278+279++ FT_Bool no_long_family_names;
280++
281+ } PCF_DriverRec, *PCF_Driver;
282+283+284+diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
285+index 8f4a90d..bc65423 100644
286+--- a/src/pcf/pcfdrivr.c
287++++ b/src/pcf/pcfdrivr.c
288+@@ -49,6 +49,8 @@ THE SOFTWARE.
289+290+ #include FT_SERVICE_BDF_H
291+ #include FT_SERVICE_FONT_FORMAT_H
292++#include FT_SERVICE_PROPERTIES_H
293++#include FT_PCF_DRIVER_H
294+295+296+ /*************************************************************************/
297+@@ -667,6 +669,110 @@ THE SOFTWARE.
298+ };
299+300+301++ /*
302++ * PROPERTY SERVICE
303++ *
304++ */
305++ static FT_Error
306++ pcf_property_set( FT_Module module, /* PCF_Driver */
307++ const char* property_name,
308++ const void* value,
309++ FT_Bool value_is_string )
310++ {
311++#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
312++
313++ FT_Error error = FT_Err_Ok;
314++ PCF_Driver driver = (PCF_Driver)module;
315++
316++#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
317++ FT_UNUSED( value_is_string );
318++#endif
319++
320++
321++ if ( !ft_strcmp( property_name, "no-long-family-names" ) )
322++ {
323++#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
324++ if ( value_is_string )
325++ {
326++ const char* s = (const char*)value;
327++ long lfn = ft_strtol( s, NULL, 10 );
328++
329++
330++ if ( lfn == 0 )
331++ driver->no_long_family_names = 0;
332++ else if ( lfn == 1 )
333++ driver->no_long_family_names = 1;
334++ else
335++ return FT_THROW( Invalid_Argument );
336++ }
337++ else
338++#endif
339++ {
340++ FT_Bool* no_long_family_names = (FT_Bool*)value;
341++
342++
343++ driver->no_long_family_names = *no_long_family_names;
344++ }
345++
346++ return error;
347++ }
348++
349++#else /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
350++
351++ FT_UNUSED( module );
352++ FT_UNUSED( value );
353++ FT_UNUSED( value_is_string );
354++
355++#endif /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
356++
357++ FT_TRACE0(( "pcf_property_set: missing property `%s'\n",
358++ property_name ));
359++ return FT_THROW( Missing_Property );
360++ }
361++
362++
363++ static FT_Error
364++ pcf_property_get( FT_Module module, /* PCF_Driver */
365++ const char* property_name,
366++ const void* value )
367++ {
368++#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
369++
370++ FT_Error error = FT_Err_Ok;
371++ PCF_Driver driver = (PCF_Driver)module;
372++
373++
374++ if ( !ft_strcmp( property_name, "no-long-family-names" ) )
375++ {
376++ FT_Bool no_long_family_names = driver->no_long_family_names;
377++ FT_Bool* val = (FT_Bool*)value;
378++
379++
380++ *val = no_long_family_names;
381++
382++ return error;
383++ }
384++
385++#else /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
386++
387++ FT_UNUSED( module );
388++ FT_UNUSED( value );
389++
390++#endif /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
391++
392++ FT_TRACE0(( "pcf_property_get: missing property `%s'\n",
393++ property_name ));
394++ return FT_THROW( Missing_Property );
395++ }
396++
397++
398++ FT_DEFINE_SERVICE_PROPERTIESREC(
399++ pcf_service_properties,
400++
401++ (FT_Properties_SetFunc)pcf_property_set, /* set_property */
402++ (FT_Properties_GetFunc)pcf_property_get ) /* get_property */
403++
404++
405+ /*
406+ *
407+ * SERVICE LIST
408+@@ -677,6 +783,7 @@ THE SOFTWARE.
409+ {
410+ { FT_SERVICE_ID_BDF, &pcf_service_bdf },
411+ { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_PCF },
412++ { FT_SERVICE_ID_PROPERTIES, &pcf_service_properties },
413+ { NULL, NULL }
414+ };
415+416+@@ -694,7 +801,14 @@ THE SOFTWARE.
417+ FT_CALLBACK_DEF( FT_Error )
418+ pcf_driver_init( FT_Module module ) /* PCF_Driver */
419+ {
420++#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
421++ PCF_Driver driver = (PCF_Driver)module;
422++
423++
424++ driver->no_long_family_names = 0;
425++#else
426+ FT_UNUSED( module );
427++#endif
428+429+ return FT_Err_Ok;
430+ }
431+diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
432+index 38ba110..3eacf2b 100644
433+--- a/src/pcf/pcfread.c
434++++ b/src/pcf/pcfread.c
435+@@ -1393,57 +1393,75 @@ THE SOFTWARE.
436+ prop = pcf_find_property( face, "FAMILY_NAME" );
437+ if ( prop && prop->isString )
438+ {
439+- /* Prepend the foundry name plus a space to the family name. */
440+- /* There are many fonts just called `Fixed' which look completely */
441+- /* different, and which have nothing to do with each other. When */
442+- /* selecting `Fixed' in KDE or Gnome one gets results that appear */
443+- /* rather random, the style changes often if one changes the size */
444+- /* and one cannot select some fonts at all. */
445+- /* */
446+- /* We also check whether we have `wide' characters; all put */
447+- /* together, we get family names like `Sony Fixed' or `Misc Fixed */
448+- /* Wide'. */
449+- PCF_Property foundry_prop, point_size_prop, average_width_prop;
450+-
451+- int l = ft_strlen( prop->value.atom ) + 1;
452+- int wide = 0;
453+-
454+-
455+- foundry_prop = pcf_find_property( face, "FOUNDRY" );
456+- point_size_prop = pcf_find_property( face, "POINT_SIZE" );
457+- average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" );
458+-
459+- if ( point_size_prop && average_width_prop )
460++
461++#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
462++
463++ PCF_Driver driver = (PCF_Driver)FT_FACE_DRIVER( face );
464++
465++
466++ if ( !driver->no_long_family_names )
467+ {
468+- if ( average_width_prop->value.l >= point_size_prop->value.l )
469++ /* Prepend the foundry name plus a space to the family name. */
470++ /* There are many fonts just called `Fixed' which look */
471++ /* completely different, and which have nothing to do with each */
472++ /* other. When selecting `Fixed' in KDE or Gnome one gets */
473++ /* results that appear rather random, the style changes often if */
474++ /* one changes the size and one cannot select some fonts at all. */
475++ /* */
476++ /* We also check whether we have `wide' characters; all put */
477++ /* together, we get family names like `Sony Fixed' or `Misc */
478++ /* Fixed Wide'. */
479++
480++ PCF_Property foundry_prop, point_size_prop, average_width_prop;
481++
482++ int l = ft_strlen( prop->value.atom ) + 1;
483++ int wide = 0;
484++
485++
486++ foundry_prop = pcf_find_property( face, "FOUNDRY" );
487++ point_size_prop = pcf_find_property( face, "POINT_SIZE" );
488++ average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" );
489++
490++ if ( point_size_prop && average_width_prop )
491+ {
492+- /* This font is at least square shaped or even wider */
493+- wide = 1;
494+- l += ft_strlen( " Wide" );
495++ if ( average_width_prop->value.l >= point_size_prop->value.l )
496++ {
497++ /* This font is at least square shaped or even wider */
498++ wide = 1;
499++ l += ft_strlen( " Wide" );
500++ }
501+ }
502+- }
503+504+- if ( foundry_prop && foundry_prop->isString )
505+- {
506+- l += ft_strlen( foundry_prop->value.atom ) + 1;
507++ if ( foundry_prop && foundry_prop->isString )
508++ {
509++ l += ft_strlen( foundry_prop->value.atom ) + 1;
510+511+- if ( FT_NEW_ARRAY( root->family_name, l ) )
512+- goto Exit;
513++ if ( FT_NEW_ARRAY( root->family_name, l ) )
514++ goto Exit;
515++
516++ ft_strcpy( root->family_name, foundry_prop->value.atom );
517++ ft_strcat( root->family_name, " " );
518++ ft_strcat( root->family_name, prop->value.atom );
519++ }
520++ else
521++ {
522++ if ( FT_NEW_ARRAY( root->family_name, l ) )
523++ goto Exit;
524+525+- ft_strcpy( root->family_name, foundry_prop->value.atom );
526+- ft_strcat( root->family_name, " " );
527+- ft_strcat( root->family_name, prop->value.atom );
528++ ft_strcpy( root->family_name, prop->value.atom );
529++ }
530++
531++ if ( wide )
532++ ft_strcat( root->family_name, " Wide" );
533+ }
534+ else
535++
536++#endif /* PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
537++
538+ {
539+- if ( FT_NEW_ARRAY( root->family_name, l ) )
540++ if ( FT_STRDUP( root->family_name, prop->value.atom ) )
541+ goto Exit;
542+-
543+- ft_strcpy( root->family_name, prop->value.atom );
544+ }
545+-
546+- if ( wide )
547+- ft_strcat( root->family_name, " Wide" );
548+ }
549+ else
550+ root->family_name = NULL;
551+--
552+cgit v1.0-41-gc330
553+
···79 # Delete obsolete stuff that conflicts with cups-filters.
80 rm -rf $out/share/cups/banners $out/share/cups/data/testprint
81082 moveToOutput bin/cups-config "$dev"
00008384 # Rename systemd files provided by CUPS
85 for f in "$out"/lib/systemd/system/*; do
···79 # Delete obsolete stuff that conflicts with cups-filters.
80 rm -rf $out/share/cups/banners $out/share/cups/data/testprint
8182+ # Some outputs in cups-config were unexpanded and some even wrong.
83 moveToOutput bin/cups-config "$dev"
84+ sed -e "/^cups_serverbin=/s|\$(lib)|$out|" \
85+ -e "s|\$(out)|$out|" \
86+ -e "s|\$(lib)|$lib|" \
87+ -i "$dev/bin/cups-config"
8889 # Rename systemd files provided by CUPS
90 for f in "$out"/lib/systemd/system/*; do