Comments (7)
thanks @mashabow
honestly, I am not sure how to fix this, or even whether it actually is something that needs to be fixed.
Maybe the following comment provides some clue as to how compreffor deals with such local subroutines called from global ones:
# assert this is a local or global only used by one FD
https://github.com/googlei18n/compreffor/blob/932a60b/src/python/compreffor/pyCompressor.py#L901
I'm hoping @behdad could have a look at this when he has some spare time.
@mashabow, you are welcome to send a pull request, of course.
from compreffor.
honestly, I am not sure how to fix this, or even whether it actually is something that needs to be fixed.
I am not sure whether it should be fixed, too. As @miguelsousa says, it doesn't seem this restriction has been documented. In addition, such fonts work fine in major applications as far as I checked.
from compreffor.
Should be possible to not generate those. Though, someone who understand the code well needs to go in and do that surgery.
from compreffor.
This block seems to put each candidate subroutine in global or local subroutines. So if we really want to avoid such "invalid" global ones, we have to check whether a candidate subr
contains callsubr
operator before calling Compreffor.insert_by_usage(subr, gsubrs)
.
from compreffor.
Somewhere around that, yes.
from compreffor.
This block seems to put each candidate subroutine in global or local subroutines
If that block is to be trusted, looks like it only does that if there's only one FontDict. Is that consistent with what you are seeing? If yes, we can update subsetter to also do that. Makes sense to me.
from compreffor.
This block seems to put each candidate subroutine in global or local subroutines
If that block is to be trusted, looks like it only does that if there's only one FontDict.
No. It may insert into global subroutines, even if there are multiple FontDicts. This is a pseudocode for that block:
while candidate_subrs and (some lsubrs/gsubrs has space):
subr = candidtate_subrs.pop()
if subr is called from glyphs which are all in one FD:
if gsubrs has space:
if lsubrs has space:
insert subr into gsubrs or lsubrs, minimizing the cost
else:
insert subr into gsubrs
else lsubrs has space:
insert subr into lsubrs
else:
no room, give up inserting
else:
if gsubrs has space:
insert subr into gsubrs
else:
no room, give up inserting
from compreffor.
Related Issues (17)
- Desubroutinize if needed HOT 3
- build wheels for python3.7 HOT 1
- Segmentation fault
- --generate-cff option is broken
- Renaming default branch name from "master" to "main" HOT 1
- testPyCompressor.py fails on Python 3 HOT 2
- Fails to build with Cython 3 HOT 3
- enable auto deployment on tags to Github Releases HOT 3
- AttributeError: '_TTGlyphCFF' object has no attribute 'decompile' HOT 4
- Better C interface HOT 8
- Enable Appveyor CI for push and pull requests HOT 7
- Consider SEQUITUR(Nevill-Manning) or Re-pair compression algorithm HOT 1
- Failed to compress if len(FDArray) == 256
- Many warnings "Difference found in glyph" HOT 1
- --decompress does more than just desubroutinize HOT 1
- How to install? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compreffor.