Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old January 27, 2019, 13:43   #61
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by Bandobras View Post
Initially the game window was partially transparent, with the @ warrior picture below it. Which was quite distracting. When I restarted, either the main game window became fully opaque, or the picture below vanished.
Hmmm, that's not normal...
It's possible to make most subwindows partially transparent (e.g., Menu -> Term-1 -> Alpha), but not the main one.
Also, some terminology: "window" is the stuff that your window manager (like GNOME or XFCE or whatever) creates - "window" can be fullscreen; "subwindows" are those rectangles inside main window that react to "Move" and "Size" buttons and display game state (map, messages, monster list, etc).

Quote:
Anyway, the background is black now, which is what I wanted.
There is a file "~/.angband/Angband/sdl2init.txt", which containts various settings for the port. Post it here, please.

Quote:
The only problem: 'size' ends at 21 points, and the font (being cheaply generated from a bitmap font) looks best at 16, 24, 32, etc. For 4K monitors it would make sense to bump it to 32 or even 64.
Noted. I take it the button becomes red when you try to increase above 21? (the max size is hardcoded to be 24 anyway). What's the resolution of your monitor? The main subwindow (that displays dungeon) must be at least 80x24 characters.
"sdl2init.txt" should have some useful information about it, so don't forget it
t4nk is offline   Reply With Quote
Old January 29, 2019, 13:21   #62
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Well, I started to make some progress - namely, at last I remembered my password for Github Openmailbox seems to be down...

So, the plan is, as discussed with various people:

1) Revive Makefile.std (Nick)
2) Remove "Cursor" option from the menu (fph)
3) Change menu colors (wkmanire)
4) Write a help file (wkmanire)
5) Windows version (Grotug)
6) Bigger font size with high DPI displays (Bandobras)

Let me know if I'm forgetting something.
t4nk is offline   Reply With Quote
Old February 1, 2019, 17:56   #63
Bandobras
Knight
 
Join Date: Apr 2007
Posts: 725
Bandobras is on a distinguished road
Huh, suddenly between this

https://github.com/Mikolaj/angband/c...55ad910fbbce00

and this commit

https://github.com/Mikolaj/angband/c...ec29ce9301bb1d

the WOFF font no longer shows up on the list and when I force it via `.angband/Angband/sdl2init.txt`, it fails with

Code:
parse error in /home/mikolaj//.angband/Angband/sdl2init.txt line 15 column 4: : invaild value
angband: main-sdl2.c:5683: get_new_window: Assertion `!window->inited' failed.
Aborted (core dumped)
The very same font file works fine in my Allure of the Stars with SDL2 frontend.

Edit: my .angband/Angband/sdl2init.txt

Code:
window-display:0:0
window-full-rect:0:0:0:1920:1080
window-fullscreen:0:true
window-renderer:0:hardware
window-wallpaper-path:0:/home/mikolaj/r/angband/lib/icons/att-128.png
window-wallpaper-mode:0:tiled
window-status-bar-font:0:0:8x13x.fon
window-graphics-id:0:0
window-tile-scale:0:width:1
window-tile-scale:0:height:1
window-cursor:0:true

subwindow-window:0:0
subwindow-full-rect:0:0:22:1920:1058
subwindow-font:0:12:16x16xw.fon
subwindow-borders:0:false
subwindow-top:0:true:false
subwindow-alpha:0:255
Edit2: When I increase the WOFF font size, after size 21 it goes back to size 4. My monitor is Full HD and the font at size 24 results in exactly Full HD size with 80 columns and 45 rows, so it should still fit at size 24.

Last edited by Bandobras; February 1, 2019 at 18:08.
Bandobras is offline   Reply With Quote
Old February 1, 2019, 18:30   #64
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by Bandobras View Post
Huh, suddenly between this

https://github.com/Mikolaj/angband/c...55ad910fbbce00

and this commit

https://github.com/Mikolaj/angband/c...ec29ce9301bb1d

the WOFF font no longer shows up on the list
Either freetype can't open it, or it thinks it's not a monospace font (FT_IS_FIXED_WIDTH()). What does that commit do?

Quote:
and when I force it via `.angband/Angband/sdl2init.txt`, it fails with
Not recommended, sdl2init.txt is not really human editable

Quote:
The very same font file works fine in my Allure of the Stars with SDL2 frontend.
Then most likely FT_IS_FIXED_WIDTH() fails.

I'll take a look at it after dealing with makefiles and other things (see plan).
t4nk is offline   Reply With Quote
Old February 1, 2019, 18:40   #65
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by Bandobras View Post
My monitor is Full HD and the font at size 24 results in exactly Full HD size with 80 columns and 45 rows, so it should still fit at size 24.
Each subwindow has an 8 pixel border on all sides (top, bottom, left, right), so subtract 16 from your monitor size... there is also the status bar at the top (with buttons - "Menu" and others), so subtract this also (edit: it's 22 pixels high)... So maybe it's correct?

I guess, these things can be made configurable at least, but it looks like you won't get a lot bigger than 21?

Last edited by t4nk; February 1, 2019 at 19:11.
t4nk is offline   Reply With Quote
Old February 1, 2019, 19:50   #66
Bandobras
Knight
 
Join Date: Apr 2007
Posts: 725
Bandobras is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Then most likely FT_IS_FIXED_WIDTH() fails.
Spot on. I copied some glyphs from another file, but didn't correct their width from 1600 to 1602 pixels (don't ask). Fixed and pushed.

Quote:
Each subwindow has an 8 pixel border on all sides (top, bottom, left, right), so subtract 16 from your monitor size... there is also the status bar at the top (with buttons - "Menu" and others), so subtract this also (edit: it's 22 pixels high)... So maybe it's correct?
That should still fit in a 23 pixels font comfortably. But something is not right, because at 21 pixels I've counted only 81 columns in a line in monster recall menu.
Bandobras is offline   Reply With Quote
Old February 1, 2019, 20:08   #67
Bandobras
Knight
 
Join Date: Apr 2007
Posts: 725
Bandobras is on a distinguished road
I've looked closer and it seems, compared to bitmap font, for WOFF you are adding 2 pixels extra between glyphs adjacent horizontally and 3 between lines.

Allure of the Stars manages to mimic bitmap font treatment by displaying each glyph separately at calculated coordinates and so there is no extra space between glyphs.

Edit: Wow, you are actually doing that with bitmap fonts as well, which means even with a square font distances are not true on the map. I'm surprised, because bitmap fonts (or only the old-school ones?) are designed pixel-perfect, for display without any extra borders. You probably do that due to the cursor, because your fonts (as opposed to mine) are not designed to accommodate the cursor, so that it doesn't obscure important parts of the font and never touches stems at more that a couple of points. I'd probably only do that for fonts smaller (or equal?) than 9x15, because glyph stems in larger fonts rarely, if ever, run exactly at the border or only 1 pixel away (so cursor would fuse with the stem). This is all assuming your cursor is 1 pixel wide. But is looks so.

Last edited by Bandobras; February 1, 2019 at 20:30.
Bandobras is offline   Reply With Quote
Old February 1, 2019, 21:24   #68
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by Bandobras View Post
I've looked closer and it seems, compared to bitmap font, for WOFF you are adding 2 pixels extra between glyphs adjacent horizontally and 3 between lines.
Ah, right! Forgot about it. You have sharp eye, Bandobras

Quote:
Edit: Wow, you are actually doing that with bitmap fonts as well, which means even with a square font distances are not true on the map. I'm surprised, because bitmap fonts (or only the old-school ones?) are designed pixel-perfect, for display without any extra borders. You probably do that due to the cursor
It's actually because of vector fonts (.ttf, .otf and stuff). Those are not pixel perfect (even if monospace) - the sizes of glyphs can differ by a pixel (e.g, "t" is 8 pixels wide, while "m" is 9 pixels). So I just add a one pixel border to what freetype reports is the font size. Otherwise, erasing glyphs can leave some stray pixels.
Bitmap fonts are indeed pixel perfect... they're also not really resizable, which is why Angband ships with tons of them. I don't like Angband's default fonts, so I didn't even consider adjusting their size back... I guess I should do that.
t4nk is offline   Reply With Quote
Old February 1, 2019, 22:03   #69
Bandobras
Knight
 
Join Date: Apr 2007
Posts: 725
Bandobras is on a distinguished road
My ttf (that is WOFF) font doesn't lie about its size, I hope.

Anyway, I handle scalable fonts by always creating a black texture of the nominal size and pasting the texture I got from sdl2-ttf in the center, cutting off any portions that stick out. In this way I get no border and no stray pixels after wiping out previous glyphs.
Bandobras is offline   Reply With Quote
Old February 1, 2019, 22:26   #70
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by Bandobras View Post
My ttf (that is WOFF) font doesn't lie about its size, I hope.
It not really a lie... as the Freetype maintainer likes to explain, the only REAL way to determine font size in pixels is to render all glyphs For example, I recall DejaVuSansMono does leave stray pixels (at some sizes).

Quote:
Anyway, I handle scalable fonts by always creating a black texture of the nominal size and pasting the texture I got from sdl2-ttf in the center, cutting off any portions that stick out. In this way I get no border and no stray pixels after wiping out previous glyphs.
Very reasonable idea. I decided to add borders to (most) glyphs because I didn't want to "lose data", but I didn't consider that one-pixel borders would actually add up to a rather big number of wasted pixels... Getting rid of them would allow to display several more lines/columns (or use bigger font size with the same term size)... yeah, I really should be cropping glyphs instead. Thanks!
t4nk is offline   Reply With Quote
Reply

Tags
libsdl2


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Android-port not work Angrist Vanilla 1 October 14, 2014 04:24
Web Port wilbur07 Vanilla 6 February 27, 2014 14:39
OpenGL port BreathesFire Development 2 November 3, 2011 08:22
[FA] NDS port Donald Jonker Variants 54 October 6, 2011 16:49
[V] Gtk port Magnate Development 1 February 24, 2009 10:48


All times are GMT +1. The time now is 12:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.