mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-24 09:03:30 +01:00
vncserver: extract DetectFontPath
This commit is contained in:
parent
ed51231b4e
commit
2cb5098060
@ -64,41 +64,7 @@ $defaultConfig
|
||||
|
||||
chop($host = `uname -n`);
|
||||
|
||||
if (-d "/etc/X11/fontpath.d") {
|
||||
$fontPath = "catalogue:/etc/X11/fontpath.d";
|
||||
}
|
||||
|
||||
@fontpaths = ('/usr/share/X11/fonts', '/usr/share/fonts', '/usr/share/fonts/X11/');
|
||||
if (! -l "/usr/lib/X11") {push(@fontpaths, '/usr/lib/X11/fonts');}
|
||||
if (! -l "/usr/X11") {push(@fontpaths, '/usr/X11/lib/X11/fonts');}
|
||||
if (! -l "/usr/X11R6") {push(@fontpaths, '/usr/X11R6/lib/X11/fonts');}
|
||||
push(@fontpaths, '/usr/share/fonts/default');
|
||||
|
||||
@fonttypes = ('misc',
|
||||
'75dpi',
|
||||
'100dpi',
|
||||
'Speedo',
|
||||
'Type1');
|
||||
|
||||
foreach $_fpath (@fontpaths) {
|
||||
foreach $_ftype (@fonttypes) {
|
||||
if (-f "$_fpath/$_ftype/fonts.dir") {
|
||||
if (! -l "$_fpath/$_ftype") {
|
||||
$defFontPath .= "$_fpath/$_ftype,";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($defFontPath) {
|
||||
if (substr($defFontPath, -1, 1) == ',') {
|
||||
chop $defFontPath;
|
||||
}
|
||||
}
|
||||
|
||||
if ($fontPath eq "") {
|
||||
$fontPath = $defFontPath;
|
||||
}
|
||||
&DetectFontPath();
|
||||
|
||||
# Check command line options
|
||||
|
||||
@ -939,3 +905,41 @@ sub DetectUserName {
|
||||
|
||||
return $vncUserName;
|
||||
}
|
||||
|
||||
sub DetectFontPath {
|
||||
if (-d "/etc/X11/fontpath.d") {
|
||||
$fontPath = "catalogue:/etc/X11/fontpath.d";
|
||||
}
|
||||
|
||||
@fontpaths = ('/usr/share/X11/fonts', '/usr/share/fonts', '/usr/share/fonts/X11/');
|
||||
if (! -l "/usr/lib/X11") {push(@fontpaths, '/usr/lib/X11/fonts');}
|
||||
if (! -l "/usr/X11") {push(@fontpaths, '/usr/X11/lib/X11/fonts');}
|
||||
if (! -l "/usr/X11R6") {push(@fontpaths, '/usr/X11R6/lib/X11/fonts');}
|
||||
push(@fontpaths, '/usr/share/fonts/default');
|
||||
|
||||
@fonttypes = ('misc',
|
||||
'75dpi',
|
||||
'100dpi',
|
||||
'Speedo',
|
||||
'Type1');
|
||||
|
||||
foreach $_fpath (@fontpaths) {
|
||||
foreach $_ftype (@fonttypes) {
|
||||
if (-f "$_fpath/$_ftype/fonts.dir") {
|
||||
if (! -l "$_fpath/$_ftype") {
|
||||
$defFontPath .= "$_fpath/$_ftype,";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($defFontPath) {
|
||||
if (substr($defFontPath, -1, 1) == ',') {
|
||||
chop $defFontPath;
|
||||
}
|
||||
}
|
||||
|
||||
if ($fontPath eq "") {
|
||||
$fontPath = $defFontPath;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user