projects/guix·blob python-team · refs

84 lines · 3.5 KiB

1Index: wrap-source/pkg/pdf/fonts.go
2===================================================================
3--- wrap-source.orig/pkg/pdf/fonts.go
4+++ wrap-source/pkg/pdf/fonts.go
5@@ -36,15 +36,15 @@ var (
6 BoldItalic: []string{"Courier Prime Bold Italic.ttf"},
7 }
8
9- CourierNew = Font{
10- RomanName: "Courier New",
11- Roman: []string{"Courier New.ttf", "cour.ttf"},
12- BoldName: "Courier New Bold",
13- Bold: []string{"Courier New Bold.ttf", "courbd.ttf"},
14- ItalicName: "Courier New Italic",
15- Italic: []string{"Courier New Italic.ttf", "couri.ttf"},
16- BoldItalicName: "Courier New Bold Italic",
17- BoldItalic: []string{"Courier New Bold Italic.ttf", "courbi.ttf"},
18+ LiberationMono = Font{
19+ RomanName: "Liberation Mono Regular",
20+ Roman: []string{"LiberationMono-Regular.ttf"},
21+ BoldName: "Liberation Mono Bold",
22+ Bold: []string{"LiberationMono-Bold.ttf"},
23+ ItalicName: "Liberation Mono Italic",
24+ Italic: []string{"LiberationMono-Italic.ttf"},
25+ BoldItalicName: "Liberation Mono Bold Italic",
26+ BoldItalic: []string{"LiberationMono-BoldItalic.ttf"},
27 }
28
29 FreeMono = Font{
30@@ -151,9 +151,8 @@ func loadFonts() {
31 err := loadFont(CourierPrime)
32
33 if err != nil {
34- // Courier New should be available on macOS and Windows
35 fmt.Fprintln(os.Stderr, "Warning: "+err.Error())
36- err = loadFont(CourierNew)
37+ err = loadFont(LiberationMono)
38
39 if err != nil {
40 // FreeMono as a final attempt
41Index: wrap-source/pkg/cli/pdf.go
42===================================================================
43--- wrap-source.orig/pkg/cli/pdf.go
44+++ wrap-source/pkg/cli/pdf.go
45@@ -22,7 +22,7 @@ var pdfCmd = &cobra.Command{
46 var (
47 pdfProductionFlag bool
48 useCourierPrime bool
49- useCourierNew bool
50+ useLiberationMono bool
51 useFreeMono bool
52 pageSize string
53 font string
54@@ -31,7 +31,7 @@ var (
55 func init() {
56 pdfCmd.Flags().BoolVarP(&pdfProductionFlag, "production", "p", false, "add scene numbers and other production text")
57 pdfCmd.Flags().BoolVar(&useCourierPrime, "use-courier-prime", false, "force the usage of Courier Prime")
58- pdfCmd.Flags().BoolVar(&useCourierNew, "use-courier-new", false, "force the usage of Courier New")
59+ pdfCmd.Flags().BoolVar(&useLiberationMono, "use-courier-new", false, "force the usage of Liberation Mono")
60 pdfCmd.Flags().BoolVar(&useFreeMono, "use-freemono", false, "force the usage of GNU FreeMono")
61 pdfCmd.Flags().StringVar(&pageSize, "page-size", "", "choose page size (letter or a4)")
62 pdfCmd.RegisterFlagCompletionFunc("page-size", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
63@@ -46,8 +46,8 @@ func pdfRun(cmd *cobra.Command, args []s
64 // Evaluate font selection
65 pdf.AutoFontSelection = false
66
67- if (font != "" && atLeastOne(useCourierPrime, useCourierNew, useFreeMono)) ||
68- moreThanOne(useCourierPrime, useCourierNew, useFreeMono) {
69+ if (font != "" && atLeastOne(useCourierPrime, useLiberationMono, useFreeMono)) ||
70+ moreThanOne(useCourierPrime, useLiberationMono, useFreeMono) {
71 // The fonts are mutualy exclusive so throw an error
72 handle(errors.New("tried to force multiple fonts at the same time"))
73 }
74@@ -77,8 +77,8 @@ func pdfRun(cmd *cobra.Command, args []s
75 } else if useCourierPrime {
76 pdf.SelectedFont = pdf.CourierPrime
77
78- } else if useCourierNew {
79- pdf.SelectedFont = pdf.CourierNew
80+ } else if useLiberationMono {
81+ pdf.SelectedFont = pdf.LiberationMono
82
83 } else if useFreeMono {
84 pdf.SelectedFont = pdf.FreeMono