Lines 445-458
This function returns a reference to an array of hashes containing all font type
Link Here
|
445 |
|
445 |
|
446 |
sub get_font_types { |
446 |
sub get_font_types { |
447 |
my @available_fonts = (); |
447 |
my @available_fonts = (); |
448 |
my %available_font_lookup = %default_font_types; |
448 |
my $available_font_lookup = dclone(\%default_font_types); |
449 |
|
449 |
|
450 |
#Add new fonts or rename default fonts |
450 |
#Add new fonts or rename default fonts |
451 |
my $ttf = C4::Context->config('ttf'); |
451 |
my $ttf = C4::Context->config('ttf'); |
452 |
if ($ttf && $ttf->{font} && ref $ttf->{font} eq 'ARRAY'){ |
452 |
if ($ttf && $ttf->{font} && ref $ttf->{font} eq 'ARRAY'){ |
453 |
foreach my $font ( @{$ttf->{font}} ){ |
453 |
foreach my $font ( @{$ttf->{font}} ){ |
454 |
if ($font->{type} && $font->{name} && $font->{content}){ |
454 |
if ($font->{type} && $font->{name} && $font->{content}){ |
455 |
$available_font_lookup{ $font->{type} } = { name => $font->{name}, }; |
455 |
$available_font_lookup->{ $font->{type} } = { name => $font->{name}, }; |
456 |
} |
456 |
} |
457 |
} |
457 |
} |
458 |
} |
458 |
} |
Lines 460-474
sub get_font_types {
Link Here
|
460 |
#Output default font types first (in default order) |
460 |
#Output default font types first (in default order) |
461 |
_use_font({ |
461 |
_use_font({ |
462 |
font_types => \@default_font_type_codes, |
462 |
font_types => \@default_font_type_codes, |
463 |
font_lookup => \%available_font_lookup, |
463 |
font_lookup => $available_font_lookup, |
464 |
available_fonts => \@available_fonts, |
464 |
available_fonts => \@available_fonts, |
465 |
}); |
465 |
}); |
466 |
|
466 |
|
467 |
#Output configured font types last (in alphabetical order) |
467 |
#Output configured font types last (in alphabetical order) |
468 |
my @remaining_types = sort keys %available_font_lookup; |
468 |
my @remaining_types = sort keys %$available_font_lookup; |
469 |
_use_font({ |
469 |
_use_font({ |
470 |
font_types => \@remaining_types, |
470 |
font_types => \@remaining_types, |
471 |
font_lookup => \%available_font_lookup, |
471 |
font_lookup => $available_font_lookup, |
472 |
available_fonts => \@available_fonts, |
472 |
available_fonts => \@available_fonts, |
473 |
}); |
473 |
}); |
474 |
|
474 |
|
475 |
- |
|
|