Giter Site home page Giter Site logo

microsoft / font-validator Goto Github PK

View Code? Open in Web Editor NEW
115.0 42.0 38.0 766 KB

Font Validator is a tool for testing fonts prior to release. This testing ensures that fonts meet Microsoft's high quality standards and perform exceptionally well on Microsoft's platform.

License: Other

C# 98.50% XSLT 0.78% HTML 0.35% Makefile 0.14% C++ 0.22% C 0.01%

font-validator's Introduction

Font-Validator

Font Validator is a tool for testing fonts prior to release. This testing ensures that fonts meet Microsoft's high quality standards and perform exceptionally well on Microsoft's platform.

This project is not actively maintained.

Hin-Tak Leung is actively maintaining and improving a forked version of Font Validator in github.com/HinTak/Font-Validator

font-validator's People

Contributors

aaronbell avatar abdullahbell avatar davelab6 avatar microsoft-github-policy-service[bot] avatar moyogo avatar msftgits avatar robmck-ms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

font-validator's Issues

Improving glyf table test's speed.

Now that the rasterization test in 2.0 is so much faster, it would be good to improve the speed of the other major time consumer, the glyf table test.

It takes over 4 hours on the glyf table alone, on win 8.1's mingliub, with mono (dotnet is faster):

meiryo.ttc  0:28:31
gulim.ttc   0:36:55
meiryob.ttc 0:28:54
mingliub.ttc    4:15:15

Updates to current 2015 spec

This is place holder to track all the 2015 spec related updates. Specific detailed discussions about individual items, please fie additional issues and put a URL back here.

New tables that need checking - e.g. COLR/CPAL/MATH/SVG . We also need font samples with these features for testing.

New versions of tables - e.g. OS/2 v5 (was v3 in 2009), checking additional fields (two new ones), and expanded or modified usage of existing fields, such as the usage of the code page bits being changed from reserved to used by lesser-used languages. There are likely other tables having an overhaul, like the kern table between 2003 and 2009, which require new tests to be written and added.

CBLC/CBDT falls uncomfortably between these - it is a variation/enhancement of existing tables, so the current code put these through the existing tables' code path. But there are additional work to be done , to check old table name with new features and new table names with old version, as well as checking all the new features added in CBLC/CBDT.

There is smaller scale change like expansion of the feature list ( http://www.microsoft.com/typography/otspec/featurelist.htm) . Mostly it is expansion, but additional warnings need to be done on withdrawn tags also.

Lastly I should mention that CFF support is poor, though a pre-2009 table.

Thanks Sami Artur Mandelbaum on (http://typedrawers.com/discussion/1222/microsoft-font-validator-lives/p2) for suggesting https://github.com/khaledhosny/xits-math for future MATH table testing.

Higher resolution version of the logo art work for macintosh packaging

Exchanges with Georg Seifert about Mac OS packaging, lead to a complaint & requirement for a higher resolution version of the logo art work for macintosh packaging.

It is unlikely the original art work survived - in any case, designing icons for windows applications in the 199x was likely very different from now with high-res display etc. Microsoft should commission and/etc decide on a higher res version of the logo either based on the old design or a new one.

A1112 exception in glyf test with libre fonts.

Here are the font files which generates A1112 exception in the current glyf test.

/usr/share/fonts/jsmath-fonts/jsMath-cmsy10.ttf
/usr/share/fonts/kanjistrokeorders/KanjiStrokeOrders_v3.001.ttf
/usr/share/fonts/larabie/decorative/univox.ttf
/usr/share/fonts/un-core/UnBatangBold.ttf
/usr/share/fonts/un-core/UnBatang.ttf
/usr/share/fonts/un-extra/UnShinmun.ttf
/usr/share/texlive/texmf-dist/fonts/truetype/public/junicode/Junicode-BoldItalic.ttf

Shell script for easy commandline use on Mac OS X

This is a small shell script that you can use to run Font Validator from Terminal on Mac OS X. In my case, I put the FontValidator binaries into the /usr/local/mono/fontval folder. You can put it anywhere, but make sure to update the line starting with export FVALDIR to point to that location. You can copy-paste the code below into a plain-text file and proceed as described below. Make sure that the line #!/usr/bin/env bash is the very first line in the file (no blank lines above).

#!/usr/bin/env bash
# Use https://github.com/HinTak/Font-Validator
# or http://sourceforge.net/projects/hp-pxl-jetready/files/private-test-data/FontVal-RELEASE_2015_11_12-bin.zip/download
# on Mac OS X
# 
# INSTALL
#1. Install http://brew.sh/
#2. Run: brew install mono
#3. Run: brew install freetype
#4. Change line 5 of SharpFont.dll.config to: 
# <dllentry os="osx" dll="/usr/local/lib/libfreetype.6.dylib" />
#5. Here, set the folder in which FontValidator.exe and fval.xsl can be found:
export FVALDIR=/usr/local/mono/fontval
#6. Save this file as /usr/local/bin/fontval and do `chmod gou+x /usr/local/bin/fontval`
# 
# RUN
# Run this as fontval myfont1.ttf myfont2.ttf...
for p in "$@"
do
  echo "Validating $p..."
  # This runs FontValidator.exe via mono and outputs the XML report into the same folder as the font
  mono "$FVALDIR/FontValidator.exe" -file "$p" -quiet -report-in-font-dir
  # This converts the XML report into HTML and opens it, removing the XML report
  xsltproc --output "$p.fval.html" "$FVALDIR/fval.xsl" "$p.report.xml"
  rm "$p.report.xml"
  open "$p.fval.html"
done

continuing/dropping dotnet 2 support?

SharpFont ( https://github.com/HinTak/SharpFont ) v4.0.0 started depending on net 3.5+ Linq . IronPython did the same with 2.7 . Mono 4.4 also starts to drop support below dotnet 4.5 .

I have stayed with mono 4.2 for building FontVal 2.0 for that reason.

My current master at mine has a patched SharpFont 3.x , and my hybrid+empy.2016-05-06 has IronPython 2.6, to stay dotnet 2.x compatible.

Currently the incentive to break dotnet 2.x support is not strong - you'll still need to patch SharpFont v4.0 to use it with FontVal anyway, so it is just from patching version x to patching version y. It would be more persuasive if all 3 of the issues form my 4 SharrpFont patches are incorporated upstream:

Robmaister/SharpFont#82
Robmaister/SharpFont#87
Robmaister/SharpFont#88

Theming support for non-window look-and-feel

The embedded XML report viewer started to work correctly a few days ago on linux with a webkit GTK backend:
http://htl10.users.sourceforge.net/FontVal-Linux-xml-tiled.png
as one can see the 4 embedded report windows still have the default windows title-bar look, despite the rest - the left panel, menus etc - having the linux desktop look.

I am reminded in the #20 discussion with @twardoch and @schriftgestalt that there should be generic desktop theming support to configure any dotnet applications to adopt a different look and feel from the default one.

So, somebody can please look into that.

BTW, there is no XML-viewer related code change in FontVal - the linux gtk support comes from fixing problems upstream in mono, for which I am issuing a code pull ( mono/mono-webbrowser#1 ).

Switch Rasterisation test on by default in the command line tool.

Now we have two releases, 2.0 and 2.1, with 2.1 superseding 1.0's functionality, the command line tool should have rasterisation tests switched on by default.

It is just a one liner change possibly, and also making sure there is a switch for turning it off manually also. (i think the latter is already the case)

NULL offsets to anchor tables in GPOS lookups

Discussion on opentype list 26th April 2016:

Sasha Brawer pointed out that the AFDKO makeotf program is inconsistent in how it builds MarkToBase and MarkToLigature GPOS lookups. For MarkToBase and MarkToMark records, makeotf writes a default anchor (x= y = 0) when a mark class is defined in the lookup, but no anchor for that mark class is specified in the feature file rule.   However, for MarkToLigature GPOS lookups, makeotf writes a NULL anchor (aka offset = 0) when a mark class is defined in the lookup, but no anchor for that mark class is specified in the feature file rule.

It makes sense to me that makeotf should write a NULL anchor offset rather than a default anchor entry for the MarkToBase and MarkToMark lookups. However, I see that the OpenType spec explicitly says the an anchor table offset may be NULL for MarkToLigature and Cursive lookups, but does not say this for MarkToBase and MarkToMark lookups. I would like to think that this is an oversight, but before changing the makeotf behavior, I’d like to confirm what others have supported for these cases. Comments?
As I remember it, in the early days of OTL I made mark-to-base lookups with Null offsets if a base did not need an anchor for all mark classes. It worked fine. But at some stage I received message from Microsoft that this was no longer allowed and all bases must have an anchor for all classes. Since then I have been making separate lookups for separate mark classes. If you do not mind me saying, that is preferable over adding additional anchors at the origin… If you have a base which does not need an anchor for a mark at all, then the origin is a particular bad place to have the anchor.

I had a quick look at
https://github.com/Microsoft/Font-Validator/blob/master/OTFontFileVal/val_GPOS.cs
and did not see any obvious check in this direction, but probably it should.

Mono 5, Roslyn and msbuild

Mono 5 was out on 10 May 2017. It comes with Roslyn ( newly opened c# compiler code from Microsoft), msbuild ( the newly opened microsoft build system, for which mono's xbuild is supposed to imitate). Both are meant to be good for minimizing mono vs dotnet differences. Also mono 5 supports win64. Should migrate to it eventually.

Note also that apparently mono 5 does not run iron python correctly currently, so this is definitely one of those "would be nice eventually" task and shouldn't be attempted without a withdrawal plan.

Mac OS X webkit bridge for the XML viewer

I tried two postings to gtk-devel-list end of june (22nd and 24nd) and got moderated, it seem they did not (yet) make it into the list archive.

I have been staring at this particular section of code for a few days, and seem to be having problem with it:

-----
https://github.com/GNOME/gtk/commit/f3a6fecb671a2aec691940c9e1b74c7f11e15930

Try setting the default font, might need to tweak this.

2008-05-26  Richard Hult  <[email protected]>

    * gdk/quartz/gdkevents-quartz.c: (gdk_screen_get_setting): Try
    setting the default font, might need to tweak this.

svn path=/trunk/; revision=20181
-----

What I have is this error and this stack dump - which seems to come from "name = [[NSFont systemFontOfSize:0] familyName];" -
although the message is somewhat different, but there is only one thing in gdk_screen_get_setting which does fonts, so that must be it -
I think __NSGetMetaFontInstance is some sort of backend code to "[[NSFont systemFontOfSize:0] familyName]".

-[__NSCFType symbolicTraits]: unrecognized selector sent to instance 0x7c9a7000

---


        0   CoreFoundation                      0x9569c471 __raiseError + 193
        1   libobjc.A.dylib                     0x92ad6091 objc_exception_throw + 162
        2   CoreFoundation                      0x956a0cb3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
        3   CoreFoundation                      0x955ec522 ___forwarding___ + 1010
        4   CoreFoundation                      0x955ec10e _CF_forwarding_prep_0 + 14
        5   AppKit                              0x90dfee7e -[__NSFontTypefaceInfo _postscriptName] + 331
        6   AppKit                              0x90dfe86e +[__NSFontTypefaceInfo typefaceInfoForPostscriptName:] + 914
        7   AppKit                              0x90dfddf5 __NSGetMetaFontInstance + 592
        8   libgdk-quartz-2.0.0.dylib           0x0732befa gdk_screen_get_setting + 474
        9   libgtk-quartz-2.0.0.dylib           0x08ac31d6 gtk_settings_get_property + 438
        10  libgobject-2.0.0.dylib              0x0782af08 object_get_property + 248
        11  libgobject-2.0.0.dylib              0x0782ab02 g_object_get_valist + 658
        12  libgobject-2.0.0.dylib              0x0782b115 g_object_get + 245
        13  libgtk-quartz-2.0.0.dylib           0x08a7894a gtk_rc_context_get + 314
        14  libgtk-quartz-2.0.0.dylib           0x08a78e9d gtk_rc_reparse_all_for_settings + 285
        15  libgtk-quartz-2.0.0.dylib           0x08abad27 gtk_settings_get_for_screen + 423
        16  libgtk-quartz-2.0.0.dylib           0x08abafb6 gtk_settings_get_default + 38
        17  libgtk-quartz-2.0.0.dylib           0x08ada27b gtk_style_init + 27
        18  libgobject-2.0.0.dylib              0x07847f3e g_type_create_instance + 558
        19  libgobject-2.0.0.dylib              0x07829c44 g_object_constructor + 36
        20  libgobject-2.0.0.dylib              0x07828fc2 g_object_newv + 354
        21  libgobject-2.0.0.dylib              0x07828e1d g_object_new + 157
        22  libgtk-quartz-2.0.0.dylib           0x08ada993 gtk_style_new + 35
        23  libgtk-quartz-2.0.0.dylib           0x08c144f4 gtk_widget_get_default_style + 36
        24  libgtk-quartz-2.0.0.dylib           0x08c06b5e gtk_widget_init + 478
        25  libgobject-2.0.0.dylib              0x07847ed9 g_type_create_instance + 457
        26  libgobject-2.0.0.dylib              0x07829c44 g_object_constructor + 36
        27  libgobject-2.0.0.dylib              0x078293af g_object_newv + 1359
        28  libglibsharpglue-2.so               0x07588e64 gtksharp_object_newv + 228

---

FWIW, I am trying to embed a gtk scrolledwindow inside a carbon application. The gtk scrolledwindow in turn, has another foreign Cocoa widget inside.

I mainly have two questions:

- I think the error I am seeing is that a "strange" non-Cocoa window doesn't let me get at Cocoa's default NS system fonts. I am tempted to reverse that patch (and hard-coding a particular font name) to see if I am right. Is there any caveate for trying to do that, or is there a better way of improving this change? or is there any way I can give my widget more of a Cocoa attributes/properties to make it happen? The problem is that the error is happening at gtk_widget_init, and I am at a loss at how I can insert anything "earlier" than the constructor.

- supposedly setting "gtk-font-name" should bypass that code - but I ran dtruss against my app and it never tried to read ~/.gtkrc-20, any of the rc files in the gtk directory, etc. Is that a known quirk of gtk/quartz ? That it ignores ~/.gtkrc, GTK2_RC_FILES and friends? I don't think that's always the case since Monodevelop and Banshee both ships some sort of theming rc's. But it just seem that gtk_widget_init then gtk_style_init, never read those files, for some reason? this behavior seems to be poorly documented.
(you can probably tell from that gtksharp_object_newv I am using gtksharp).
Just a partial answer to my own 2nd question - Monodevelop's main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs
contains this cryptic comment:

//HACK: we must initilize some Gtk rc before Gtk.Application is initialized on Mac/Windows
//      otherwise it will not be loaded correctly and theme switching won't work.

This suggests that it is known not to work by some of the Xamarin folks... I don't know whether it is gtk/quartz or gtk-sharp, but that at least suggests some workaround is needed.

gtk3-based GUI, and anticipating built-in XML viewer breakage.

Fedora is dropping webkit1 in about a year's time:

https://bugzilla.redhat.com/show_bug.cgi?id=1375784

The impact to FontVal is largely just through the built-in XML viewer. It is webkit1 + gtk2 . The gtk2 dependency is also enforced by mono's winform (i.e. windows-like GUI) implementation. Since there is no webkit2 + gtk2 binding, and not likely (webkit2 seems to be very much gtk3 only), in about a year from now, all the work in making the XML viewer work on linux would be un-done :-(.

This situation is somewhat similar/related to
#20
#29

Having a GTK3-based GUI would also ease integration of Mac OS X's webkit framework.

FontVal -based DSIG signing tool

This is just notes for people who want to do it.

The built-in python interpreter in FontVal 2.0 and the ttc splitter/joiner script demonstrates that the font-writing APIs also works. So it is conceptually a somewhat small matter from verifying a signature to signing (i.e. writing a new font).

Also, mono already has authenticode executable signing APIs.

The two main issues with signing fonts - beyond signing executable - are mainly related to time-stamping:

  • incomplete Mono security related APIs - https://bugzilla.xamarin.com/show_bug.cgi?id=36295
    "Bug 36295 - missing attributes in System.Security.Cryptography.Pkcs.SignedCms.Decode()"
  • internet access APIs (presumably IE related) to contact time-stamping server.

See also current limitations of the verification:
HinTak#4

and related issue:
fonttools/fonttools#306
Sign fonts (make valid DSIG tables) #306

opentype 1.8 features.

discussion, etc place holder for features introduced with opentype 1.8, i.e. beyond those in 2015/1.7:
#8

copy readme.txt to readme.md

Right now all the instructions are in the readme.txt, with almost nothing in the readme.md, even though github will show the readme.md as the authoritative readme documentation. It's worth either copying the contents of readme.txt to readme.md, or rename the .txt version to .md, so that instructions are immediately visible.

[Regression] A1112 Exception on glyf test with Microsoft shipped fonts, regression.

mingliub.ttc, win 8.1.

In FontVal 1.1 and 2.0: Glyph index 17007 Test: ValidateSimpContMisor
this does not have a equivalent in FontVal 1.0.

FontVal 1.0 have
Glyph index 38020 Test: ValidateSimpContMisor

This may or may not be related.

Many A1112 exceptions in FontVal 1.0 are gone with 1.1/2.0; but this one is new, and worrying.

Found while checking for the A1112 exceptions in FontVal 1.0 , and I only re-tested the 10 files which triggers A1112.

Unfortunately, with this regression, I'll have to retest the rest of the 260+ files against FontVal 2.0. Majorly unhappy.

Some feedbacks from Paul Wise

Feedback from @pabs3 via e-mail, just the technical part:

A -files option for FontValidator.exe would be nice so you don't have
to type -file over and over again, it should interpret the rest of the
command-line as individual files to check.

A -quiet option for FontValidator.exe that would disable the progress
information and only print errors/warnings to stdout.

An option for FontValidator.exe to print a human-readable report to
stdout instead of printing an XML report to a temporary file.

Please add per-file copyright information:

http://lu.is/blog/2012/03/17/on-the-importance-of-per-file-license-information/

Please remove or decompile Windows-specific binary files like these:

OTFontFileVal/OTFontFileVal.ValStrings.resources
Glyph/NS_Glyph.GErrStrings.resources
FontVal/FontVal.ResultsForm.resources
FontVal/FontVal.FormTransform.resources
FontVal/FontVal.FormReportOptions.resources
FontVal/FontVal.FormAbout.resources
FontVal/FontVal.Form1.resources

Please remove auto-generated files and build them in the Makefile:

*.cd (I think?)
bin/FontValidatorHelp.chm

A new app icon would be nice, the current one is pretty ugly and
doesn't have a glyph in it to indicate it is about fonts.

Please use split-out PNG icons as the base for the icons and create the
.ico files at build time. ICO is a Windows-specific format.

Please add a .gitignore file:

/bin/
/GenerateFValData/bin/
*.chm
*.resources
*.ico
*.cd

README-extra.txt should be renamed to TODO or similar and the TODO
items from README.txt moved there.

These files are duplicates but they got out of sync:

FontVal/fval.xsl
bin/fval.xsl

There are some warnings from mono:

Table_EBLC.cs(1217,39): warning CS0219: The variable `ic' is assigned but its value is never used
Table_OS2.cs(943,28): warning CS0219: The variable `fourByte' is assigned but its value is never used
TAble_Zapf.cs(340,18): warning CS0414: The private field `OTFontFile.Table_Zapf.FeatureInfo.m_offsetFeatureInfo' is assigned but its value is never used
TAble_Zapf.cs(341,23): warning CS0414: The private field `OTFontFile.Table_Zapf.FeatureInfo.m_bufTable' is assigned but its value is never used
DICondBuilder.cs(39,47): warning CS0219: The variable `infoPars' is assigned but its value is never used
Glyph.cs(1093,36): warning CS0219: The variable `linters' is assigned but its value is never used
Glyph.cs(1251,17): warning CS0219: The variable `ind' is assigned but its value is never used
ValDriver.cs(269,20): warning CS0219: The variable `sTable' is assigned but its value is never used
val_VDMX.cs(133,32): warning CS0219: The variable `ratio' is assigned but its value is never used
val_cmap.cs(645,32): warning CS0219: The variable `charbuf' is assigned but its value is never used
val_hhea.cs(394,28): warning CS0219: The variable `dItalicAngle' is assigned but its value is never used
val_post.cs(374,29): warning CS0219: The variable `buf' is assigned but its value is never used
FormReportOptions.cs(232,32): warning CS0168: The variable `what' is declared but never used
Program.cs(147,36): warning CS0168: The variable `e' is declared but never used
ResultsForm.cs(69,37): warning CS0219: The variable `resources' is assigned but its value is never used
ResultsForm.cs(171,16): warning CS0649: Field `FontVal.ResultsForm.m_sFilename' is never assigned to, and will always have its default value `null'
ResultsForm.cs(172,14): warning CS0649: Field `FontVal.ResultsForm.m_bDeleteOnClose' is never assigned to, and will always have its default value `false'
CmdLineInterface.cs(19,31): warning CS0414: The private field `FontValidator.CmdLineInterface.m_bOpenReportFiles' is assigned but its value is never used
CmdLineInterface.cs(22,31): warning CS0414: The private field `FontValidator.CmdLineInterface.m_curOTFileVal' is assigned but its value is never used

There are some spelling errors:

$ codespell --quiet-level=3
./OTFontFile/Table_kern.cs:331: Cant  ==> Can't
./GenerateFValData/OurData.xml:8616: boundry  ==> boundary
./FontVal/FontVal.FormReportOptions.resx:367: IwTh  ==> with
./FontVal/FontVal.FormReportOptions.resx:377: IwTh  ==> with
./FontVal/FontVal.FormReportOptions.resx:486: IwTh  ==> with
./FontVal/FontVal.FormTransform.resx:367: IwTh  ==> with
./FontVal/FontVal.FormTransform.resx:377: IwTh  ==> with
./FontVal/FontVal.FormTransform.resx:486: IwTh  ==> with
./GMath/Equation.cs:120: asign  ==> assign
./GMath/Equation.cs:359: asign  ==> assign
./OTFontFileVal/val_cmap.cs:413: cant  ==> can't
./OTFontFileVal/val_cmap.cs:418: cant  ==> can't
./OTFontFileVal/val_glyf.cs:120: AUXILLIARY  ==> AUXILIARY
./Compat/Compat.cs:67: seperately  ==> separately

$ find -type d \( -iname .bzr -o -iname .git -o -iname .hg -o -iname .svn -o -iname CVS -o -iname RCS -o -iname SCCS -o -iname _MTN -o -iname _darcs -o -iname .pc -o -iname .cabal-sandb
ox -o -iname .cdv -o -iname .metadata -o -iname CMakeFiles -o -iname _build -o -iname _sgbak -o -iname autom4te.cache -o -iname blib -o -iname cover_db -o -iname node_modules -o -iname 
'~.dep' -o -iname '~.dot' -o -iname '~.nib' -o -iname '~.plst' \) -prune -o -type f ! \( -iname '*.bak' -o -iname '*.swp' -o -iname '#.*' -o -iname '#*#' -o -iname 'core.*' -o -iname '*
~' -o -iname '*.gif' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.min.js' -o -iname '*.js.map' -o -iname '*.js.min' -o -iname '*.min.css' -o -iname '*.css.map' -o
 -iname '*.css.min' \) -exec spellintian --picky {} +
./OTFontFile/Table_name.cs: english -> English
./OTFontFile/Table_kern.cs: suppported -> supported
./GenerateFValData/OurData.xml: boundry -> boundary
./GMath/Contour.cs: Returnes -> Returns
./Glyph/FManager.cs: shoud -> should
./OTFontFileVal/val_name.cs: english -> English
./OTFontFileVal/val_glyf.cs: AUXILLIARY -> AUXILIARY
./OTFontFileVal/val_OS2.cs: latin -> Latin
./Compat/Compat.cs: seperately -> separately

There are some duplicate files:

$ fdupes -q -r .
./FontVal/Btn2.ico
./FontVal/Btn4.ico

./GenerateFValData/toc-error-postamble.txt
./GenerateFValData/toc-warning-postamble.txt
./GenerateFValData/toc-info-postamble.txt

./OTFontFile/AssemblyInfo.cs
./GenerateFValData/Properties/AssemblyInfo.cs
./ValCommon/AssemblyInfo.cs
./GMath/AssemblyInfo.cs
./Glyph/AssemblyInfo.cs
./OTFontFileVal/AssemblyInfo.cs

./OTFontFile/ClassDiagram2.cd
./OTFontFile/ClassDiagram1.cd
./OTFontFileVal/ClassDiagram2.cd

Check if these can be switched to https://

$ grep -rF http: .
<lots>

There are a lot more TODO items:

$ grep -riE 'fixme|todo|hack|xxx|broken' .
<lots>

and part of my response, edited:

There are many binary blobs in the repo at the moment because they are difficult to make, or requires windows-only tools to do so; the resources files are one (mono's resgen is buggy), CHM is another (requires MS HTML Help compiler).

There is a -quiet option to FontValidator - it does not do what you do. I think you want a '-stdout' option, where report is write to stdout instead of to a xml file? I have been thinking about that too.

Argh, I see you are looking at upstream, possibly, about bin/fval, FontVal/fval out of sync? That's my issue about Microsoft not reviewing that change and asked me to...

temp file name collision for bulk test of a few hundred files.

MS dotnet's temp file name generation turns out to be limited to 65535. (mono's better doing 1<<28 -1 , or 268M, from how the file name looks, with 7 hex digits).

This may sound quite high, until you think about the probability of collision of N files is
1 - ( 65535 / 65535 ) ( 65534 / 65535 ) .... (( 65535 - N +1) / 65535 )) =
which is about 1/2 for about 256 files. So even for an as shipped configuration of say, win 8 with 276 files I have, is already worse than half-half.

This is how some of the test files disappeared when I tested about 4000 files
( HinTak#5 (comment) ) although 117 is still too high. Likely about 1/2 of that is due to this bug.

I have a fix to not overwrite files -

HinTak@2946ee1

with the fix it should be able to fully use 65535.

but it may be a good idea to re-think this, say, append the date to the file name, to make it possible to avoid collision beyond 65525, to be able to test more that 64k font files in one go.

Merge embedded-python branch into master.

It was on a branch mainly because it requires latest ironpython requires at least dotnet 3.5 or 4.x. However, in my private branch, it is already shown that the older ironpython 2.6.2 can work wor within pure dotnet 2.0, so there is no need to keep the embedded-python code on a separate branch.

OS/2: "The version number is valid, but less than 5" [W2106]

I'd recommend to downgrade this warning message to informative status.
I think it's perfectly fine to have OS/2 table version less than the current one (version 5), as long as one does not attempt to use any of the flags which are only defined in subsequent versions of the table.

EBDT related performance issues

The broken font bundle recently posted to freetype-devel is fascinating. FontVal wasn't written in the era when large CJK fonts with 50,000 glyphs and half of 15MB file size being bitmap was common. 15/26 exposed a problem where FontVal tries to allocate 11GB/6GB of memory to analyse the EBDT. This sort of change below (sorry about the additional debug-related stuff, against the public code, but you see the picture) get around the memory problem:

--- a/OTFontFileVal/val_EBDT.cs
+++ b/OTFontFileVal/val_EBDT.cs
@@ -135,7 +135,7 @@ namespace OTFontFileVal

                     Table_EBLC.indexSubTableArray[] ista = null;
                     try {
-                        ista = EBLCTable.GetIndexSubTableArray(bst);
+                        //ista = EBLCTable.GetIndexSubTableArray(bst);
                     } catch ( Exception e )
                     {
                         Console.WriteLine(" EBDT " + sSize + " " + e.Message + e.StackTrace);
@@ -143,14 +143,15 @@ namespace OTFontFileVal
                         return false;
                     }

-                    if (ista != null)
+                    if ( true /*ista != null*/)
                     {
                         for (uint j=0; j < bst.numberOfIndexSubTables; j++)
                         {
                             Table_EBLC.indexSubTable ist = null;
-                            if (ista[j] != null)
+                            Table_EBLC.indexSubTableArray ista_j = EBLCTable.GetIndexSubTableArray(bst, j);
+                            if (ista_j != null)
                             {
-                                 ist = bst.GetIndexSubTable(ista[j]);
+                                 ist = bst.GetIndexSubTable(ista_j);
                             }

                             if (ist != null)

After this sort of change, 15 still took 10 hours to run - and I am not even sure this is a correct change.

So there is a time spent and a memory issue somewhere.

OTOH, since EBDT is a glyph-devel check, maybe it is supposed to take this long, only that fonts with large bitmap tables are rare, so some of the speed so far tends to be in rasterisation or glyf.

A1112 exceptions with some proprietary fonts

It takes nearly 8 complete days to run the glyf test on my private stash of old cjk fonts. (and lost the run three times, so lost about 10 days of works I think, in the middle... so it took nearly 3 weeks). The fonts which shows A1112 exceptions are:

avbyv.ttf
avfv.ttf
avmbv.ttf
avmyv.ttf
avsbv.ttf
avssbv.ttf
avsv.ttf
bhei00b.ttf
bhei00l.ttf
bhei01b.ttf
bhei01l.ttf
bshei01b.ttf
bsmi00lp.ttf
dcinl5.ttc
dffn_3.ttc
dffn_j5.ttc
dffrs3.ttc
dfkaie.ttc
dfttlx3.ttc
dwfszk.ttf
dwktzk.ttf
dwstzk.ttf
gbsn00l.ttf
ggtr00l.ttf
glei00m.ttf
gsin00m.ttf
gsun00l.ttf
gtr00bp.ttf
gtr00lp.ttf
gtr00mp.ttf
htst3.ttf
jdfkanting.ttf
jdfxingshu.ttf
jdfzhongb.ttf
jdjhte.ttf
jdjlibian.ttf
jdjste.ttf
jdjxinshu.ttf
jdjychao.ttf
jdtuan.ttf
kochi-mincho-subst.ttf
min08mp.ttf
sgtr00b.ttf
simsunb.ttf
ska00bp.ttf
ssin00m.ttf
ssun00l.ttf
sun00mp.ttf
swei00b.ttf
tgtr00l.ttf
toor00u.ttf
tovr00u.ttf
tsin00m.ttf
wdr.ttf
wei.ttf
wf2.ttf
wf3.ttf
wf4.ttf
wh1.ttf
wh4.ttf
wh5.ttf
wh6.ttf
wk2.ttf
wk3.ttf
wktv.ttf
wl1.ttf
wodr.ttf
wov.ttf
wpop1.ttf
wr1.ttf
wr2.ttf
wr3.ttf
wr5.ttf
ws1.ttf
ws2.ttf
ws3.ttf
wsf.ttf
yka00hp.ttf
简启体.ttf
繁启体.ttf

and covers almost all of the glyf test error codes:

    347 A1112
    262 E1100
     72 E1102
2116848 E1110
 596493 E1111
2405587 E1112
    112 E1113
      1 E1114
      4 E1115
      3 E1117
   1497 E1119
    509 E1120
     60 E1123
 700263 I1111
    438 W1100
 445094 W1110
2231479 W1111
3336672 W1112
    280 W1113

what is interesting is that there is one more sub-type:

ValidateCompComponentInters Exception: Exception GMath: class: Bez2D method: ParamFromSupport details: NOT IMPLEMENTED  at NS_Glyph.Glyph.CallGV (TypeGV typeGV) 
ValidateSimpContInters Exception: Exception GMath: class: Bez2D method: ParamFromSupport details: NOT IMPLEMENTED  at NS_Glyph.Glyph.CallGV (TypeGV typeGV) 
ValidateSimpContInters Exception: Exception GMath: class: Equation method: RootsAll details: Degree 3  at NS_Glyph.Glyph.CallGV (TypeGV typeGV) 
ValidateSimpContMisor Exception: Exception Glyph: class: Glyph method: ValidateSimpContMisor  at NS_Glyph.Glyph.CallGV (TypeGV typeGV) 

Identify minimum version of MS csc to build.

It is somewhat related to
"re-implementing a MS Visual Studio/C# (express?) based build system. "
( HinTak#8 ) but different.

I tried compiling part of the Compat module with csc from dotnet 2.0 dev kit and found that I had using C# 5.0(?) syntax which wasn't supported by the older compiler. Note that it is possible to compile with a new compiler for old run-time, so this isn't critical.

help/documentation for 21 of the 25 glyf Table errors were not released.

I am preparing my talk next week on the Font Validator and includes a section about rendering, the glyf table test and rasterization test in particular, and try to make sure that I understand everything.

$ grep -E '(A|E|P|W|I)11' GenerateFValData/OurData.xml
helpID="E1100"
helpID="E1101"
helpID="E1102"
helpID="W1100"

$ grep -A 1 GERR_ Glyph/NS_Glyph.GErrStrings.resx | grep value
E1110: Misoriented contour
E1111: Intersecting contours
E1112: Bounding box is incorrect
E1113: Invalid glyph index of component
E1114: Invalid index of knot in composite glyph
E1115: Failure to load the component
E1116: Component transform matrix is degenerated
E1117: Shift of component either undefined or ambigously defined
E1118: Circular dependency of composite glyph's components
E1119: Wrapped contour(s)
E1120: Duplicated contours
E1121: Duplicated components of composite glyph
W1110: Intersecting components of composite glyph
W1111: Duplicated knots
W1113: Degenerated contour(s)
A1110: Application error
A1111: Unable to perform test due to previously detected errors
A1112: Test aborted
A1113: Test failed because of unhandeled exception
E1123: An empty component of the composite glyph
W1112: Not all extremes are marked with the on-curve control points

The glyf table test currently checks for 25 kind of errors, but only 4 of them are in the released documentation.

I consulted the 2003 binary's bundled chm and the private 2009's chm, and the 21 errors are documented there.

There are also a lot of figures for those 21 errors describing them.

I can recover the figures and the texts for the description of those 21 errrors from the chm's, but I'd prefer to have the source of them.

Re-split into dotnet2/dotnet4 dev

As in the last issue, the older distinction between the embedded-python branch and my master was based on dotnet2 compatibility. Since it is possible to compile and run the embedded-python code in dotnet2 with and older ironpython, I think the dotnet2/dotnet4 split can be re-thought after the embedded-python merger.

build instructions

The readme file mentions Linux and MacOS several times. Is it actually possible to build for this platforms? If so, how? I can build a windows .exe (after I installed mono. A link to the mono installer should be somewhere in the readme).

The instructions say:

To build with mono instead of Microsoft C# simply run:

But how to build with Microsoft C#. For someone not familiar with the windows dev tools this is not enough information.

detect invalid chars in FontName and FontVersion

A few font files I have contains strange things in FontName and FontVersion. This causes problems downstream with XML processing. There should be new error codes for these, and they should be sanitized at the report.

    5472 parser error : xmlParseCharRef: invalid xmlChar value 0
      4 parser error : xmlParseCharRef: invalid xmlChar value 16
      2 parser error : xmlParseCharRef: invalid xmlChar value 65535

some "http://go.microsoft.com/fwlink?LinkID=*" urls in CHM not valid any more.

Was looking up what W2105 means, and it is supposedly linked to "PANOSE specification".

The URL underneath is 'http://go.microsoft.com/fwlink?LinkID=10403', which in turns get redirected to "http://www.panose.com/hardware/pan2.asp" , which get redirected to "http://www.monotype.com/services/pan1/hardware/pan2.asp" , which returns Error 404.

W2104 references 'OS/2 table specification", which is "http://go.microsoft.com/fwlink?LinkID=10378", which is redirected to "http://www.microsoft.com/typography/otspec/os2.htm#acw" which isn't too bad.

So all those "http://go.microsoft.com/fwlink?LinkID=*" urls need checking; some of them may be redirected to some place which is no longer valid.

instructions don't list required tooling

Trying to run make generates the following error:

C:\Users\Pomax\Git\Font-Validator> make
mkdir -p bin
for target in Compat OTFontFile Compat.2nd ValCommon GMath Glyph OTFontFileVal;
do \
            make bin/${target}.dll ; \
        done
make[1]: Entering directory '/cygdrive/c/users/mike/documents/Git projects/collaborations/Font-Validator'
( cd Compat     && \
        mcs -debug- -optimize+ -target:library  -lib:../bin/ -r:SharpFont -r:System.Windows.Forms -out:../bin/Compat.dll *.cs )
/bin/sh: line 1: mcs: command not found

Can the readme be extended with the set of tools that are used during the make run, so that people can check whether they have all the prerequisites in place? Some googling reveals that mcs is the Mono c# compiler, something which I'm sure lots of people won't be familiar with =)

CHM, and -stdout option

Two more items from e-mail exchanges with @pabs3 .

Migrating away from docs as CHM, and depending on Microsoft HTML Workkshop for rebuilding the CHM:

There is a CHM generator on Linux in Free Pascal but I think on Linux
it would be far better to just use plain HTML.

http://wiki.lazarus.freepascal.org/chm

I had a quick look, the solution (requiring contributing developers installing a rarely used obscure compiler) seems worse than the current problem (400k of binary blob). Anyway, capture here for somebody else or my future self to look further.

A -stdout option is definitely needed, but the report written there
should be human readable, not XML.

That has been in my mind for a while, and architecturally, can be hooked up with the default (xml to temp location) with a new xslt transform to convert to txt, then put that to stdout. This gives a text output at end of run, but rather simple to do. OTOH, giving stdout as the tool runs requires a bit more structural change to the whole thing.

False positive "The usLastCharIndex is not valid" [E2131]

Environments:

  • Windows 10
  • Font Validator 1.0.1286.23890
  • Meiryo 6.10 6.20 (C:\Windows\Fonts\MEIRYO.ttc)

I am getting a false positive error about usLastCharIndex in OS/2 table:

E2131   The usLastCharIndex is not valid    actual = 0xffff, calculated = 0xffee

Meiryo has some "supplementary characters", so 0xffff should be valid.

The maximum Unicode index (character code) in this font, according to the cmap subtable for platform ID 3 and encoding ID 0 or 1. This value depends on which character sets the font supports. This field cannot represent supplementary character values (codepoints greater than 0xFFFF). Fonts that support supplementary characters should set the value in this field to 0xFFFF.

https://www.microsoft.com/typography/otspec/os2.htm#lci

This is an old bug, but @HinTak's FontVal 2.0.0 also has the same issue.

usage target profiles, implementing with the embedded python interpreter.

@davelab6 @anthrotype @aaronbell @schriftgestalt @khaledhosny - the "expert mode" of loading a python script to set rasterization test parameters in the embedded ipython branch (
https://github.com/HinTak/Font-Validator/blob/embedding-ironpython/bin/scripting-examples/rast_parameters.py ) is pretty cool - it not only sets all the rarely-needed-to-change rasterization test parameters, but you can set the OT tables to test/skip via this script too - near the top line 25 - 31 - so the script probably should be called "test-parms.py" instead, and the upcoming option '-test-parms' instead of '-rp-parms' to match.

Loading python scripts to manipulate internal C# objects this way - with the ttc splitter/merger, etc - opens another possibility: you can possibly manipulate the full list of tests (212 of them now, and still counting), knock selected ones out, change the status of warnings <-> infos <-> errors, and maybe even more. The GUI only offers per table on/off's, but I am fairly sure that it is possible to knock selected tests out this way. The extra scripting ability may be enough to allow you to implement usage target profiles, like switching off warnings for missing DSIG/non-essential-tables for web font target usage, etc.

The list of Warning's/Error's/Info's/Pass'es and list of tests (line 887 onwards -1100) are in https://github.com/HinTak/Font-Validator/blob/embedding-ironpython/OTFontFileVal/atoms.cs , if you want to see how good your python-fu is.

You may want to read the test dispatcher code:
https://github.com/HinTak/Font-Validator/blob/embedding-ironpython/OTFontFileVal/Validator.cs
and the output messaging code:
https://github.com/HinTak/Font-Validator/blob/embedding-ironpython/OTFontFileVal/ValidationInfo.cs
for ideas.

Good Luck.

bit 11 of the `flags' field in the `head' table and DSIG

Off the opentype list discussion:

Even some
original MS fonts like `symbol.ttf' (e.g., version 5.00)
have this bit set...

The signing tool should abort or should unset that bit before signing, I think? A valid signature + bit 11 set isn't quite compatible. I have that particular version of that font, and the signature is valid.

Something additional needs to be done/ignored - check and recommend resigning, or check and ignore invalid signature, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.