import { ASObject } from "../../avm2/nat/ASObject"; import { ISecurityDomain } from "../../avm2/nat/ISecurityDomain"; import { ASArray } from "../../avm2/nat/ASArray"; import { Symbol, EagerlyResolvedSymbol, SymbolData } from "../symbol"; import { LoaderInfo } from "../display/LoaderInfo"; import { IRemotable } from '../../base/remoting'; import { AXClass } from '../../avm2/run/AXClass'; /** * Copyright 2014 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ export declare class Font extends ASObject implements IRemotable { static axClass: typeof Font & AXClass; private static _fonts; private static _fontsBySymbolId; private static _fontsByName; static DEVICE_FONT_METRICS_WIN: Object; static DEVICE_FONT_METRICS_LINUX: Object; static DEVICE_FONT_METRICS_MAC: Object; static DEVICE_FONT_METRICS_BUILTIN: Object; static DEFAULT_FONT_SANS: string; static DEFAULT_FONT_SERIF: string; static DEFAULT_FONT_TYPEWRITER: string; static classInitializer: any; static classSymbols: string[]; static instanceSymbols: string[]; private _initializeFields; private static _deviceFontMetrics; private static _getFontMetrics; static resolveFontName(name: string): string; _symbol: FontSymbol; applySymbol(): void; constructor(); static getBySymbolId(id: number): Font; static getByNameAndStyle(name: string, style: string): Font; static getDefaultFont(): Font; private _fontName; _fontFamily: string; private _fontStyle; private _fontType; _id: number; ascent: number; descent: number; leading: number; advances: number[]; static enumerateFonts(enumerateDeviceFonts?: boolean): ASArray; static registerFont(font: AXClass): void; /** * Registers a font symbol as available in the system. * * Firefox decodes fonts synchronously, allowing us to do the decoding upon first actual use. * All we need to do here is let the system know about the family name and ID, so that both * TextFields/Labels referring to the font's symbol ID as well as HTML text specifying a font * face can resolve the font. * * For all other browsers, the decoding has been triggered by the Loader at this point. */ static registerFontSymbol(fontMapping: { name: string; style: string; id: number; }, loaderInfo: LoaderInfo): void; static resolveFontSymbol(loaderInfo: LoaderInfo, id: number, syncId: number, key: string): Font; get fontName(): string; get fontStyle(): string; get fontType(): string; hasGlyphs(str: string): boolean; } export declare class FontSymbol extends Symbol implements EagerlyResolvedSymbol { name: string; bold: boolean; italic: boolean; codes: number[]; originalSize: boolean; metrics: any; syncId: number; constructor(data: SymbolData, sec: ISecurityDomain); static FromData(data: any, loaderInfo: LoaderInfo): FontSymbol; get resolveAssetCallback(): any; private _unboundResolveAssetCallback; }