summaryrefslogtreecommitdiff
path: root/modules/graphics/tests/unit_tests/xlfont.dia.ref
blob: f3be5b9300bfce6e877b7d34f476a9e1e70f28c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2008 - INRIA - Allan CORNET
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- TEST WITH GRAPHIC -->
xlfont('reset')
initialfonts = xlfont();
if size(initialfonts,'*') <> 11 then bugmes();quit;end
availablefonts = xlfont('AVAILABLE_FONTS');
if size(availablefonts,'*') < 11 then bugmes();quit;end
for i=1:11:1
  xlfont(availablefonts(i),i);
end
for i=1:11:1
  xlfont(availablefonts(i),i,%t,%f);
end
for i=1:11:1
  xlfont(availablefonts(i),i,%t);
end
xlfont('reset');
afterresetfonts = xlfont();
if ~and(initialfonts == afterresetfonts) then bugmes();quit;end
cd(TMPDIR);
exec(SCI+"/modules/localization/tests/unit_tests/CreateDir.sce", -1);
tab_ref = [
"世界您好",
"азеазея",
"ハロー・ワールド",
"حريات وحقوق",
"תוכנית"];
fontpath = SCI + "/modules/graphics/tests/unit_tests";
fontname = "DejaVuSansMono.ttf";
fontfull = fontpath + filesep() + fontname;
for i = 1 : size(tab_ref,'*')
  pathtemp = TMPDIR + filesep() + 'dir_' + tab_ref(i);
  fonttemp = pathtemp + filesep() + fontname;
  copyfile(fontfull, fonttemp);
  ierr = execstr('r = xlfont(fonttemp);','errcatch');
  if ierr <> 0 then bugmes();quit;end
  if ~isdef('r') then bugmes();quit;end
  clear r;
end
xlfont('reset')