<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">It appears to me that kdialog is ignoring the '--font' option.  (kdialog has a lot of "missing features", "misfeatures", etc.  it's a shame)<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">However,<br><br>Ref: <a href="https://nowardev.wordpress.com/2013/06/28/kdialog-set-fonts/">https://nowardev.wordpress.com/2013/06/28/kdialog-set-fonts/</a><br>$ kdialog --geometry 1024x768 --msgbox "<FONT FACE="Monospace">$(cat /etc/motd)</FONT>"<br></div><div class="gmail_default" style="font-family:monospace,monospace">renders a monospace font, but in an unre-sizable fixed window :-(<br></div><div class="gmail_default" style="font-family:monospace,monospace">(i.e. --geometry is ignored)<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">This seems to mostly work:<br>$ cat /tmp/kdialog.txt<br><pre style="font-family: monospace; font-size:24pt">The programs included with the Debian GNU/Linux system are free software;</p><br><pre style="font-family: monospace; font-size:24pt">the exact distribution terms for each program are described in the</p><br><pre style="font-family: monospace; font-size:24pt">individual files in /usr/share/doc/*/copyright.</p><br><pre style="font-family: monospace; font-size:6pt"> Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.</p><br><p style="font-size:30px">This is a paragraph.</p><br><br></div><div class="gmail_default" style="font-family:monospace,monospace">$kdialog --geometry 1024x768 --textbox /tmp/kdialog.txt<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">The "HTML" parser seems to be very limited.  It is line oriented (i.e. a <CR> terminates any current deviation from defaults, so you have to prefix every line with what you want).<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">'font-color' is not supported, i suppose many things aren't.<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">So, this example works (IT WORKS FOR ME(TM))<br><br>$ lsblk | sed -e 's/^/<pre style="font-family: monospace; font-size:12pt">/;s/$/<\/pre>/' > /tmp/kdialog.txt<br>$ kdialog --geometry 1024x768 --textbox /tmp/kdialog.txt<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">--or--<br><br>kdialog  --textinputbox "$(lsblk | sed -e 's/^/<pre style="font-family: monospace; font-size:12pt">/;s/$/<\/pre>/')" "" 1 1<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">but the following does not (using bash process substitution)<br><br>$ kdialog --geometry 1024x768 --textbox  <(lsblk | sed -e 's/^/<pre style="font-family: monospace; font-size:12pt">/;s/$/<\/pre>/')<br></div><div class="gmail_default" style="font-family:monospace,monospace">kdialog does funky things with file handles, so you might be able to mangle that up, but otherwise, probably easiest to make a temporary file, and use a shell trap to ensure it gets removed.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br><br>As a REALLY Ugly hack, you can use the kdialogrc KDE config file:<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">you could use maketemp to create a temporary hierarchy<br></div><div class="gmail_default" style="font-family:monospace,monospace">and populate:<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br>FAKE_KDE_HOME=/tmp/kdeFOO/<br>FAKE_KDE_CONFIG=/tmp/kdeFOO/share/config<br>cat >> ${FAKE_KDE_CONFIG}/kdialogrc << "EOF"<br>[General]<br>font=Sans Serif,20,-1,5,50,0,0,0,0,0<br></div><div class="gmail_default" style="font-family:monospace,monospace">EOF<br></div><div class="gmail_default" style="font-family:monospace,monospace"># NOTE: i do not know what format that font-spec is in, that's just an example from a distro (arch?) creating a /usr/share/kde4/config/kdialogrc<br></div><div class="gmail_default" style="font-family:monospace,monospace"># NOTE: it's up to you to figure out the correct specification.   I *think* <br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">then:<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">KDEHOME=${FAKE_KDE_HOME} kdialog ...<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">That also changes the Button font to what you specify in the [General] group font key.<br><br><br></div><div class="gmail_default" style="font-family:monospace,monospace">--stephen<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 27, 2015 at 5:02 AM, ianseeks <span dir="ltr"><<a href="mailto:ianseeks@yahoo.co.uk" target="_blank">ianseeks@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday 27 Oct 2015 10:03:06 Duncan wrote:<br>
> ianseeks posted on Tue, 27 Oct 2015 08:05:49 +0000 as excerpted:<br>
> > On Monday 26 Oct 2015 20:31:48 J. Leslie Turriff wrote:<br>
> >> I want to use kdialog to display a table of values, and to make<br>
> >> the output columns line up, the simplest way is to display the data<br>
> >> with a monospace font, e.g. DejaVu Sans Mono.  kdialog --help-qt<br>
> >> shows option -fn <name> or --font <name>, but does not describe the<br>
> >> format of the <name> string.<br>
><br>
> [snip the details as not relevant to this particular subthread]<br>
><br>
> > I've just done a "kdialog ?" and there is no reference to a "--font"<br>
> > and thats using this version<br>
> > Qt: 4.8.7<br>
> > KDE Development Platform: 4.14.12<br>
> > KDialog: 1.0<br>
><br>
> The two of you are using two different sets of help output.<br>
><br>
> For most kde executables, <command> --help (or <command> ?, which was new<br>
> to me) will output help text in two sections.  The first section is<br>
> generic parameters such as --help itself, the section is command-specific<br>
> options, followed by command specific arguments.<br>
><br>
> You (ianseeks) were looking at the ?/--help output and apparently focused<br>
> on the (command specific) Options section, which, you correctly noted,<br>
> contains no --font or similar option.<br>
<br>
</span>seemed the sensible thing to do at time. :o)<br>
<span class=""><br>
> However, the OP (J Leslie Turrif) specifically mentioned help output<br>
> found under --help-qt, which is qt-specific help that generally applies<br>
> to all qt-based programs, pretty much regardless of what they actually<br>
> are.  Similarly, --help-kde is kde-specific help that generally applies<br>
> to all kde-based programs, pretty much regardless of what they are.<br>
> --help-all should list all the above, the generic options, followed by<br>
> the command specific options, followed by the qt options, then the kde<br>
> options, and finally the command arguments.<br>
><br>
> And it can be observed that --help-qt (as well as --help-kde and<br>
> --help-all) is indeed listed under the generic options (at least for my<br>
> kdialog 1.0, on kde 4.14.13, on qt 4.8.7) section when invoking<br>
> kdialog --help or kdialog ? .<br>
<br>
</span>perhaps the qt/kde options should be listed at the same time something along<br>
the lines of "man rpm"  i.e. get all the options into the open<br>
<br>
thanks for the enlightenment.<br>
<div class="HOEnZb"><div class="h5"><br>
> And, --help-qt (and the qt section under --help-all) does indeed list<br>
> both --fn and --font, as synonyms for each other.<br>
><br>
><br>
> So... the --fn/--font option is a generic qt option, that should work<br>
> with most qt-based apps, and is actually a generic option included due to<br>
> the app being qt-based, even if in some cases --fn/--font won't apply, or<br>
> will be overridden by something else.<br>
><br>
><br>
> So far so good.  But I don't have an answer to the original question,<br>
> because while I've occasionally used some other qt option and had it<br>
> work, I've never needed to use that one.  Also, kdialog is a rather<br>
> unusual application, and I'm not /entirely/ sure it honors that<br>
> particular qt option at all.<br>
><br>
> What I could suggest as the way I'd try figuring it out here is this.<br>
><br>
> Try using the --fn/--font option with other more traditional qt apps.  In<br>
> particular, if you have any non-kde qt-based apps (based on the same qt<br>
> major version, right now qt4 and qt5 based apps are out, and a test on a<br>
> qt5 app while kdialog is based on qt4, or the reverse, a qt5 based kdialog<br>
> with a test on a qt4 app, won't be particularly helpful), try using the --<br>
> font option on them, and see if you can get it to work there, where it's<br>
> much more likely not to be overridden.<br>
><br>
> Once you get it working there, you'll know the font name pattern to use,<br>
> and can try the same thing on kdialog.<br>
><br>
> It may also be that in the kde environment, kde overrides the normal qt<br>
> font options, and may override it here, as well.  So it may also be worth<br>
> trying that qt-based non-kde app in a non-kde desktop environment,<br>
> perhaps failsafe, if your distro provides such a login option, or gnome<br>
> or one of the gtk-based desktop environments.  Again, if you get it<br>
> working there, you can try the font name pattern that worked there under<br>
> kde to see if it works under kde as well.<br>
><br>
><br>
> Meanwhile, my google-foo might be a bit better than yours.  Searching<br>
> on...<br>
><br>
> qt command line option "--font"<br>
><br>
> ... (the quotes around font being critical), the first hit is to a page<br>
> of qt 4.8 embedded documentation, with command-line-options down the<br>
> page.  Here's a direct link:<br>
><br>
> <a href="http://doc.qt.io/qt-4.8/qt-embedded-running.html#command-line-options" rel="noreferrer" target="_blank">http://doc.qt.io/qt-4.8/qt-embedded-running.html#command-line-options</a><br>
><br>
> The first option listed there is -fn <font>.  It says "The font should be<br>
> specified using an X logical font description."  However, that doesn't<br>
> tell me a whole lot.  The example isn't a whole lot better in that it<br>
> doesn't show size or weight or anything, but here it is:<br>
><br>
> <command> -fn helvetica<br>
><br>
> Two things to note about that:<br>
><br>
> 1) -fn not --fn.  So try it with just one -.  It might just work, or<br>
> again, it may be that kde adapted that and it really is two -- under kde.<br>
> Trying it both ways is the only way to know for sure.<br>
><br>
> 2) If you have the helvetica font installed, you can try the example<br>
> verbatim, and if it works, go from there.  If it doesn't, again, try a<br>
> different qt-based app, to be sure that kdialog isn't overriding it for<br>
> some reason.<br>
><br>
><br>
> Another hit, this one in the documentation for pyqt, adds an interesting<br>
> caveat:<br>
><br>
> -fn or -font font, defines the application font. The font should be<br>
> specified using an X logical font description. Note that this option is<br>
> ignored when Qt is built with fontconfig support enabled.<br>
><br>
> It may be that your qt and/or kde is built with fontconfig support, and<br>
> that's what's overriding the option.  I believe you'd need to check your<br>
> distro information and/or package deps to be sure.<br>
><br>
> There's likely more examples and information using the google above...<br>
><br>
><br>
> That is of course assuming nobody else posts with more helpful<br>
> information that can shortcut the process.  I'd give it a few days before<br>
> giving up on that, as sometimes, people don't get to the list every day,<br>
> but will reply in 2-3 or sometimes within the week, if that's the<br>
> frequency at which they check it.<br>
<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">___________________________________________________<br>
This message is from the kde mailing list.<br>
Account management:  <a href="https://mail.kde.org/mailman/listinfo/kde" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/kde</a>.<br>
Archives: <a href="http://lists.kde.org/" rel="noreferrer" target="_blank">http://lists.kde.org/</a>.<br>
More info: <a href="http://www.kde.org/faq.html" rel="noreferrer" target="_blank">http://www.kde.org/faq.html</a>.</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Stephen Dowdy  -  Systems Administrator  -  NCAR/RAL<br>303.497.2869   -  <a href="mailto:sdowdy@ucar.edu" target="_blank">sdowdy@ucar.edu</a>        -  <a href="http://www.ral.ucar.edu/~sdowdy/" target="_blank">http://www.ral.ucar.edu/~sdowdy/</a><br><br><br></div>
</div>