geta / epi.fontthumbnail Goto Github PK
View Code? Open in Web Editor NEWOverride to the built in "ImageUrlAttribute" that is used to specify preview images for the different contenttypes in your Episerver project.
License: Apache License 2.0
Override to the built in "ImageUrlAttribute" that is used to specify preview images for the different contenttypes in your Episerver project.
License: Apache License 2.0
We have an issue with the roles set on the controller, because some of our editors has limited access and none of the goups applied to day.
It would be nice to have an extra group like ThumbnailGroup, that you can use to set access rights with.
[Authorize(Roles = "Administrators, CmsAdmins, CmsEditors, WebAdmins, WebEditors, ThumbnailGroup")]
Same code works differently locally and in cloud (Azure AppService). Some thumbs won't load in Azure, everyone works locally. Same ttf-file locally and on Azure.
Used like this, won't work on Azure:
[ThumbnailIcon("fa-light-300.ttf", 0xf015)]
Used like this, works on Azure:
[ThumbnailIcon("fa-light-300.ttf", 0xf1ea)]
Error:
Parameter is not valid. at System.Drawing.Bitmap..ctor(String filename)
Seems like some icons works to generate thumbnails from, and some won't.
Some files seems to be zero sized too.
It seems like new Bitmap(path)
won't work reliably in Cloud see here and here since .
Error exists in FontThumbnailService.cs.
Proposed fix might be changing this, if new Bitmap
works best with stream
instead of path
:
if (File.Exists(cachePath))
{
using (var bmpTemp = new Bitmap(cachePath))
{
return new Bitmap(bmpTemp);
}
}
to this (dummy-coded):
if (File.Exists(cachePath))
{
using (StreamReader sr = new StreamReader(cachePath))
{
using (var bmpTemp = new Bitmap(sr))
{
return new Bitmap(bmpTemp);
}
}
}
Using CustomFont
on ThumbnailIcon
and adding <add key="FontThumbnail.EnableTreeIcons" value="true"/>
in web.config
doesn't generate any tree icon.
I have the FontAwesome PRO-set and are using it like this:
[ThumbnailIcon("fa-light-300.ttf", 0xf022)]
for the list-alt
icon in FAL
.
Configured like this:
<add key="FontThumbnail.BackgroundColor" value="#0b496e" />
<add key="FontThumbnail.ForegroundColor" value="#ffffff" />
<add key="FontThumbnail.FontSize" value="40" />
<add key="FontThumbnail.CustomFontPath" value="Assets\vendors\" />
<add key="FontThumbnail.EnableTreeIcons" value="true"/>
Of course I can use two attributes to get it to work with the wrong font.
[ThumbnailIcon("fa-light-300.ttf", 0xf022)]
[TreeIcon(FontAwesome5Regular.ListAlt)]
But it would be nice if it was possible to do something like adding a third parameter for Page Tree Icon-fallback:
[ThumbnailIcon("fa-light-300.ttf", 0xf022, "fal fa-list-alt")]
Or supporting adding class as free text in TreeIcon
[TreeIcon("fal fa-list-alt")]
The free text "thingy" would make completely different icon fonts (not only adding support of FontAwesome PRO) usable in page tree too, as you already solved for thumbnail icons in ThumbnailIcon
-attribute by having ttf
-reference and charcode
-support... ๐
I've noticed that some icons are missing. For example:
I haven't had time to make a proper diff with the official list of icons but more are probably missing.
Thanks for a great plugin!
Hi,
We are using Epi.FontThumbnail on a EPiServer site (version 10.4.2) and sometimes when we build via TeamCity to a Windows 2016 server we get an error saying the font file fontawesome-webfont.ttf is locked by the SYSTEM process. We then have to do an iisreset and delete the font to get it to build again. This only happens rarely (three times so far in about a months time).
I have found the following Stack Overflow thread, but it does not give a solution to the issue:
http://stackoverflow.com/questions/27677285/font-file-is-being-held-by-system-process
Is it possible to embed the font file in the assembly or similar to avoid this issue?
would it be possible to update the fontawesome font to latest version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.