Skip to content

Instantly share code, notes, and snippets.

@HinTak
Created May 6, 2016 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HinTak/cf7528519552f0eded236fa8e9f41247 to your computer and use it in GitHub Desktop.
Save HinTak/cf7528519552f0eded236fa8e9f41247 to your computer and use it in GitHub Desktop.
Att the set-able FontVal rasterization test parameters.
import clr
clr.AddReference("OTFontFileVal.dll")
from OTFontFileVal import ValidatorParameters
from System import Array
from System.Collections.Generic import List
class validation_parameters:
def __init__(self):
vp = ValidatorParameters()
###############################################################
# below are just the default values and can be deleted as is. #
###############################################################
vp.doRastBW = false
vp.doRastBW = false
vp.doRastGray = false
vp.doRastClearType = false
vp.doRastCTCompWidth = false
vp.doRastCTVert = false
vp.doRastCTBGR = false
vp.doRastCTFractWidth = false
vp.xRes = 96
vp.yRes = 96
vp.xform.stretchX = 1.0
vp.xform.stretchY = 1.0
vp.xform.rotation = 0.0
vp.xform.skew = 0.0
vp.xform.matrix = Array[Array[float]]( ( (1.0, 0.0, 0.0),
(0.0, 1.0, 0.0),
(0.0, 0.0, 1.0) ) )
vp.sizes = List[int]([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,46,47,48,49,50,
51,52,53,54,55,56,57,58,59,60,
61,62,63,64,65,66,67,68,69,70,
71,72,
80,88,96,102,110,118,126])
###############################################################
################## default values end #########################
###############################################################
self.vp = vp
def GetValue(self):
return self.vp
@HinTak
Copy link
Author

HinTak commented May 6, 2016

The default constructor sets all tables to test, and loading the validation parameters this way should be before any of these options:

+table, -table, -all-tables, -only-tables, +raster-tests

to the command-line FontValidator, otherwise they may not have the desired effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment