blob: 0e6e94bed84400d3d25f840b0689b954d5ee121b [file] [log] [blame]
dan sinclair993a1992017-10-25 20:21:09 -04001// Copyright 2017 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Dan Sinclaire0345a42017-10-30 20:20:42 +00007#include "fxjs/cjs_font.h"
dan sinclair993a1992017-10-25 20:21:09 -04008
Dan Sinclairc94a7932017-10-26 16:48:57 -04009const JSConstSpec CJS_Font::ConstSpecs[] = {
dan sinclair993a1992017-10-25 20:21:09 -040010 {"Times", JSConstSpec::String, 0, "Times-Roman"},
11 {"TimesB", JSConstSpec::String, 0, "Times-Bold"},
12 {"TimesI", JSConstSpec::String, 0, "Times-Italic"},
13 {"TimesBI", JSConstSpec::String, 0, "Times-BoldItalic"},
14 {"Helv", JSConstSpec::String, 0, "Helvetica"},
15 {"HelvB", JSConstSpec::String, 0, "Helvetica-Bold"},
16 {"HelvI", JSConstSpec::String, 0, "Helvetica-Oblique"},
17 {"HelvBI", JSConstSpec::String, 0, "Helvetica-BoldOblique"},
18 {"Cour", JSConstSpec::String, 0, "Courier"},
19 {"CourB", JSConstSpec::String, 0, "Courier-Bold"},
20 {"CourI", JSConstSpec::String, 0, "Courier-Oblique"},
21 {"CourBI", JSConstSpec::String, 0, "Courier-BoldOblique"},
22 {"Symbol", JSConstSpec::String, 0, "Symbol"},
Dan Sinclair909fa2d2017-12-12 01:53:28 +000023 {"ZapfD", JSConstSpec::String, 0, "ZapfDingbats"}};
dan sinclair993a1992017-10-25 20:21:09 -040024
Dan Sinclairef299532017-10-26 16:48:30 -040025int CJS_Font::ObjDefnID = -1;
Dan Sinclair89d26c82017-10-26 12:21:28 -040026
Dan Sinclairef299532017-10-26 16:48:30 -040027// static
Dan Sinclairbef4d3e2017-10-26 16:49:38 -040028void CJS_Font::DefineJSObjects(CFXJS_Engine* pEngine) {
29 ObjDefnID = pEngine->DefineObj("font", FXJSOBJTYPE_STATIC, nullptr, nullptr);
Tom Sepez8b4ddeb2018-06-11 15:55:17 +000030 DefineConsts(pEngine, ObjDefnID, ConstSpecs);
Dan Sinclair89d26c82017-10-26 12:21:28 -040031}