-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Provide a way to use custom fonts and ship a default icon font #522
Comments
Not sure if this is possible if SWT handles loading fonts differently than AWT? Will investigate... |
I can install a FA font like this:
It works. |
Why not set a user fonts folder and Archi scans it when starting for files ending with "OTF" or "TTF"? |
Great !
Yes, that was the idea. My only concerns/question is: do we ship FontAwsome (or any similar "icon" font) by default with Archi? Pro: this would allow users to easily add icons inside ArchiMate views and be sure that anybody would see the same thing with plain Archi. |
Note - The ligature icon does not export when exporting a diagram as SVG image from Archi. |
If the main idea is to use FA then we should only focus on shipping it with Archi and forget the general font path setting. In most other cases a user will install fonts in the OS themselves. Things to consider:
We could do a POC with just one icon replacing an existing figure icon (before we create the whole 60 icon set ;-)) |
;-) A good friend of mine explained me how to make it visible (who said "easter egg"?)
The main idea is twofold:
|
So let's try a POC with one icon and see how that works in Archi UI and exporting images. |
I have better than that! Here is a font created with icomoon which contains most icons from FontAwesome: Archi-FontAwesome-v1.0.zip I've set the name of the font to "Archi-FontAwesome" so that it doesn't conflict with potentially already installed fonts. In addition, starting with Archi makes sure it is on the top of the list. The ZIP file contains the font but also a demo page allowing users to see them and easily get the associated ligature. |
How do you reference one icon by a character code to use as an icon instead of the Draw2D code one we have now? (ligature doesn't export in SVG image) |
For this we have to use the character code. You can find it in the "demo.html" page included with the ZIP (under each icon you have the hexa code on the left and the actual character on the right). BWT, just to make it clear and avoid misunderstanding: this issue is not about using a font instead of some code to draw figure's icon, simply about helping people use an icon font anywhere they want (labels, notes...). As it is already possible for people to do so, they should already experiment the SVG issue, so I don't consider this a regression but a known "limitation". If we decide to use a font to draw figure's icon (and I'm going to create an issue for this), then we have to take care of SVG rendering and thus have to use character code instead of ligature. |
BTW - Doing some research, I discovered this small tool: WinFontsForAll. It can run without admin rights and will make any font usable without prior installation (I've just tested it on a "locked" computer and it works). So this is a potential workaround for users under windows. So, this doesn't impact my first requirement:
But this can lead us to challenge the second:
The use-case behind is to let people create more attractive views using better fonts and icons. Of course, a model should render the same way on all workstations in a team. I can see 3 different ways to address it:
|
Some update...
I now think the best way to do this is for me to create a custom plugin. This will provide more freedom for people who need it without adding yet another feature to Archi itself. I expect to share a first version of such plugin next week. |
OK, I'm ready to help with that. :-) |
And forgot to add another good icon to the list Numberpile. It works through ligatures, so you simply wrote something like Of course, this works with the help of other features like:
|
|
|
We work fast around here, anticipating everything... ;-) |
Well... I've just created a new plugin in https://github.com/archi-contribs/fontloader-plugin I've tried to load a font (through a local, hard coded path for the moment) in the Activator class but this doesn't work: I can get the DIsplay but when I try to load the font I get this error. It seems that this doesn't work in an Activator. Is there any other extension point I could use to load the font ?
|
I'm on it. Let's track this on that issue tracker... |
I often use FontAwesome icons in Archi to produce better looking diagrams. This used to be a bit difficult in the past, but this has been simplified a lot with the new version of the FontAwesome OFT/TTF which now use ligatures to make it as easy as writing
frog
to get a frog icon:The only issue is that this requires to install the font on every computer running Archi, which is, most of the time, not possible.
It seems that it is possible in JAVA to load a font and make it available to the applicationwithout having to install it in the OS. This would be a great solution in Archi.
I can see several ways of doing it:
Note: it is easy to create a custom font nowadays, so we could imagine creating an ArchiMate font containing official notation icons, and use it in Archi (instead of code based version as now).
The text was updated successfully, but these errors were encountered: