fontMenu function with submenus

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
OpenXTalkPaul
Posts: 2633
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: fontMenu function with submenus

Post by OpenXTalkPaul »

tperry2x wrote: Tue Aug 27, 2024 10:24 pm That's interesting. The IDE is obviously looking for that, as soon as I activated it and set a field to it, the script editor and message box start using it:
missing.png
Hmm, maybe that 'start using font' doesn't actually load the font resource into memory until it's actually needed to be used? I think I have my script editor using these fonts by default already (can't check right now).

Of course SourceCode Pro family is entirely monospaced!
Source Code Pro is a monospaced sans serif typeface created by Paul D. Hunt for Adobe Systems. It is the second open-source font family from Adobe, distributed under the SIL Open Font License. Wikipedia
The idividual file size limit for a file in a GitHub repo, I thought, was 100MBs (I think only that OpenGL file of Chromium CEF are that big, I have them zipped in the IDE repo), unless they've changed it. Maybe the 25MBs is the limit is only for the web interface? I'm using GitDesktop (the official UI app) to sync my repos (which I don't do often enough).

I don't know, for 'Guides' without using the Browser Widget, I think a simple stack interface that pulls content from a folder full of text (or .md) files with any images included, that gets placed on the card on the fly, or maybe generate a nice PDF manual from it, either may be a better way to go with the Guides than everything stuff into a large stack file like that. For static content PDF has the advantage that they can often be nicely compress with LZW/JPG.

As you know I'm biased about 'Guides' because I want Extension modules to continue to be able to add to the 'Guides' when they're installed, the package format supports this when you include an Docs folder, with a some readme.md text and some images in it, it gets packaged into the '.lce' file (the zip compressed package format).

But I have grown to like the simple .md text/page formatting as well. The markdown is in a format that displays very well on gitHub btw, it's actually the default format for making GitHub Pages (project web sites). The simplistic tagging makes it easy enough to write script to translate it into other styled text formats for placing into a field or into a web page or whatever.

BTW, I just installed XUbuntu 22.x on my sons really-old ASUS chrome-book style netbook thing, and had it running the RC3 .appImage downloaded from the GitHub Repo, the Browser Dictionary seems like it's OK on that (its a bit sluggish but it's an old underpowered Celeron-sort-of CPU so everything lags a bit).
TerryL
Posts: 114
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: fontMenu function with submenus

Post by TerryL »

RE Frequent Fonts List
My thought was choosing a font from either main or recent lists places it at the top of recent list for consistency, and often used fonts would stay near the top and lesser used would sink to the bottom and eventually off, the key feature.
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

TerryL wrote: Thu Sep 12, 2024 4:30 pm RE Frequent Fonts List
My thought was choosing a font from either main or recent lists places it at the top of recent list for consistency, and often used fonts would stay near the top and lesser used would sink to the bottom and eventually off, the key feature.
Yes, that's what my last version does - with the addition that if you choose the recent font above the divider line it doesn't try and put it back into the top part of that menu (because it's already there).
my last version does retain the last 10 fonts above the divider line too. The only thing it doesn't do (which I will probably add) is detect if each font in the recent font lists actually still exists - there should also be a check for that too in my opinion.
Screenshot at 2024-09-12 20-00-54.png
Screenshot at 2024-09-12 20-00-54.png (79.76 KiB) Viewed 5115 times
TerryL
Posts: 114
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: fontMenu function with submenus

Post by TerryL »

What about using a new preferences button to either clear or remove only missing fonts from the frequent fonts list?

Code: Select all

on mouseUp  --preferences btn "Reset Frequent Fonts", open source fonts: source sans pro, source serif pro, source code pro.
   local tFreqFonts, tFonts, tNewList
   answer "Clear the frequent fonts list or Remove Missing fonts from the list?" with "Cancel" or "Remove Missing" or "Clear" titled "Reset Frequent Fonts"
   if it = "Cancel" then exit to top
   else if it = "Clear" then    --clear list, add one open source font
      set the cFrequentFonts of btn "Fonts" to "Source Sans Pro"
      answer "The frequent fonts list has been cleared to default." with "OK" titled "Reset Frequent Fonts"
   else if it = "Remove Missing" then    --remove missing fonts from list
      put the cFrequentFonts of btn "Fonts" into tFreqFonts
      put fontNames() into tFonts
      repeat for each line i in tFreqFonts
         if i is among the lines of tFonts then put i &cr after tNewList
      end repeat
      delete char -1 of tNewList  --last cr
      set the cFrequentFonts of btn "Fonts" to tNewList  --new frequent fonts list
      answer "Missing fonts have been removed from the frequent fonts list." with "OK" titled "Reset Frequent Fonts"
   end if
end mouseUp
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

Can you produce a stack-demo version of this, as we can then tweak as needed.
I was thinking of also having the top 10 most recent fonts, sorted or unsorted. As a preferences, we could have:

Sort most recently used fonts: Alphabetically / No sorting.
Remember how many recently used fonts?: 10 (numeric input field or slider).
TerryL
Posts: 114
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: fontMenu function with submenus

Post by TerryL »

As requested, a stack demo of my suggestions for a frequent fonts list. Terry
Attachments
Freq Fonts Demo.zip
(3.37 KiB) Downloaded 89 times
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

Thanks Terry - Downloaded and will look this over when I get a chance. Many thanks.
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

Hi Terry.
Do you mean something like this?
I've yet to add in the 'clear recent fonts' as an option within that menu.
font-menu-in-ide.png
font-menu-in-ide.png (391.68 KiB) Viewed 3063 times
TerryL
Posts: 114
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: fontMenu function with submenus

Post by TerryL »

Exactly. Looks good. The btn "Clear Recent Fonts" was intended for preferences, not in the menu...but that's a good idea too. Whatever you think is better. No one has done more to advance oxt lite than you. Well done.
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

Thank you Terry.
I've added this and working well. Just want to test it on MacOS and Windows to be 100% sure I'm happy with it.

I've also snuck in a little addition - you can now refresh that font menu, instead of having to restart the entire IDE to see changes to the list of installed fonts. That might be further complicated by engine limitations, but I've to do some more testing on that...

I decided to put the recently added fonts at the very top of the menu (for quick access more than anything), then the options to refresh and clear them, then the entire fonts list underneath.

These recently used fonts also save to the preferences, and restore in the menu at IDE launch.
recent-fonts.png
recent-fonts.png (88.13 KiB) Viewed 3019 times
Edit: tested some more (MacOS 12)...
tested-more.png
tested-more.png (262.42 KiB) Viewed 2976 times
...and also tested on Windows 10. I'm happy that this is working as it should.
Screenshot (52).png
Screenshot (52).png (56.03 KiB) Viewed 2918 times
User avatar
richmond62
Posts: 4830
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: fontMenu function with submenus

Post by richmond62 »

That's really impressive . . . 1.09 or an update to 1.08?
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

Edit: Just tried installing a font while the IDE was open. Refreshed the menu, and the font appears in Linux - without restarting the IDE, so that's nice.
richmond62 wrote: Thu Nov 07, 2024 3:04 pm That's really impressive . . . 1.09 or an update to 1.08?
Up to you.
I do have the updated engine to include for Windows, so I'm thinking of releasing this as a full 1.09 download.
As I say, just want to test on a few platforms first.

I wonder if there's anything else to add before I do though? Anyone have any extra ideas for handy features they'd like to see in v1.09? If so, please place those comments here.
User avatar
tperry2x
Posts: 3208
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: fontMenu function with submenus

Post by tperry2x »

I've done this as an update, so people can try out the recent items in the fontmenu before v1.09 of OXT Lite.
I've tested this on MacOS 12, MacOS 10.9, Linux, and Windows 10 so far.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests