summaryrefslogtreecommitdiff
path: root/xfontsel.c
AgeCommit message (Collapse)Author
2022-11-09Use gettext() to localize messages if availableAlan Coopersmith
Originally fixed for Solaris in August 2000 by Jay Hobson under Sun bug 4256527 "Internationalize xfontsel" Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-10Fixed -Wshadow declaration warningsThomas Kuehne
2022-04-05include actual screen resolution in the resX & resY menusGreg A. Woods
When given the "-scaled" option fetch the actual screen resolution and add that to the list of available resolutions for the resX and resY menus. I.e. If the pattern contains '*' for the resX and resY fields (i.e. instead of '0') then we wil end up with the menu containing "0, 100, NNN", which makes for a really good demonstration of how scaling of fonts without knowing the true screen resolution can lead to very wonky results. Even if the values in the pattern are '0' you still get the true DPI as an option in the menus. When you specify a size for a scalable font, you should use points, never pixels. Points are a physical unit of measurement. There are always 72 points per inch. Never more or less. So to scale fonts properly on a screen the scaler needs to know the resolution of the display in pixels per inch in order to render text at a measurable physical point size. In the current X11 world it is still up to the user to correctly specify the actual screen resolution when requesting a scalable font to render text with, and this is now possible to demonstrate with this change to Xfontsel. So with the actual correct resolution selected from the resX and resY menus (and if the resolution figures are accurate and if the display hasn't been scaled by the hardware or, e.g. XrandR) then choosing any avaliable point size will show the sample text with a height on the screen physically matching the chosen point size. To that end the default pixelSizeList resource has been changed to just "0", as it should never be changed, and instead the default "pointSizeList" resource has been extended with a list of reasonable real-world sample (deci)point sizes. [also touch up the help text and call exit() to exit main()] Signed-off-by: Greg A. Woods <woods@robohack.ca>
2022-04-05Add 'reset' buttonAlexander Gromnitsky
It's very tedious to deselect multiple XLFD field names if you want to start from scratch (it's often easier to relaunch the app). Hence, a simple reset button can be handy. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-03mark Quit() & QuitAction() as noreturnAlan Coopersmith
Clears gcc warnings: xfontsel.c: In function ‘QuitAction’: xfontsel.c:1477:1: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn] QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params) ^~~~~~~~~~ xfontsel.c: In function ‘Quit’: xfontsel.c:1392:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn] void Quit(Widget w, XtPointer closure, XtPointer callData) ^~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-03Clean up variable scoping in GetFontNames()Alan Coopersmith
Gets rid of gcc warning: xfontsel.c: In function ‘GetFontNames’: xfontsel.c:498:16: warning: declaration of ‘f’ shadows a previous local [-Wshadow] int maxField, f; ^ xfontsel.c:446:9: note: shadowed declaration is here int f, field, count; ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-03const cleanupAlan Coopersmith
Clears up 32 out of 49 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-25Use C99 struct initializer for parseRec in GetFontNames()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-19When font fails to load, grey out text instead of unmapping text widgetAlan Coopersmith
Before if you selected a pattern that couldn't load, such as a strange encoding, the text widget would simply stop updating, giving the user no feedback that they weren't seeing the selected font, and leaving repaint turds from menus in the text area. Now we are more clear that something is wrong, and clean up when menus overlap the text. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-19Remove extraneous braces left from commit 1d6970a838d4ed42aAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-05-26Prevent memory leak in GetFontNames if no fonts are matchedAlan Coopersmith
Defer creating ParseRec until after we check for numFonts = 0 and return. Fixes error found by Parfait 0.5.0.2 bug checking tool: Memory leak of pointer '<unknown>' allocated with XtMalloc(40) at line 466 of app/xfontsel/xfontsel.c in function 'GetFontNames'. pointer allocated at line 447 with XtMalloc(40). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-04-14Combine usage message stringsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Add const attribute to fieldP fix a gcc -Wwrite-strings warningAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Convert sprintf calls to snprintfAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Remove USE_TEXT_WIDGET (bug 8966)Jesse Adkins
It was included in the initial revision. The bug dates back to 2006, so I think it's safe to say that this never worked. Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-10-06Purge cvs tags.Jesse Adkins
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
2009-01-21Ansification and compile warning fixes.Paulo Cesar Pereira de Andrade
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects make distcheck and all gcc 4.3 and sparse warnings.
2008-11-28Compile warning fixes.Paulo Cesar Pereira de Andrade
Ansify functions with K&R prototypes. Adjust some definitions to match required prototypes. Declare as static some functions to avoid warnings about missing prototypes.
2004-04-23Merging XORG-CURRENT into trunkxprint_packagertest_20041217_basexprint_packagertest_20041125_basesco_port_update-baserel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_16XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10XORG-6_8_99_1XORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGExprint_packagertest_20041217xprint_packagertest_20041125sco_port_updatelg3d-masterlg3d-eventlg3d-dev-0-7-1lg3d-dev-0-7-0lg3d-dev-0-6-latestlg3d-dev-0-6-2lg3d-dev-0-6-1-latestlg3d-dev-0-6-1-currentlg3d-dev-0-6-1-1lg3d-dev-0-6-1lg3dXORG-6_8-branchCOMPOSITEWRAPEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich
2003-11-25XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-012804-2330Kaleb Keithley
2003-11-14Initial revisionXORG-STABLEKaleb Keithley