dan sinclair | 993a199 | 2017-10-25 20:21:09 -0400 | [diff] [blame] | 1 | // 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 Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 7 | #include "fxjs/cjs_font.h" |
dan sinclair | 993a199 | 2017-10-25 20:21:09 -0400 | [diff] [blame] | 8 | |
Dan Sinclair | c94a793 | 2017-10-26 16:48:57 -0400 | [diff] [blame] | 9 | const JSConstSpec CJS_Font::ConstSpecs[] = { |
dan sinclair | 993a199 | 2017-10-25 20:21:09 -0400 | [diff] [blame] | 10 | {"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 Sinclair | 909fa2d | 2017-12-12 01:53:28 +0000 | [diff] [blame] | 23 | {"ZapfD", JSConstSpec::String, 0, "ZapfDingbats"}}; |
dan sinclair | 993a199 | 2017-10-25 20:21:09 -0400 | [diff] [blame] | 24 | |
Dan Sinclair | ef29953 | 2017-10-26 16:48:30 -0400 | [diff] [blame] | 25 | int CJS_Font::ObjDefnID = -1; |
Dan Sinclair | 89d26c8 | 2017-10-26 12:21:28 -0400 | [diff] [blame] | 26 | |
Dan Sinclair | ef29953 | 2017-10-26 16:48:30 -0400 | [diff] [blame] | 27 | // static |
Dan Sinclair | bef4d3e | 2017-10-26 16:49:38 -0400 | [diff] [blame] | 28 | void CJS_Font::DefineJSObjects(CFXJS_Engine* pEngine) { |
| 29 | ObjDefnID = pEngine->DefineObj("font", FXJSOBJTYPE_STATIC, nullptr, nullptr); |
Tom Sepez | 8b4ddeb | 2018-06-11 15:55:17 +0000 | [diff] [blame] | 30 | DefineConsts(pEngine, ObjDefnID, ConstSpecs); |
Dan Sinclair | 89d26c8 | 2017-10-26 12:21:28 -0400 | [diff] [blame] | 31 | } |