mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:17:32 -05:00 
			
		
		
		
	Update automatic font resolving
This commit is contained in:
		
							parent
							
								
									ab8b7c4427
								
							
						
					
					
						commit
						f4979fb0a4
					
				@ -273,20 +273,8 @@ class Helpers
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public static function resolveFont(string $font = 'Arial'): array
 | 
					    public static function resolveFont(string $font = 'Arial'): array
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $fonts = [
 | 
					        return $font
 | 
				
			||||||
            'Arial' => '',
 | 
					            ? ['name' => $font, 'url' => sprintf('https://fonts.googleapis.com/css2?family=%s&display=swap', $font)]
 | 
				
			||||||
            'Inter' => 'https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap',
 | 
					            : ['name' => 'Arial', 'url' => ''];
 | 
				
			||||||
            'Roboto' => 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap',
 | 
					 | 
				
			||||||
            'Irish Grover' => 'https://fonts.googleapis.com/css2?family=Irish+Grover&display=swap',
 | 
					 | 
				
			||||||
        ];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (array_key_exists($font, $fonts)) {
 | 
					 | 
				
			||||||
            return [
 | 
					 | 
				
			||||||
                'name' => $font,
 | 
					 | 
				
			||||||
                'url' => $fonts[$font],
 | 
					 | 
				
			||||||
            ];
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return ['name' => 'Arial', 'url' => $fonts['Arial']];
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user