I am completely stumped right now. I am working on an AIR application, everything was working perfectly, I did some small changes to code (completely unrelated to fonts, components or anything of this kind) when suddenly, during testing, I am flooded with hundreds of warning: incompatible embedded font errors. I didn't change any project settings, didn't make any framework update, I tried Clean and restating Flash Builder.
Now, I am working on a project which uses modules and both MX (only Datagrid) and Spark components, so I am using two versions of font:
#font-face {
src:url("/assets/font/helvetica.otf");
fontFamily: "Helvetica";
embedAsCFF: true;
}
[...]
[Embed(source="../assets/font/helvetica_3.otf", fontFamily="Helvetica_2",
embedAsCFF="false", mimeType="application/x-font")]
private var _font_:Class;
As you can guess, Helvetica is for Spark components while the other one is for MX. Two curious errors:
warning: incompatible embedded font 'Helvetica' specified for spark.components::Label (countdown) . This component requires that the embedded font be declared with embedAsCff=true Isn't it already?
warning: incompatible embedded font 'Helvetica_2' specified for mx.controls.dataGridClasses::DataGridItemRenderer (DataGridItemRenderer501) . This component requires that the embedded font be declared with embedAsCff=false. Isn't it already too?!
These errors relate to MODULES which I import into the project (yes, my own). Text in the main air app works more or less fine (Diacritic characters are not displayed anymore). I am using additionally these command line parameters:
-isolate-styles=false (So skins and ANYTHING is actually applied to the modules, without it there are no errors, but modules have no styles)
-keep-all-type-selectors=true (Removing this doesn't help anyway)
Anyone had similar problem and managed to find the cause? I tried to undo last changes I made but without avail...
Update:
Well, weird enough I found the source of problem. In one of the module's components I imported class which is also imported by Main app, which resulted in problem. The funny thing is, it worked fine until I cloned the component to make a similar one, which isn't even imported to ANY of the modules yet. Once again Flex proved it's weirdness.
Related
I am working on a reactJS application that uses ant design for the UI. Recently we released this application to production where the computers are pretty locked down. This application is an intranet application and these computers have no internet access. So, because of that, the ant design icons on the modals were showing up as empty boxes. I did some digging and saw that the icons are using CSS classes.
For example, this is the CSS class for the red error "X" on the error modal:
.anticon-cross-circle:before
{
content:"\E62E"
}
I'm not too familiar with the CSS content attribute so I went to www.w3schools.com and read up on it a bit and tested this particular content value on their Try It page for this attribute and I got the empty box that I got in my production environment.
Does anyone know what needs to be done to import these icons into my project so that they can be used offline?
Thanks
What I think is happening is that Ant Design is defining the CSS font definition with a URL to the corresponding font-file. Since the computers are offline, it cannot find those definitions.
In the documentation I see that they also provide SVG Icons, which should work completely offline. I think this is worth a try. The steps to implement this can be found here and it should be available from version 3.9.0: https://ant.design/components/icon/#SVG-icons
Have you tried downloading the icon library into your project folder?
https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-react. Looks like they have assigned their own codes to their own icons so you'll need to have them offline.
You will nessd the css file tabler-icons.css and the woff file tabler-icons.woff and assign a font-family named tabler-icons within your style.css using #font-face
I have a large scale application that is developed using Angular 4, there seem's to be an rendering issue exactly as mentioned in this post Angular 2 Chrome DOM rendering problems
.When I navigate using router from one component to another
, while this question has an answer already , I am still unable to solve this issue.
My Application structure is as follows :
app-home --- > app-main --- > app-sub --- > <router-outlet> (contents)
Each of this selector imports same mixin file which is used to import #font-face , while the solution mentioned in the above mentioned post suggests to use parent component and use ViewEncapsulation.NONE , I cant do the same thing since there is a usage of the imported font face in each of these components app-home, app-main,app-sub and subsequent childs as well. When I remove the #import statement from the .less files I get an exception like
Variable #helvetica-bold is undefined
Is there a workaround to make my texts appear normally in chrome when I route from one component to another.
You need to make sure the font import is only called once.
Hence, you should remove all the font imports from the mixin file as you have already tried in your answer.
But, you also need to ensure the fonts themselves are still present once in your app where all views can access it. You probably have a file like 'app.less' or something similar, that contains styles that are available in all parts of your app. Cut the font-imports from your mixin, and instead place it in this file (make sure the path references are still valid, they might need to be adjusted). If you do not yet have such a file, you will need to create one and load it once on app start.
I just installed Angular Material to my new project and noticed that it throws over a hundred warnings in the Firefox console, mostly dropped declarations. Besided this, no errors at all. I tried this with a local file and a CDN link and the result is the same. Does anybody know what causes this and how to fix it?
It's for you so you can avoid using those declaration as they have planned to implement the new or changed name. I got those warning all the time and it means as long i stick to the same version i could forget about those warnings but if i upgrade i can be in trouble.
I'm creating a Flex 4 application which contains different modules in it. The main application contains a style sheet and the modules inherit the styles defined in this file.
Its working fine when the swf's are generated using Flash Builder. But when I'm generating it using Ant script, the modules does not inherit the styles and everything looks weird.
I added
isolate-styles="false"
as an additional parameter to mxmlc, but still its not working :(
Can someone please provide your suggestions?
I have never had to do anything special in regards to modules, flex and ANT but maybe I have been lucky. Or there is something else going on in your ant script. You can try being explicit and adding your css files via the compiler argument - [defaults-css-files filename , ... but that would be a brute force method forcing the styles to be recompiled into your module. Another option to help with debugging is to call getMergedStyleDeclaration() from your module so that you can compare the difference between Flash Builder and when ant builds the file. I am sure you have already read this document, but just in case, here is Adobe's information on modular applications.
If none of this helps please post some more detailed information around your current scripts and I can help from there.
Turned out to be a simple solution. All styles except fonts were inherited to the modules.
mx|Module{
font-family : "Myriad Web";
}
Needs to be added when built using ant. Flash builder generated swf's were working fine with out this additional style definition.
I had provided only
s|Application {
font-family: "Myriad Web";
font-size: 12;
font-anti-alias-type:advanced;
}
in the main style sheet.
I created an application which uses a custom font and it used to work for some reason. Now it doesn't recognize the font I included in the jar and it renders the text using the default font.
I really don't get it. When I run the application from Netbeans everything is OK.
Any ideas? I cleared the Java cache and everything but no luck. I am running JRE 1.6.0_20.
I even tried this guy's example and it does not work. It actually shows squares because of the font not found.
I hope someone has the solution.
JavaFX caches the fonts, so you must register the font before any use of the javafx.scene.text.Font class. Once you use the javafx Font classes, the system fonts are cached and it is never consulted again. Also, this is an AWT specific mechanism and will not work on platforms that support PRISM, like JavaFX-TV.