<div dir="ltr">When I was experimenting with a program to generate titles for videos the ability to control the spacing between letters (not kerning, but tracking) would have been helpful.<div><div>E.g. animating something like this:</div><div>Title</div><div>T i t l e</div><div>T i t l e</div><div>T i t l e</div><div>I don't recall everything I encountered in that project, but I believe all the basic font metrics about baseline and ascenders/descenders would help.<br></div><div><br></div><div>A FontChooser would be useful. Applications can always code their own, but the same can be said for ColorPicker. It doesn't look like there is one available even from 3rd-party libraries like ControlsFX.</div><div>Going from a Font object to CSS -fx-<span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">font-size, </span>-fx-<span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">font-family, </span>-fx-<span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">font-weight, </span>-fx-<span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">font-style doesn't always work as I've already mentioned.</span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">The Font object doesn't have a method to get the font weight and there is no -fx-font-name style. Setting -fx-font-family doesn't always result in CSS that successfully selects the desired font if used in combination with -fx-font-style and/or -fx-font-weight. Sometimes adding CSS for weight or style will cause a completely different family to be used which can look quite drastic when a variable width font is substituted for a fixed-width font just because you tried to make something bold.</span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">Also FontPosture only has ITALIC and NORMAL, but CSS -fx-font-style has 'normal', 'italic' and 'oblique' - There is no way to ask for 'oblique' from code and the </span>FontStyleConverter will convert "oblique" to REGULAR, even though "oblique" works in CSS to get a slanted font<span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">.</span></div><div><br class="gmail-Apple-interchange-newline"></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px">Asking about caretBlinkRate, I'm not sure. I imagine only one caret should ever be visible, with the exception of a rich text control that supports multiple simultaneous insertion points, like many code editors. In that case there would still only be one rate at a time even though there are multiple carets. My point being there should never be a need for multiple rates to be active at the same time, so maybe you could get away with a global rate. I can't think of a need for multiple rates, but maybe someone else can.</span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:12px"><br></span></div><div><div>Regards,</div></div><div><br></div><div>Scott</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 27, 2023 at 12:31 PM Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com">andy.goryachev@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class="msg-9201584342575565667">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_-9201584342575565667WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">> </span>
<span class="m_-9201584342575565667apple-converted-space"><span style="font-size:12pt;color:rgb(33,33,33)"> </span></span><span style="font-size:12pt;color:rgb(33,33,33)">More control of kerning and general spacing might be nice.</span><span style="font-size:11pt;font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">What properties, besides kerning, are you referring to?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Also, a question for the wider audience: is there a need to have caretBlinkRate property for each control, or a single global one would suffice? In other words, are there use cases
when two or more controls might need a different blink rate?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Thank you.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">-andy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""><u></u> <u></u></span></p>
<div style="border-right-width:initial;border-bottom-width:initial;border-left-width:initial;border-style:solid none none;border-right-color:initial;border-bottom-color:initial;border-left-color:initial;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">openjfx-dev <<a href="mailto:openjfx-dev-retn@openjdk.org" target="_blank">openjfx-dev-retn@openjdk.org</a>> on behalf of Scott Palmer <<a href="mailto:swpalmer@gmail.com" target="_blank">swpalmer@gmail.com</a>><br>
<b>Date: </b>Thursday, January 26, 2023 at 12:33<br>
<b>To: </b>openjfx-dev <<a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>><br>
<b>Subject: </b>Re: Q: missing APIs needed for implementation of a rich text control<u></u><u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">[dupe of private message, now including the mailing list]<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11pt">I've been using RichTextFX to make my own code editor/IDE. I see that you have asked that project specifically on GitHub, excellent.<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt">One thing that I wanted to do was to use a font like Fira Code that combines characters such as != or >= into a single glyph, but there are no APIs to request that JavaFX render those optional ligatures. Swing
APIs automatically do. In fact just implementing some basic font selection has been tedious. Getting the font family from a Font object and trying to use it in CSS to specify -fx-font-family simply doesn't work sometimes. Trying to filter the list of available fonts
to show only those that are fixed-width is tedious. I tried to hack something by measuring a couple different characters from the font that would normally be different widths, but this is an unreliable hack. Allowing the user to choose a preferred font and
then configuring components to use it via a CSS stylesheet is simply more difficult than it should be.<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt">A few years ago I contributed the changes to make the tab-width configurable, which helped with my project a little bit. Other APIs are needed to better control line spacing and measure font baseline offsets
and that sort of thing. I see there is an issue for caretBlinkRate, what about changing the caret shape? E.g. block, underscore, vertical bar, etc. Should the block be solid or an outline? Why is caretShape read-only? Why does it return an array of PathElements
instead of simply a Shape which by default would be a Path? More control of kerning and general spacing might be nice. I've wanted that in the past, not for a rich text control, but for doing video titles. I can see how the two needs overlap though. I recently
asked here about rendering emojis. That's currently very unreliable and broken. Getting something to work consistently cross-platform is not easy. Sometimes emojis are rendered in color, other times not. Mac renders color emojis in gray and at the wrong
size (since the sub-pixel rendering was turned off to match macOS). On Windows the emojis are never in color. <u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Regards,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Scott<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">On Wed, Jan 25, 2023 at 10:41 PM Scott Palmer <<a href="mailto:swpalmer@gmail.com" target="_blank">swpalmer@gmail.com</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-top-width:initial;border-right-width:initial;border-bottom-width:initial;border-style:none none none solid;border-top-color:initial;border-right-color:initial;border-bottom-color:initial;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal"><span style="font-size:11pt">I've been using RichTextFX to make my own code editor/IDE. I see that you have asked that project specifically on GitHub, excellent.<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt">One thing that I wanted to do was to use a font like Fira Code that combines characters such as != or >= into a single glyph, but there are no APIs to request that JavaFX render those optional ligatures. Swing
APIs automatically do. In fact just implementing some basic font selection has been tedious. Getting the font family from a Font object and trying to use it in CSS to specify -fx-font-family simply doesn't work sometimes. Trying to filter the list of available fonts
to show only those that are fixed-width is tedious. I tried to hack something by measuring a couple different characters from the font that would normally be different widths, but this is an unreliable hack. Allowing the user to choose a preferred font and
then configuring components to use it via a CSS stylesheet is simply more difficult than it should be.<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11pt">A few years ago I contributed the changes to make the tab-width configurable, which helped with my project a little bit. Other APIs are needed to better control line spacing and measure font baseline offsets
and that sort of thing. I see there is an issue for caretBlinkRate, what about changing the caret shape? E.g. block, underscore, vertical bar, etc. Should the block be solid or an outline? Why is caretShape read-only? Why does it return an array of PathElements
instead of simply a Shape which by default would be a Path? More control of kerning and general spacing might be nice. I've wanted that in the past, not for a rich text control, but for doing video title. I can see how the two needs overlap though. I recently
asked here about rendering emojis. That's currently very unreliable and broken. Getting something to work consistently cross-platform is not easy. Sometimes emojis are rendered in color, other times not. Mac renders color emojis in gray and at the wrong
size (since the sub-pixel rendering was turned off to match macOS). On Windows the emojis are never in color. <u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Regards,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">Scott<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt">On Wed, Jan 25, 2023 at 5:38 PM Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com" target="_blank">andy.goryachev@oracle.com</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-top-width:initial;border-right-width:initial;border-bottom-width:initial;border-style:none none none solid;border-top-color:initial;border-right-color:initial;border-bottom-color:initial;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Dear colleagues:</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""> </span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">I am trying to identify missing public APIs needed to support a rich text control. There is a number of tickets created
already against various parts of JavaFX, collected in <a href="https://bugs.openjdk.org/browse/JDK-8300569" target="_blank">
https://bugs.openjdk.org/browse/JDK-8300569</a> , though I suspect this list may not be complete.</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""> </span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">If anyone has any suggestions or requests related to the new APIs, I would be very interested to learn the context, the
reason these APIs are needed, and whether a workaround exists.</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""> </span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Thank you in advance.</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""> </span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">Cheers,</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New"">-andy</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Courier New""> </span><span style="font-size:11pt"><u></u><u></u></span></p>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div></blockquote></div>