Smart Slider 3 - Add custom icon package? (Joomla3) - css

I'am trying to add a custom icon set to a joomla3 cms webpage, which uses the Nextend Smart Slider 3 Pro (V: 3.3.27-pro-r6010). On default the SmartSlider-backend only shows the built-in icon sets (Font Awesome 4, Icoomon, Linear, Material, Typicons).
What I've done so far:
I've already combined all custom-designed icons to an icon font (via IcoMoon App) and added al files locally like the default icons (./media/n2/n/icons/customicon/files/...).
Also added a manifest.json and readme.txt in the /customicon-folder (using code from /fontawesome as a template & customising them):
{
"id": "cicn",
"label": "CustomIcon",
"class": "cicn",
"isLigature": 0,
"prefix": "cicn-",
"data": {
"chefron_up": {
"name": "chefron_up",
"kw": "chefron_up, arrow"
}
}
}
Furthermore is added a customicon.css within ./media/nextend/customicon/... like:
#font-face {
font-family: 'customicon';
src: url(/webpage/media/n2/n/icons/customicon/files/customicon.eot?b8n2oe);
src: url(/webpage/media/n2/n/icons/customicon/files/hicustomicon.eot?b8n2oe#iefix) format('embedded-opentype'),
url(/hwebpage/media/n2/n/icons/customicon/files/customicon.ttf?b8n2oe) format('truetype'),
url(/webpage/media/n2/n/icons/customicon/files/customicon.woff?b8n2oe) format('woff'),
url(/webpage/media/n2/n/icons/customicon/files/customicon.svg?b8n2oe#hicustomicon) format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
div .n2i.cicn {
display: inline-block;
font: 1em/1 hicustomicon;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}
.cicn-chefron_up:before {
content: "\e900";
}
And there I start struggeling:
Right now in my smartslider-backend, I can see the customicon-title in my icon-list & there is the 'chefron_up'-title to choose (also visible in debugger), but the image/icon won't visually show.
Also I'am getting an warning message: Warning: filemtime(): stat failed for /Applications/XAMPP/xamppfiles/htdocs/webpage/media/n2/n/icons/customicon/files/customicon.min.css in /Applications/XAMPP/xamppfiles/htdocs/webpage/libraries/nextend2/nextend/library/libraries/assets/cache.php on line 66, which states:
protected function makeFileHash($file) {
return $file . filemtime($file);
}
I can't wrap arround my head, how to add the icon(s) to the backend/frontend of the Smart Slider Pro, to display them. Digged through the code (especially ./media/n2/n/dist/...) & also saw, that there is a icon.css.manifest within the /nextend-folder for every default icon-font, which includes a hash.
I'am personally a ux-designer and not a developer, so Iam quite stuck on this. Maybe somebody can help me, to get this working or can tell me, if there is an easier way to add an custom icon set to the SmartSlider3.
Appreciate any help.
Cheers.

Related

Can't import fontawesome-webfont typography

I am trying to import a font (fontawesome version 4.4.0's webfont) I have located in a directory called 'fonts' inside my project:
I have read several StackOverflow posts and I'm trying to import it using #font-face inside css:
#font-face {
font-family: 'MyWebFont';
src: url('../fonts/fontawesome-webfont.eot');
src: url('../fonts/fontawesome-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/fontawesome-webfont.woff2') format('woff2'),
url('../fonts/fontawesome-webfont.woff') format('woff'),
url('../fonts/fontawesome-webfont.ttf') format('truetype'),
url('../fonts/fontawesome-webfont.svg#svgFontName') format('svg');
}
And then using it in the body:
body {
margin: 0;
padding: 0;
font-family: 'MyWebFont';
}
However, it's not loading:
Any idea on why is this happening? I can actually see the expected font inside the files...
Thank you in advance.
Edit:
In the network tab in my browser's developer tools I can see the follwing info:
.
In the 'Response' tab inside Network, I get "failed to load response data". Maybe the problem is there?
Edit2:
Other fonts are being loaded just fine. For example, 'Raleway' (which is very similar, but not exactly the same. Notice the difference in the 'l'):
I am trying to get this font (I think it's Adobe's 'Proxima Nova', the same used in Fontawesome's site, that's the reason of the name)...
I think the problem is that font awesome is only for icons, not text.
If you go to fontawesome.com and remove this line of code:
.fa, .fas {
font-family: "Font Awesome 5 Pro";
}
You will see all the icons that have the class fa and fas will be just a rectangle.
You also need to give every element other fonts like:
.fab {
font-family: "Font Awesome 5 Brands";
}
.fa, .far, .fas {
font-family: "Font Awesome 5 Free";
}

materialize css btn class doesnt apply custom font

I'm working on an online store project and it needs a custom font. I'm using Materialize CSS framework in Angular 7, but btn class doesn't apply correctly custom font, anything else does. any help please friends!
I have tried custom btn class apply to style with !important, it does apply but damaged ways.
#font-face {
font-family: 'AcadNusx';
src: url('./assets/fonts/AcadNusx.woff') format('woff2'),
url('./assets/fonts/AcadNusx.woff2') format('woff');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'AcadNusx' !important;
padding: 0;
margin: 0;
}
a {
font-family: 'AcadNusx' !important;
}
.btn {
font-family: 'AcadNusx' !important;
}
and the template code is:
registracia
when I delete btn class from the button font apply correctly but there is no styling
please help, I need just to apply this font but btn style is making me headache. thanks for your attention.
best regards
AcadNusx is an 'unusual' Georgian typeset _
To display it correctly needs more #font-face information than you currently have in your CSS code _
According to the Fonts2U resource_ you need to upload (or install via Angular cli?) all 4 versions of the font to your fonts folder_ including .ttf,.woff,.eot,.svg _ then copy / paste the accompanying CSS code into your main CSS file or import the code as separate CSS _
The 4 versions of the font_ the CSS code_ and all the instructions you need_ are all included in the downloadable resource from: https://fonts2u.com/acadnusx.font

Different font weight for different fonts

I use Bold, Medium and Normal font weights on my website, that's 700, 500 and 400 respectively.
I use Helvetica Neue font and as a fallback for systems that doesn't have it installed I want to use Open Sans. The problem is Open Sans doesn't have Medium style.
I want my elements that I used to define as font-weight: 500 have font-weight: 600 if the browser uses Open Sans. Is it possible somehow?
There's a similar question at Stack Overflow: How to set different font-weight for fallback font? but I'cant get the result I need using techniqe described in an accepted answer.
I need something like
#font-face {
font-family: 'semibold';
src: 'Helvetica Neue':500, 'Open Sans':600;
}
Not sure how to do it though.
You can't really define weight in a font-face declaration. Instead, font-weight is used there as a gatekeeper to match the font and not to pass styles to the element.
It seems like overkill, but you could use this JavaScript function by Sam Clarke as a starting point to see if the font is available, and then conditionally modify the font-weight following the logic that works best for your specific requirements.
For a simplified example with just these two fonts, you might set up the CSS like this:
#font-face {
font-family: h-semibold;
src: local('Helvetica Neue');
}
#font-face {
font-family: os-semibold;
src: local('Open Sans');
}
.semibold {
font-family: h-semibold, os-semibold;
}
.w5 {
font-weight: 500;
}
.w6 {
font-weight: 600;
}
Then, using the function linked above, you put something like this in your JS to conditionally load the weight classes depending on font support:
var semibold = document.querySelectorAll('.semibold');
if (isFontAvailable('h-semibold')) {
semibold.forEach(result => {
result.className += ' ' + 'w5';
});
} else {
semibold.forEach(result => {
result.className += ' ' + 'w6';
});
}
You'll doubtless work out a more elegant solution if you really need to carry it through.

Some Icomoon icons won't display

I am using Icomoon in an application - I am having a problem with a small number of icons which will not display. I have downloaded all the icons via the Icomoon App and this is the latest version - all 450 are selected.
I have tried on just a blank page with no other CSS and they still don't work in case it was some CSS in my application causing it.
<link rel="stylesheet" type="text/css" href="/css/icons/icomoon/style.css" media="screen" />
<i class="icon-user"></i> User
<i class="icon-bars"></i> Bars
<i class="icon-search"><i> Search
In the above, bars displays fine but user and search do not.
Here is my style.css file (truncated):
#font-face
{
font-family: 'IcoMoon';
src:url('fonts/icomoon.eot');
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('fonts/icomoon.svg#IcoMoon') format('svg'),
url('fonts/icomoon.woff') format('woff'),
url('fonts/icomoon.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
[class^="icon-"],
[class*=" icon-"]
{
display: inline-block;
vertical-align: middle;
line-height: 1;
}
[class^="icon-"]:before,
[class*=" icon-"]:before
{
font-family: 'IcoMoon';
font-weight: normal;
font-style: normal;
speak: none;
-webkit-font-smoothing: antialiased;
}
.icon-users:before {
content: "\92";
}
.icon-bars:before {
content: "\b8";
}
.icon-search:before {
content: "\a0";
}
If I open up icomoon.svg (the only one I can "edit") then 92 and a0 are both there:
<glyph unicode="’" d="M734.994 154.626c-18.952 2.988-19.384 54.654-19.384 54.654s55.688 54.656 67.824 128.152c32.652 0 52.814 78.138 20.164 105.628 1.362 28.94 41.968 227.176-163.598 227.176-205.564 0-164.958-198.236-163.598-227.176-32.654-27.49-12.488-105.628 20.162-105.628 12.134-73.496 67.826-128.152 67.826-128.152s-0.432-51.666-19.384-54.654c-61.048-9.632-289.006-109.316-289.006-218.626h768c0 109.31-227.958 208.994-289.006 218.626zM344.054 137.19c44.094 27.15 97.626 52.308 141.538 67.424-15.752 22.432-33.294 52.936-44.33 89.062-15.406 12.566-27.944 30.532-35.998 52.602-8.066 22.104-11.122 46.852-8.608 69.684 1.804 16.392 6.478 31.666 13.65 45.088-4.35 46.586-7.414 138.034 52.448 204.732 23.214 25.866 52.556 44.46 87.7 55.686-6.274 64.76-39.16 140.77-166.454 140.77-205.564 0-164.958-198.236-163.598-227.176-32.654-27.49-12.488-105.628 20.162-105.628 12.134-73.496 67.826-128.152 67.826-128.152s-0.432-51.666-19.384-54.654c-61.048-9.634-289.006-109.318-289.006-218.628h329.596c4.71 3.074 9.506 6.14 14.458 9.19z" />
<glyph unicode=" " d="M992.262 88.604l-242.552 206.294c-25.074 22.566-51.89 32.926-73.552 31.926 57.256 67.068 91.842 154.078 91.842 249.176 0 212.078-171.922 384-384 384-212.076 0-384-171.922-384-384 0-212.078 171.922-384 384-384 95.098 0 182.108 34.586 249.176 91.844-1-21.662 9.36-48.478 31.926-73.552l206.294-242.552c35.322-39.246 93.022-42.554 128.22-7.356s31.892 92.898-7.354 128.22zM384 320c-141.384 0-256 114.616-256 256s114.616 256 256 256 256-114.616 256-256-114.614-256-256-256z" />
Additionally, in the demo html file created from the icomoon app all the icons from 7f (download) to a0 (search) show as blank - both the icons I am trying to use fall into this range.
Any idea why some will show but others will not?
The problem I encountered in IE11 & edge was that the uppercase variant was shown instead of the lowercase icon. This is because IE11/edge ignores the case when dealing with css-applied characters and just searches for the first 'match' in the font file.
As you can see in this picture, the lowercase 'g' maps to a trashbin-icon whilst the uppercase 'G' maps to a play-icon. IE11 & edge erroneously used the first uppercase variant.
You can test this possible cause by inspecting your font file using font forge and by explicitly declaring a "text-transform: lowercase/uppercase" in the css on the icon itself and see if that fixes it.
To ultimately fix this, I removed all uppercase letters from the icon font and re-mapped everything to other unicode characters and everything worked as expected. I found my solution in this article: Icon font behaving strangely in IE11
Did you try the solutions proposed in previous stackoverflow answers?
IcoMoon icons not working in Internet Explorer 8
Why does one of these font-face render in IE8, but the others don't?
Also, see http://adactio.com/journal/6555/
I found the solution. My problema was that just a few icons were not displaying at all, but after opening the html file that comes on the zip I saw those same icons were displaying correctly. So I saw the html and css and saw that to call the icon through a class the file was using to classes. The first one appears below the #font-face call that basically sets the style and family of the font, everything needed for the font to display correctly so call this class. The next example is using my classes and icomoon font files.
#font-face {
font-family:"icomoon";
src: url('fonts/icomoon.eot');
#font-face {
/*All the urls*/
}
/*THIS IS THE ONE YOU NEED TO CALL*/
.icomoon {
font-family: "icomoon";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/*Better font rendering ======*/
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
When you create a new icon with icomoon you get a preview before download. If an icon has a label of 'multicolor' will not display. I created some icons in illustrator and imported them to the app. As I had silhouettes in white and backgrounds in white, the icons were kind of broken and couldn't be used.
Had to use pathfinder to fix them and make it just one color, also having line strokes kills your icons.

Css Font won't import online

i have a imported css font with the following code:
#font-face
{
font-family: font;
src: url('myriad pro/myriad pro/MyriadWebPro.ttf'),
url('myriad pro/myriad pro/MyriadWebPro.ttf');
}
The problem is that online doesn't work but locally works.What is causeing the problem
Try renaming the file path, for example ---> "myriad-pro/myriad-pro/MyriadWebPro.ttf". Is your css file in the folder with the font. Check if your path is right.
P.S: Remove the bottom url (that on the third line.). When I use font-face I use only two. Example: font-family: Consolas;
src: url('Consolas.ttf');
#font-face
{
font-family: MyriadPro; /* just declares a font in your stylesheet */
src: url('myriad pro/myriad pro/MyriadWebPro.ttf'),
url('myriad pro/myriad pro/MyriadWebPro.ttf');
}
body
{
/* now you need to use it */
font-family: MyriadPro, sans-serif;
/* so name it something useful, instead of just "font" */
}
answering old questions
for those who come looking after

Resources