View | Details | Raw Unified | Return to bug 25384
Collapse All | Expand All

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

Return to bug 25384