xpqz / learnapl

Introduction to Dyalog APL: https://xpqz.github.io/learnapl
Other
126 stars 11 forks source link

Font issue (presumably again) #24

Closed Tortus-exe closed 2 years ago

Tortus-exe commented 2 years ago

Hi,

I'd like to start off with a huge thank you because this book is nigh exactly what I was looking for to learn APL: not overly descriptive so as to waste time describing what is meant by a nested array, but good for someone like me who has experience programming in multiple other languages.

Attached is a screenshot. I am running this on Safari on Mac OS:

スクリーンショット 2022-03-25 午後1 56 44

If you cannot see the image by some miracle of the internet, then just know that the font is not monospace; in fact it is very thin, making spacing go all over the place; it's not impossible but is indeed quite difficult to read and interpret matrices, especially as they get more complex.

I see this isn't the first time you've encountered this issue, and I really commend you for writing this book in the first place! Please do not hesitate to ask questions :)

gitonthescene commented 2 years ago

I can’t spot the difference but MDAPL seems to have solved this. Perhaps @rodrigogiraoserrao can spot the issue.

Comparing a sample from the source files of each they look very similar:

Learning APL

<div class="cell_output docutils container">
<div class="output text_html"><span style="white-space:pre; font-family: monospace">┌───────┬───────┬───────┬───────┐
│1 2 3 4│2 5 8 6│8 6 2 3│8 7 6 1│
└───────┴───────┴───────┴───────┘
</span></div></div>

MDAPL

<div class="cell_output docutils container">
<div class="output text_html"><span style="white-space:pre; font-family: monospace">┌───────┬────────┬─────┬─────┬───┬────┐
│January│February│March│April│May│June│
└───────┴────────┴─────┴─────┴───┴────┘
</span></div></div>

Perhaps the site just needs to be rebuilt??

It’s worth pointing out that the pdf download looks fine.

gitonthescene commented 2 years ago

FWIW, I checked that the custom.css between the two are essentially the same:

--- learningapl/custom.css  2022-02-14 00:35:12.000000000 +0900
+++ mdapl/custom.css    2022-04-07 10:21:29.000000000 +0900
@@ -22,3 +22,7 @@
 .table td p, .table th p {
     margin: 0;
 }
+
+.solution.admonition {
+    padding-bottom: 0 !important;
+}
$

The .ttf files appear to be different, though. I don't know if this is the issue or not.

Binary files mdapl/APL385.ttf and learningapl/APL385.ttf differ
$ file */APL385.ttf          
learningapl/APL385.ttf: HTML document text, Unicode text, UTF-8 text, with very long lines (17464)
mdapl/APL385.ttf:       TrueType Font data, 19 tables, 1st "EBDT", 22 names, Macintosh, Copyright 2016, Adrian Smith, Brook House, Gilling, YORK, UKAPL385 UnicodeRegularAPL385-UnicodeA
$

Also worth noting that it looks fine on my iMac, but not on my iPhone.

gitonthescene commented 2 years ago

I'm no web guru, but when I connect my Safari's developer tools to my iPhone and check the corresponding span elements posted above, MDAPL lists the font as APL385 Unicode where as Learning APL lists it as Times New Roman. I'm guessing the issue is almost certainly the ttf file mentioned above.

Screen Shot 2022-04-09 at 5 55 22 PM Screen Shot 2022-04-09 at 5 55 07 PM
rodrigogiraoserrao commented 2 years ago

The reason it might be working on your Mac, @gitonthescene, is that you probably have the APL385 font installed on your computer, so LearnAPL sources it locally. On your iPhone, not so much.

If the .ttf files differ, that's likely the issue, then. I got my .ttf file from http://www.apl385.com/fonts/.

Might be worth ensuring both .ttf files live in the same location (in the _static folder, next to the custom.css file).

gitonthescene commented 2 years ago

@rodrigogiraoserrao - Thanks for replying. I think you’re right that it finds the fonts locally on my desktop. Hopefully this fixes the issue for my phone as well.

Tortus-exe commented 2 years ago

What's interesting is that this looks like a Jupyter notebook, right? Shouldn't it be some kind of monospaced font if it's a jupyter notebook?

gitonthescene commented 2 years ago

I think it has declared using a font which doesn’t load properly. The fallback font is probably the same for the entire document.

rodrigogiraoserrao commented 2 years ago

What's interesting is that this looks like a Jupyter notebook, right? Shouldn't it be some kind of monospaced font if it's a jupyter notebook?

The source is a notebook, and if you open the notebook sources, where the custom CSS has no bearing, you will see a monospaced font.

But then it gets built into an HTML page, and then the fallback font is something else.

xpqz commented 2 years ago

The font file was indeed broken. I've uploaded a correct (hopefully) version in cc8766a753e9f023cda7adf2dec928799123ba74

I'll leave this open for now until someone tells me it's now working. Thanks for your help, @gitonthescene @rodrigogiraoserrao

gitonthescene commented 2 years ago

Looks great now! Thanks!