Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serif font used in Live Preview, not CourierPrime #120

Open
kortina opened this issue Mar 5, 2021 · 9 comments
Open

Serif font used in Live Preview, not CourierPrime #120

kortina opened this issue Mar 5, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@kortina
Copy link
Contributor

kortina commented Mar 5, 2021

When I try to use the Live Preview, I expected a monospace font, but it looks like it's using Times New Roman:

image

I looked around the source code and it seems that CourierPrime font should be used. Do I need to do some sort of separate install to get this font?

Is there a debug output I could use to look for errors to provide more info here?

@piersdeseilligny
Copy link
Owner

@kortina yep this is a known bug, which appears occasionally for me too. I'm not entirely sure what causes it, but normally closing and re-opening the live preview fixes is.

You can open the webview developer tools with "F1 > Open Webview Developer Tools"

@piersdeseilligny piersdeseilligny added the bug Something isn't working label Mar 6, 2021
@kortina
Copy link
Contributor Author

kortina commented Mar 6, 2021

Hi @piersdeseilligny

I tried closing / reopening the webview (and vscode itself), still same result.

The webview was helpful:

VM83:4 initialized fountainview
courier-prime.ttf:1 Failed to load resource: the server responded with a status of 401 (Unauthorized)
VM83:157 update config
VM83:36 Uncaught TypeError: Cannot read property 'length' of undefined
    at getLineElementsAtPageOffset (<anonymous>:36:28)
    at <anonymous>:136:49
noisetexture.png:1 Failed to load resource: the server responded with a status of 401 (Unauthorized)

Here is where it is trying to load the font from::

vscode-webview-resource://2b96089f-b37b-4e95-80cf-8ded3282b7b0/file///Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.3/out/courierprime/courier-prime.ttf

But it looks like this exists:

ls /Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.3/out/courierprime
courier-prime-bold-italic.ttf courier-prime-bold.ttf        courier-prime-italic.ttf      courier-prime.ttf

ls -l /Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.3/out/courierprime/courier-prime.ttf
-rw-r--r--  1 kortina  staff  152008 Feb 25 14:41 /Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.3/out/courierprime/courier-prime.ttf

btw, it is also failing to load:

vscode-webview-resource://2b96089f-b37b-4e95-80cf-8ded3282b7b0/file///Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.3/out/noisetexture.png

UPDATE:

I am using Insiders:

Version: 1.54.0-insider
Commit: 42e27fe5cdc58539dad9867970326a297eb8cacf
Date: 2021-03-02T19:09:42.206Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0

I opened in regular VS Code to test and confirmed the font does work.

So does this extension not work for some reason on Insiders? Any ideas on how to patch?

Lmk if you need more debug info

@kortina
Copy link
Contributor Author

kortina commented Mar 6, 2021

This looks related, but not clear to me what the fix would be: microsoft/vscode#89038

@kortina
Copy link
Contributor Author

kortina commented Apr 29, 2021

Just wanted to bump this and see if there were any ideas on how to patch this issue

@piersdeseilligny
Copy link
Owner

@kortina sorry, just saw this, I've been incredibly busy recently with uni work.. Does the bug still happen with the latest insider version?

I'm using the following:

Version: 1.56.0-insider (user setup)
Commit: a348d103d1256a06a2c9b3f9b406298a9fef6898
Date: 2021-04-30T05:12:29.119Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19043

And can't reproduce this issue - although it will very occasionally pop up, but that's not happened to me in weeks..

@kortina
Copy link
Contributor Author

kortina commented Apr 30, 2021

I just installed and re-installed the Better Fountain extension and confirmed the problem still happens for me. And I am on basically same version of vscode insider:

Version: 1.56.0-insider
Commit: 6449b6b7253b5808e2278903c82da8d59a230383
Date: 2021-04-30T09:28:57.754Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 20.3.0

I am on OS X and I see you are on Windows? Maybe that is part of the problem?

@kortina
Copy link
Contributor Author

kortina commented Jun 11, 2021

I just tried re-investigating this

Version: 1.57.0-insider
Commit: 20df87725d3ce4a501187f0240c2f159aa0ad2a5
Date: 2021-06-03T06:00:36.788Z
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 20.5.0

What is interesting is that I still get a 404 for this address with the Extension Marketplace version:

https://file+.vscode-resource.vscode-webview.net/Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.4/out/courierprime/courier-prime.ttf

However, when I compile the extension and run in the extension host to try to debug, it uses this address:

https://file+.vscode-resource.vscode-webview.net/Users/kortina/src/betterfountain/out/courierprime/courier-prime.ttf

And works correctly. The files do appear to exist on the filesystem:

❯ ls /Users/kortina/.vscode/extensions/piersdeseilligny.betterfountain-1.8.4/out/courierprime/
courier-prime-bold-italic.ttf courier-prime-bold.ttf        courier-prime-italic.ttf      courier-prime.ttf

Seems like some sort of security or permissions thing, perhaps?

I can't even figure out how to debug since I can't repro with the checked out repo, only happens with Marketplace version

@piersdeseilligny
Copy link
Owner

@kortina I think I may have changed the way fonts are loaded at some point in the past few months but I'm not sure - is this still an issue for you?

@kortina
Copy link
Contributor Author

kortina commented Jan 10, 2022

Looks resolved! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants