Author Topic: Adding a line of UTF-8 symbols to copy from  (Read 1545 times)

0 Members and 1 Guest are viewing this topic.

Offline SensorcatTopic starter

  • Contributor
  • Posts: 45
  • Country: de
  • Freelance Sensor Consultant
    • Sensorberatung
Adding a line of UTF-8 symbols to copy from
« on: May 20, 2024, 12:19:17 am »
The greek letter Omega is included at the end of the list of icons in the post form, probably for aesthetic reasons, but it does not align with text:

some text  \$\Omega\$ more text

So no one uses it, most prefer to write 'ohm' instead. Earlier, introducing full math support was suggested, but not implemented because, as I understand, additional software would be necessary for that. Since UTF-8 is supported, I suggest to do something simple, which does not need additional software, and include a set of important UTF-8 symbols to the form. Placed above the text input box, they can be used for copy/paste into the text to be posted. The result aligns with normal text and does not need a graphical element inserted into the text (any more):

some text ° ± Δ ε Θ λ μ π Σ φ Φ ω Ω € £ more text
 
The following users thanked this post: srb1954

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6454
  • Country: fi
    • My home page and email address
Re: Adding a line of UTF-8 symbols to copy from
« Reply #1 on: May 20, 2024, 12:33:29 am »
Earlier, introducing full math support was suggested, but not implemented
Oh but it is, in the form of MathJax!  The only downside is that it does not render yet in the Preview.

For example, if you write \$ 150 \Omega \$, you get \$ 150 \Omega \$.  (Use \$ 150 \, \Omega \$ for \$ 150 \, \Omega\$.)

If you write
    $$ f(x) = \sum_{i=0}^{N} C_i x^i \tag{1}\label{NA_1}$$
you get $$f(x) = \sum_{i=0}^{N} C_i x^i \tag{1}\label{NA_1}$$
and can refer to it using \$\eqref{NA_1}\$, \$\eqref{NA_1}\$.  (The label prefix NA_ is just to allow the same tag in different posts, without mixing them up.)

I often use jbergknoff's MathJax Sandbox to preview my math expressions.  The difference there is that inline math expressions are bracketed by a pair of $ instead of a pair of \$ as here.  Both bracket full-line math expressions using a pair of $$'s.
« Last Edit: May 20, 2024, 10:35:39 am by Nominal Animal »
 
The following users thanked this post: pdenisowski

Offline SensorcatTopic starter

  • Contributor
  • Posts: 45
  • Country: de
  • Freelance Sensor Consultant
    • Sensorberatung
Re: Adding a line of UTF-8 symbols to copy from
« Reply #2 on: May 20, 2024, 12:48:19 am »
Oh but it is, in the form of MathJax!  The only downside is that it does not render yet in the Preview.
Perhaps my wording was not accurate. I have been using Latex many years ago, but I would not want to type an equation in source code, or use an additional tool just to assemble a post. So, with convenience for the user and simplicity in inpementation in mind, my idea was to make the most important symbols easily accessible, such that you can write e.g. 10MΩ, ±3V, or φ=30° both nicely and effortless if you want.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6454
  • Country: fi
    • My home page and email address
Re: Adding a line of UTF-8 symbols to copy from
« Reply #3 on: May 20, 2024, 01:27:47 am »
Sure.  I often use a Character Map utility (in Linux) to pick Unicode characters from various blocks, mostly Latin-1 Supplement, Greek and Coptic, General Punctuation, Superscripts and Subscripts, Letterlike Symbols, Arrows, Mathematical Operators, and Box Drawing (especially in [tt][/tt] and code blocks for simple tables), for use in my posts here.

I've been meaning to create a small static HTML tool page that contains them all in a nicely ordered table, where clicking on any copies it to a set (editable box) that is auto-copied to the clipboard for easy pasting to messages, because it'd be faster than the Gnome Character Map I currently have (on Cinnamon Desktop).  Just haven't bothered yet.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6454
  • Country: fi
    • My home page and email address
Re: Adding a line of UTF-8 symbols to copy from
« Reply #4 on: May 24, 2024, 09:27:23 am »
I started creating the glyph tool page, here, but started scratching my head how to best arrange all the characters to select from, and only added the non-letter Latin-1 ones for simplicity.

The idea is that when you click on any character, it is added to the text box at the top, and auto-copied to clipboard.  You can click on several ones to get a set, and simply Paste them in any other program or web site you have open at the same time.

It could easily be modified into an SMF extension, a floating tab that is shown and hidden using a single extra button in the SMF message edit dialog.  The glyph input box is then removed, and instead of clipboard, each click adds the glyph to the current caret position in the "message" textarea element.

If you look at the sources, there is a bit of CSS to tune the layout, a few lines of JavaScript to copy the selected glyph to the input box and clipboard, and an onload trigger (activate()) that converts all elements of type glyph into a button that copies the content of that element.  Yes, it is ridiculously simple.  So, to create your preferred set of glyphs, you only need to add a line per glyph, of form
    class="glyph">GLYPH</span><span
If you want to separate groups, just use </span>|<span or </span>
<span
.

I consider that page trivial; either non-copyrightable, or licensed under CC0-1.0 International (i.e. public domain: do whatever you wish, just don't blame me).
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1575
  • Country: ua
Re: Adding a line of UTF-8 symbols to copy from
« Reply #5 on: May 24, 2024, 09:33:07 am »
For example, if you write \$ 150 \Omega \$, you get \$ 150 \Omega \$.  (Use \$ 150 \, \Omega \$ for \$ 150 \, \Omega\$.)
One problem with it is that it seems to use not only a different font, but also a different (much larger) size:



While the inline latex support is pretty cool for more complex formulae, having a simple line of UTF-8 greek letters for copy-pasting would be very nice too.
 
The following users thanked this post: Sensorcat

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6454
  • Country: fi
    • My home page and email address
Re: Adding a line of UTF-8 symbols to copy from
« Reply #6 on: May 24, 2024, 11:45:18 am »
How about this?

Again, clicking on a character adds it to the input box, and entire input box is auto-copied to clipboard, ready for pasting into messages.

I probably should add a web font (Noto Sans? Open Sans? Noto Mono? Liberation Mono?) to ensure everyone sees all the glyphs; Windows users tend to have limited Unicode coverage in their fonts.
 
The following users thanked this post: bill_c

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1575
  • Country: ua
Re: Adding a line of UTF-8 symbols to copy from
« Reply #7 on: May 24, 2024, 05:45:08 pm »
How about this?
Looks great. This is exactly what we need to sit beside the reply edit form on the eevblog forum :)
 

Offline SensorcatTopic starter

  • Contributor
  • Posts: 45
  • Country: de
  • Freelance Sensor Consultant
    • Sensorberatung
Re: Adding a line of UTF-8 symbols to copy from
« Reply #8 on: May 24, 2024, 09:07:58 pm »
It appears to me that adding too many symbols contradicts the goal of convenience, because the search time in the list increases.

For instance, the box drawing symbols are not that needed for postings. Same for rarely used math symbols that are not common in engineering, e.g.: ≣ ⋙ ⋰

Since I registered only recently, I would like to know if it is actually beneficial to work this out? We can discuss this forever without effect, it only matters if Dave or one of the administrators picks it up.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6454
  • Country: fi
    • My home page and email address
Re: Adding a line of UTF-8 symbols to copy from
« Reply #9 on: May 25, 2024, 08:25:15 am »
It appears to me that adding too many symbols contradicts the goal of convenience, because the search time in the list increases.

For instance, the box drawing symbols are not that needed for postings.
I use them sometimes.  Especially for text diagrams in the programming sub-forum, they can be pretty useful.

That said, I simply added the set I myself might use.  Exactly which ones of them are useful, is definitely up to discussion; I might also have left out some that others find useful –– all Unicode emoticons included in Verdana (default theme font here) for example.

For example, we could argue that equation stuff is better expressed in MathJax, possibly excepting ≠ ≃ ≝ ≟ ≤ ≥, which are useful in text too.  Similarly, although superscripts come quite handy, subscripts are rarely needed and for those, MathJax is typically better.

Then again, not everything has to be in a single panel.  I, for example, would love to put the animated emoticons behind a similar pop-up button, so they wouldn't annoy me all the time.

As it is right now, anyone can use it right now, either opening it directly or saving it on their local machine, and keep open in a different window or tab, for pasting the glyphs to posts.  If you save it on your local machine, you can edit it –– just make sure your text editor uses UTF-8 –– and remove and add the glyphs you think you need, plus adjust its look to suit your tastes.  It's all in a single file which does not need a network connection to work: it is a HTML tool page.

Since I registered only recently, I would like to know if it is actually beneficial to work this out? We can discuss this forever without effect, it only matters if Dave or one of the administrators picks it up.
It depends if a suitable SimpleMachines mod exists or not.  Dave has installed useful mods before.  The SimpleMachines version used on this forum is shown at the very bottom of every page, and is 2.0.19 right now.

My core suggestion is to replace the always-visible Smiley buttons with one or more buttons that bring up panes of Smiley buttons.
One would be the current default set, one could be Greek characters, one could be the most commonly used Unicode glyphs, and so on.
That would require a new SimpleMachines mod, however.

There exists a Tabbed smileys mod, that sounds like it would work for this, though.
With that, Dave/Gnif/etc. would need to create a new Smiley Set, where the inserted text is simply the Unicode character.  In a Smiley form, each glyph will need a corresponding image icon (GIF seems most common, but I really prefer SVG for these for maximum quality).  For best visibility in all themes, they should have either a light background fill or a light halo around the black glyph.  I can generate these in SVG, optimized PNG, and/or optimized GIF, trivially, using the glyphs in the official Verdana font (preferred font in the default theme) or DejaVu Sans or Monaco or Lucida Console or Courier New (preferred monospace font for teletype and code blocks in default theme).  Scripting in Linux for the win. 😄 (= U+1F604, &#128516;.)

For example, right now the Omega smiley generates \$\Omega\$, which is silly.  It should generate &#937; instead, corresponding to U+03A9 = Ω.



The minimum set of Unicode glyphs I'd like to see would be
    Ω μ ° ± · × ≤ ≥ ≠ ∂ ∆ ϵ
and the set of Greek letters
    λ τ ω φ ϕ θ β

The first four are obvious, very often used in normal discussions.  (In fact, even MathJax recommends using the unicode degrees glyph instead of various ^o or ^\circ constructions.)  Middle dot · and times × are useful even in text, because one can write e.g. "2.5 m·s⁻¹ × 3.2 s"; and necessary if you describe a vector algebra operation, for example triple product a·b×c = a×b·c.

(The way "micro" (one millionth) SI prefix µ is often written as 'u', does bug me a little.  I do it myself, even; even though my keyboard happily produces it if I press AltGr + M.  Those without an AltGr key, it is the right-side Alt key, used to produce various character variants.  For example, AltGr + E produces € for me.  It depends on what keyboard layout you use, of course; I use Finnish.)

I often use ≤ and ≥ and ≠, but most end up writing them here in their C form, <=, >=, and !=.

∂ is the partial differential, ∆ is the Laplace operator and refers to increment (or "delta"), and ϵ is (lunate) epsilon most often referring to "so small that it is practically indistinguishable from zero".  Currently, in text, the first two are written as 'd', and the last as 'eps', which is confusing.
For example, when I discuss the rate of change in x as a function of time, it would be easy to write it as ∂x/∂t; a change in x as ∆x, and an insignificant difference to x as x±ϵ.

I personally often use the floor and ceiling characters, which I omitted, because I haven't seen others use them much.  Rounding x is properly written as ⌈x⌋, rounding x towards positive infinity AKA ceiling as ⌈x⌉, and rounding x towards negative infinity AKA floor as ⌊x⌋.  When I remember, I write these instead as round(x), ceil(x), floor(x), for clarity.

Of the greek letters, I commonly use λ for length/wavelength, τ for time, ω for angular velocity, and φ ϕ θ β for angles.  I'd guess that ∡φ would be pretty darn clear "shorthand" for "angle phi".  I use a few others in quantum physics, but such topics are rare here.

The wider question is, do others agree with my assumption/opinion that these would make posts more readable?
Or are they just 'elitist jargon', something we are simply used to because of our background education where they are commonly used?
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1575
  • Country: ua
Re: Adding a line of UTF-8 symbols to copy from
« Reply #10 on: May 25, 2024, 10:22:26 am »
The wider question is, do others agree with my assumption/opinion that these would make posts more readable?
Most definitely. After all, there is a good reason why they are (still) used in scientific and technical texts. The reason why they are not used sometimes is because of the effort it takes to type them.

Or are they just 'elitist jargon', something we are simply used to because of our background education where they are commonly used?
Even if so, this is a specialized forum where the use of these characters is justified and will improve the reader's experience. The writer's experience too, actually: I feel uneasy every time I type "u" for the "micro" prefix. Same for the "^2" and "^-1", etc. Sometimes I search for a specific utf-8 character to copy-paste it, when I have time and inspiration. It really would be nice to have all the common scientific/engineering special characters near the post editing text box, and it would encourage people use them more often.
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6454
  • Country: fi
    • My home page and email address
Re: Adding a line of UTF-8 symbols to copy from
« Reply #11 on: May 25, 2024, 11:25:11 am »
I definitely agree, Shapirus; and would even be willing to help with a Beginner forum post explaining their usage in terms everyone can follow, with links to detailed relevant information at Wikipedia and elsewhere for those wishing to know more.

Still, it is a valid question, the answer to which will subtly affect the content of posts in the future.

In fact, it would also make sense to install DejaVu Sans (as a backup for Verdana) + Bold/Italic/BoldItalic and DejaVu Sans Mono (as a backup for DejaVu Sans Mono and Monaco) + Bold/Italic/BoldItalic as WOFF2 webfonts.  AIUI, Verdana website license pricing is silly, but DejaVu font family is free; this would ensure these Unicode glyphs would be viewable by everyone without requiring they have these fonts installed on their systems.  I tried to explain this in this thread, but failed, even though I created a test page for doubters to test.  Due to the negative responses (by those who didn't bother to check the test page to see if their worries were even warranted, I guess), Dave/Gnif/et al. didn't participate or note that thread at all.

To use as a backup font, one would add a suffix to the font face name in CSS, say "DejaVu Sans Mono Webfont", and when specifying the font family, list the backup font after the locally installed one, ie. font-family: "DejaVu Sans Mono", "DejaVu Sans Mono Webfont", monospace; (with default monospace font as a backup if one has a rare-odd browser that doesn't support Webfonts).

The test page does not do this, and instead always uses the webfont version, to ensure every visitor sees what the page would look like if they didn't have the font installed on their device, and relied on the Webfont instead.  So please, don't take that as the recommendation of what should be done here.

The original TrueType font is 340k, WOFF2 version is 145k, and WOFF version is 200k, one of which is loaded by the browser but only if the primary font is not installed on the device.  Thus, we're not talking about a massive increases in download sizes, especially because these are static files and can advertise an aggressive caching policy.  (That way, clients will only send a HEAD request to check if a newer one is available if they already have a copy.)
 

Offline Tation

  • Regular Contributor
  • *
  • Posts: 60
  • Country: pt
Re: Adding a line of UTF-8 symbols to copy from
« Reply #12 on: May 25, 2024, 01:48:05 pm »
May I mention «Espanso» https://espanso.org/? This is the tool I use to insert characters not in my keyboard. E.g.: ω, Ω, ℧, », «, ∞, →, ⇒, ≠, …,

I'm using a Spanish keyboard. On it there's a key with little use, usually only used after a number (as in 3º) and well located: the º key (below the ESC key). With it is quite convenient to enter the previous characters as: omegaº, Omegaº, mhoº, >>º, <<º, infº, ->º, =>º, /=º, ...º

IMHO, definitely worths a try.
« Last Edit: May 25, 2024, 02:54:21 pm by Tation »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6869
  • Country: pl
Re: Adding a line of UTF-8 symbols to copy from
« Reply #13 on: May 25, 2024, 04:15:01 pm »
Not a bad idea. I would start with at least modifying the existing Ω button to properly insert Ω instead of \$\Omega\$ (for those suggesting MathJax - that's exactly what the Ω button currently does and why it looks odd).

Myself, I use Linux and have a bunch of custom compose sequences to insert Greek letters in all applications.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf