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

Understanding Fonts #286

Open
zwieblum opened this issue Jun 29, 2020 · 10 comments
Open

Understanding Fonts #286

zwieblum opened this issue Jun 29, 2020 · 10 comments
Assignees
Labels

Comments

@zwieblum
Copy link

What is the best way to get crisp fonts? I ask this, because I always end up with mushy aliased fonts. In my understanding, fonts are created as one or more bitmaps from the ttf-fonts in the FONTS-file. So choosing a big font size in FONTS would create a bitmap with smaller antialiasing artefacts. But happens when using the fonts in the GUI? They still look as if they were antialiased a second time - bit where and why? Is there a way to prepare and use pixelperfect bitmaps for fonts?

@mgorges
Copy link
Contributor

mgorges commented Jun 29, 2020

I don't think there is one - in the end we render pixmaps but don't include the actual traces or fonts to be rendered by the device as vectors. As for sizes I would not get them rescaled (scaled down from a larger font size) but get the correct size you need and include that size in the requested definitions. Finally, from personal experience, I always felt the LaTeX-rendered fonts looked much better than those made with GD?

@zwieblum
Copy link
Author

LaTeX rendering is definitly better :) Correct me if I'm wrong: For me it looks like the only way to display fonts not-rescaled is to provide bitmaps for any pixel size from ~10 to 100, use the device default resolution and calculate the needed dimensions of elements and fonts myself. At the moment the font bitmaps are resized if the device resolution is not equal to the dimension given in (make-window ...).

It's been a while since I last used LN, but today I stumbled upon DemoHybridApp - this looks like the perfect way to get a native GUI. In fact, the application I want to port is a webinterface :)

@mgorges
Copy link
Contributor

mgorges commented Jun 29, 2020

I have apps that make lots of different font sizes, but don't pick the 'best' one dynamically based on screen size, e.g. '12,16,20,24,40' - but its something you could consider.

I don't know if there are comprehensive examples for Hybrid apps, but we have one in production for a reasonably large research project (>10,000 participants) that uses a framework7 frontend for android (and in theory also iOS) with native widgets.

@zwieblum
Copy link
Author

I just finished porting the project from C++ to lambdanative Hybride app. Codesize was reduced from ~ 900 lones to ~ 120 lines, so I'm quite satisfied whith that outcome.

@Hybrid app: It looks like there are some glitches with

. As soon as a get-parameter is present, the browsers addressline becomes visible. If a form only has one submit-button without value, the resulting URL is of the form http://128.0.0.1:8080/? - which is not served by anything, not even the catchall-procedure. Anyway, when using POST, these things diappear.

@ddunsmuir ddunsmuir self-assigned this Jun 30, 2020
@ddunsmuir
Copy link
Contributor

I'll take a look at this when I get a chance.

@ddunsmuir
Copy link
Contributor

The DemoHybridApp has a get call with three parameters. I do not see anything odd happen on Android and I don't see any change in the addressline on Mac. What platform are you using and can you give an example? Is this when it also goes to a new page? The DemoHybridApp stays on the same page.

If I remove the value from the submit button on the DemoHybridApp, the only change I see is that the button now has the default label Submit (again on Android and Mac). What am I missing here?

@zwieblum
Copy link
Author

zwieblum commented Jul 6, 2020

Please see attached testproject. The first page opens without addressbar. Clicking on the submit-button brings up the addressbar. Anyway, it might be a browser problem: on my android device the default browser is firefox.

gettest.tar.gz

You are right, DemoHybridApp does not show the problem. Looks like the reason is the <form ..> not having an action=...

@ddunsmuir
Copy link
Contributor

I can run your example on Mac. When I press the second button on a.html it says "Invalid Request" and tries to go to http://127.0.0.1:8080/? . This doesn't meet your example though as this isn't a get and the submit value does have a value...? I assume the failure here happens because you have action="/". If I change "/" to "b.html" then it works. I assume it's the same issue on b.html. I assume we are not handling action="/". Do you mean action="./"?

It would not compile for me for Android. It says
BUILD FAILED
/usr/local/android-sdk-r25.2.5/tools/ant/build.xml:1109: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 61; Element type "activity" must be followed by either attribute specifications, ">" or "/>".

@zwieblum
Copy link
Author

zwieblum commented Jul 8, 2020

Please update your repository, that build problem was solved #287 :)

Anyway, "Invalid request" happens when the 'catcall proc is not set. You can create a 'catchall proc, but on my system it still creates "Invalid request" --> I think there's a problem with the webserver on android (see the other issue that the webserver only works when binding to "*", not "127.0.0.1"). "/?" is absolutely valid, the URL sanitizer has to resolve it to a empty list of get parameters and "/" as the requested URL.

Running the same example on linux works like expected - but it's in a browser windows with addressbar, for sure.

@zwieblum
Copy link
Author

Quick not on appearing addressbar: it does not appear when using submit-button or submit(), but appears in all other cases. (, location.replace() ...). And it depends on the pickiness of your browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants