You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/posts/GSoC_2021_PreQuarter/index.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ resources:
16
16
17
17
**“<ins>Well? Did you get it working?!</ins>”**
18
18
19
-
Before I answer that question, if you're missing the context, check out my previous blog's last few lines.. promise it won't take you more than 30 seconds to get the whole problem!
19
+
Before I answer that question, if you're missing the context, check out my [previous blog](https://matplotlib.org/matplotblog/posts/gsoc_2021_midterm/)'s last few lines.. promise it won't take you more than 30 seconds to get the whole problem!
20
20
21
21
With this short writeup, I intend to talk about _what_ we did and _why_ we did, what we did. XD
22
22
23
23
## Ostrich Algorithm
24
24
Ring any bells? Remember OS (Operating Systems)? It's one of the core CS subjects which I bunked then and regret now. (╥﹏╥)
25
25
26
26
The [wikipedia page](https://en.wikipedia.org/wiki/Ostrich_algorithm) has a 2-liner explaination if you have no idea what's an Ostrich Algorithm.. but I know most of y'all won't bother clicking it XD, so here goes:
27
-
> Ostrich algorithm is a strategy of ignoring potential problems by "sticking one's head in the sand and pretend there is no problem"
27
+
> Ostrich algorithm is a strategy of ignoring potential problems by "sticking one's head in the sand and pretending there is no problem"
28
28
29
29
An important thing to note: it is used when it is more **cost-effective** to _allow the problem to occur than to attempt its prevention_.
30
30
@@ -34,16 +34,16 @@ As you might've guessed by now, we ultimately ended up with the *not-so-clean* A
The first approach created corrupted outputs, however the second approach worked fine. A point to note here would be that*Method 1* is better in terms of separation of *reading* the file from *parsing* the data.
40
+
The first approach created corrupted outputs, however the second approach worked fine. A point to note here would be that*Method 1* is better in terms of separation of *reading* the file from *parsing* the data.
41
41
42
-
1.`library1` is [fontTools](https://github.com/fonttools/fonttools), whereas `library2` is [ttconv](https://github.com/matplotlib/matplotlib/tree/master/extern/ttconv).
43
-
2.`library2_with_buffer` is <ins>ttconv</ins>, but modified to input a file buffer instead of a file-path
42
+
1.[fontTools](https://github.com/fonttools/fonttools) handles the Type42 subsetting for us, whereas [ttconv](https://github.com/matplotlib/matplotlib/tree/master/extern/ttconv) handles the embedding.
43
+
2.`ttconv_with_buffer` is a modification to the original `ttconv_with_file`; that allows it to input a file buffer instead of a file-path
44
44
45
45
You might be tempted to say:
46
-
> "Well, `library2_with_buffer` must be wrongly modified, duh."
46
+
> "Well, `ttconv_with_buffer` must be wrongly modified, duh."
47
47
48
48
Logically, yes. `ttconv` was designed to work with a file-path and not a file-object (buffer), and modifying a codebase **written in 1998** turned out to be a larger pain than we anticipated.
49
49
#### It came to a point where one of my mentors decided to implement everything in Python!
@@ -87,6 +87,6 @@ We still need to migrate the library's internal implementation from **font-first
0 commit comments