1
// Font_as.hx: ActionScript 3 "Font" class, for Gnash.
3
// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
4
// after any hand editing loosing changes.
6
// Copyright (C) 2009 Free Software Foundation, Inc.
8
// This program is free software; you can redistribute it and/or modify
9
// it under the terms of the GNU General Public License as published by
10
// the Free Software Foundation; either version 3 of the License, or
11
// (at your option) any later version.
13
// This program is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
18
// You should have received a copy of the GNU General Public License
19
// along with this program; if not, write to the Free Software
20
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
// This test case must be processed by CPP before compiling to include the
24
// DejaGnu.hx header file for the testing framework support.
27
import flash.text.Font;
28
import flash.display.MovieClip;
29
import flash.text.FontStyle;
30
import flash.text.FontType;
33
//import flash.MovieClip;
38
// import our testing API
41
// Class must be named with the _as suffix, as that's the same name as the file.
43
static function main() {
46
DejaGnu.note("The Font class does not exist in versions prior to flash9");
49
var x1:Font = new Font();
51
// Make sure we actually get a valid class
53
DejaGnu.pass("Font class exists");
55
DejaGnu.fail("Font class doesn't exist");
58
// Tests to see if all the properties exist. All these do is test for
59
// existance of a property, and don't test the functionality at all. This
60
// is primarily useful only to test completeness of the API implementation.
62
//Need to get a font so that the properties arent't Null
63
var fonts:Array<Dynamic> = Font.enumerateFonts(true);
66
if (Std.is(x1.fontName, String)) {
67
DejaGnu.pass("Font.fontName property exists");
69
DejaGnu.fail("Font.fontName property doesn't exist");
71
if (Std.is(x1.fontStyle, String)) {
72
DejaGnu.pass("Font.fontStyle property exists");
74
DejaGnu.fail("Font.fontStyle property doesn't exist");
76
if (Std.is(x1.fontType, String)) {
77
DejaGnu.pass("Font.fontType property exists");
79
DejaGnu.fail("Font.fontType property doesn't exist");
82
// Tests to see if all the methods exist. All these do is test for
83
// existance of a method, and don't test the functionality at all. This
84
// is primarily useful only to test completeness of the API implementation.
86
//enumerateFonts is a static method
87
if (Type.typeof(Font.enumerateFonts) == ValueType.TFunction) {
88
DejaGnu.pass("Font::enumerateFonts() method exists");
90
DejaGnu.fail("Font::enumerateFonts() method doesn't exist");
92
if (Type.typeof(x1.hasGlyphs) == ValueType.TFunction) {
93
DejaGnu.pass("Font::hasGlyphs() method exists");
95
DejaGnu.fail("Font::hasGlyphs() method doesn't exist");
97
//registerFont is a static method
98
if (Type.typeof(Font.registerFont) == ValueType.TFunction) {
99
DejaGnu.pass("Font::registerFont() method exists");
101
DejaGnu.fail("Font::registerFont() method doesn't exist");
105
// Call this after finishing all tests. It prints out the totals.
112
// indent-tabs-mode: t