-
Notifications
You must be signed in to change notification settings - Fork 741
Appearance (X resource) unification #4704
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
Conversation
Wow, amazing work. This took a ton of effort. Kudos. |
This pull request introduces 1 alert when merging e94c104 into a2f0e7d - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the added images, they're a fair way larger than the others, is this a colourspace difference and/or need to run through pngcrush/similar?
#define IC_SIZE 127 | ||
static struct image_bucket *imagecache[IC_SIZE]; | ||
static GImageCacheBucket *imagecache[IC_SIZE]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Geez, implementing our own hash table is rough.
gdisp->twobmouse_win = tbf; | ||
gdisp->macosx_cmd = mxc; | ||
GDrawResourceFind(); | ||
gdisp->bs.double_time = _GDraw_res_multiclicktime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've expressed this elsewhere, but not really a fan of these random/externed variables for preferences (not saying though that that needs to change for this pr, just longer term goals for how preferences should be managed).
In that sense imo the old approach (or the interface at least) was cleaner/makes more sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I suppose I added some more of that but it's still fairly modest.
In this case the "old approach" suffered from code duplication and a lack of an editing interface. It seemed strange to add the whole block to both back-ends.
It would certainly be easy enough to shove them all into a struct and give it a proper header if you think that would help.
I think the only image I added was |
@jtanx by the way when switching between 2012 and tango (I know .. why?) the install process isn't very good at identifying what files need to be replaced in (the equivalent of) |
As in |
Yeah, that's all I mean. |
One thing I didn't put much thought into is whether more of the existing or added color parameters should have an alpha channel. (Having said that, it does seem that most of the colors don't overlap with others besides the pertinent background so there's no need for it.) If folks have opinions on this let me know and I can make the changes. |
I just played around with fonts a tiny bit on Arch to see how the support looks. Arch has a mainstream package with the original bdf unifont files (https://archlinux.org/packages/extra/any/bdf-unifont/) and a user-supplied package with the ttf adaptation: https://aur.archlinux.org/packages/ttf-unifont/ . As far as I can tell the bdf fonts don't work with FontForge, at least with typical compilation flags. That's consistent with this note about about Arch pango support. Arch is bleeding-edge so other distros may still work. The ttf-unifont versions work pretty well as a backstop (although I guess there's little or nothing to be done past the BMP). This may put us in a bit of a tricky situation as I'm not sure there's a mainstream outline font addressing the problem that bdf-unifont was intended to solve. This leads me to the following initial thoughts:
|
Ah, there's also https://aur.archlinux.org/packages/otb-unifont/ , which repackages the BDF as OTB (using ... FontForge!) That could be another direction we encourage. There are some unifont line height issues we may or may not want to think about (in FontView). |
@skef I'm writing to make you aware of Unifont Upper, if you are not already. Unifont Upper supports a lot of SMP glyphs. See the codechart: http://unifoundry.com/pub/unifont/unifont-13.0.06/unifont_plane1-13.0.06.bmp You can confirm it by comparing glyph shapes to https://en.wikipedia.org/wiki/Linear_B_Syllabary, the first encoded script in the SMP. Unifont Upper's SMP support isn't perfect, but it encodes a lot of emoji, maths glyphs, and some rare scripts. I guess it's up to me to contribute Deseret, as I note that's missing, but for FontForge's users, I think it's not a problem for us to specify:
|
@skef Did you see the above? |
Yes, I did. It seems like all of these PRs are on indefinite hold for lack of review resources. I guess stuff will happen when it happens. |
Unfortunately. I'd trust Jeremy or Frank to merge this, but I haven't worked on the project recently enough or at this deep of a level to really do a thorough review. |
Any progress on this pull review? |
(pure rebase to master to fix conflicts) |
@@ -79,6 +80,9 @@ | |||
#define SMDE_WIDTH 200 | |||
#define SMDE_HEIGHT (SMD_DIRDROP+200) | |||
|
|||
GResFont statemachine_font = GRESFONT_INIT("400 12pt " MONO_UI_FAMILIES); | |||
extern Color kernclass_classfgcol; // Yes this is cheating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheating - meaning it doesn't have its own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I reused a few colors for more obscure cases when I was fairly confident no one would mind them being the same.
gdraw/gresource.c
Outdated
@@ -788,7 +784,7 @@ static void _GResourceFindImage(const char *fname, GResImage *img) { | |||
if ( fname!=NULL ) { | |||
t = _GGadgetImageCache(fname, false); | |||
if ( t==NULL || t->image==NULL ) { | |||
GDrawError("Could not find image corresponding to '%s', using default", fname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was pretty noisy when I was running, I think it makes sense to move these to traces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with that. Want me to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I've already moved them to traces
Given the size of the pr it's hard to give too in-depth of a review but I did go over all of it and I don't spot anything obviously wrong, so I'll just mostly trust that it's doing the right thing. In terms of outstanding actions:
Is this just wrt what gets set in CMakeLists.txT?
Is this wrt GResourceFindString("Keyboard") - or what in particular? |
I think it's in BuildUtils.cmake but yes. I guess this is pretty simple; it seems like there are three levels: We might think there's a font that makes FontForge look nice and/or go with the project's "branding", which would presumably go up front. Next we probably want a font with reasonably good Unicode coverage that ships with the system, and is therefore likely different for Mac, Windows, and Linux. That's the research part of the problem. Then we might want to add some flavor of unifont and encourage its installation. (Probably either an outline version or OpenType-wrapped bitmaps, as those seem to be the only bitmap format working reliably now). It's also possible that the project would prefer a different font for menus and dialogs and such compared with glyph labels. That would be easy enough to change in the standard theme. Is this wrt GResourceFindString("Keyboard") - or what in particular? Yeah, it doesn't really fit in with "appearance" and (in my view) the reasons it got lumped in with the X Resource framework don't apply anymore. (There's no reason that a theme you choose for FontForge should set it, for example). It should become a preference. |
Font-wise I suppose we can also punt the decision and add a version of the old choices as defaults. However, some of those choices just don't seem to make sense now, so even a few hours of research or asking for input on fontforge-users seems preferable. |
I think even if there are holes in my approach it's on the way to a better solution, so yeah, I'm not inclined to pursue further fixes for now but also not inclined to revert that work (assuming that's permissible). I've worked through the rebase problems without squashing and am currently trying to test the askmulti dialog in the rebased version. Once I've done that I'll force-push. |
Ok, I think I have everything put back together post-rebase. Akwardly, with the rebase process most of the changes to gflowbox.c and gsdroll1box.c got rolled in to the initial commit, so you'll have to look at them there if you want to. |
lastmi is initialised after GMenuBarFit is called
Alright, I've pushed my changes. I looked further into the menu patches you made and yeah they're fine, I fixed that issue I talked about with 2fb3480. With that I think we're good to merge. |
The only suggestion here — there should be one more change in "About" dialog:
Here is screenshot of |
@Symbian9 Unfortunately I doubt there is going to be a sophisticated hierarchy of color settings analogous to what has been added for UI fonts. Theme designers are just going to have to go through and change the settings themselves. That said, those colors should be settable with |
If you or any theme designer wants help tracking down settings open a "Discussion" in this repo and I'll try to help you. |
Running straight from the bin folder in the build directory doesn't have the theme files in the right place unless if you manually copy them into the right place. If you ran |
From your screenshot alone I can tell it's not loading any theme. The default preferences expect the theme to be in the
|
Your hint with installing into a fake Thank you!! Might be worth mentioning in the |
And/or here in the cmake for fontforge quickstart. |
Appearance (X resource) unification
This dark theme is unavailable now, but here is a backup: Archived project page: http://web.archive.org/web/20220309004744/https://github.com/ASIDEdesignlab/zDarkTheme Author's post on Dribbble: https://dribbble.com/shots/15935800-zDarkTheme-FontForge-Theme |
Including:
For historical reasons the UI knobs in FontForge are supplied in X Resource format. There may still be some minimal compatibility with that system but given that its mostly supplied via GDK now that's not very important.
At some point a handy resource editing dialog was added so that less technical users could customize the UI. There was some effort put into unifying the initialization and the editing at that time but mostly in the form of new APIs (mainly
GResEditFind()
). For the most part variables were still initialized via individual calls toGResourceFindColor()
,GResourceFindString()
and so on.The bulk of this PR finishes the unification, so that initialization and editing are two uses of the same data structure. It is now easier to add new directives -- usually just a matter of declaring the static variable with an appropriate default value, adding one line to a
struct resed
initializer, and a corresponding line to thetango/resources.in
file (if needed).In addition to that it does the following:
BuildUtils.cmake
and can be overridden by CMake flags. They are broken down by OS type (APPLE
,WIN32 OR CYGWIN
, and "other"). The current values are not final -- part of the reason I'm starting this PR as a draft is that we should discuss the best options.GDrawGetDefaultForeground()
and...Background()
now return a static value and ignore the display argument, as that generality wasn't used and mostly caused updating problems.) This allows a number of issues to be closed and means that true "dark" themes (and the like) are now possible.ScreenWidth
directives in favor ofScreenResolution
I did that on the X side for consistency.ImagePath
immediately, rather than having this happen "at the edges". The modifiedGResImage
definition now stores the bucket instead of the file for additional flexibility.In addition to reviewing the changes this has a todo list:
Ideally this work would be paired with a later PR that
Then FontForge would support proper themes, which I imagine being added through a python API hook and distributed as python packages, given that the plugin interface is already integrated.
Closes #4454
Closes #4391
Closes #4238
Closes #3844
Closes #3835
Closes #3051
Closes #1031
Closes #863
Closes #4274