#!/usr/bin/perl
# $Id: lxvile-fonts,v 1.2 2021/12/02 00:27:52 tom Exp $
# ask xlsfonts for the matching fonts for the encodings used in lxvile.

use strict;
use warnings;

use I18N::Langinfo qw(langinfo CODESET);

my $encoding = lc( langinfo( CODESET() ) );
if ( $encoding eq "utf-8" ) {
    $encoding = "iso10646-1";
}
elsif ( $encoding =~ /iso-/ ) {
    $encoding =~ s/iso-/iso/;
}
else {
    $encoding = "iso8859-1";
}

my $size = 14;
my $xlfd = "-*-fixed-medium-r-normal--" . $size . "-*-*-*-*-*-" . $encoding;

exec "xlsfonts", ( @ARGV, "-fn", $xlfd );
