Is there a way to unload fonts loaded via loadFontFromList in flutter desktop application? - flutter

I'm making an application for Flutter Desktop and need to load and use the font files in the local directory.
The fonts were loaded through the loadFontFromList function.
But I couldn't find a way to unload the loaded font.
Is there any way to unload the fonts?

It looks like https://pub.dev/packages/font_face_observer (Font Face Observer package) has unload, which will likely do what you need.

Related

Why local package widgets not showing up time to time?

I have a ui package, this package simply contains some(10+) widgets and they are all just a widgets. None of them some complex controller or etc so when I use them, I can't miss the something like initializers or etc.
So my problem is, after the installation an app(which is contains a lot of witget from that package) everything working correctly like the image.
But if I change the current app on android/real device(and without debug mode), like switching the chrome and spend some time at the browser, after returning the app, all widgets showing off, they are simply dissappering. Like the image;
So my question is simple, why can it be happen? By the way, the divider as shown the middle of the page,is not part of the package, it is located in app/lib folder.
and lastly, I don't give any change but I have 57 svg file in the package but I am not call all of them at same time and their total size just 833,5kb, but maybe it can be related?
I don't have any native knowledge but if anyone can point me some tips, I will be glad.
Not really sure if it's a bug related to the new version of Flutter (3.0.2) but upgrading ext.kotlin_version inside android/build.gradle to 1.7.0 do the trick.

iphone epub reader how to change the font size/color programmatically?

I have seen many projects that reads epub files than parsing it to XML formats.
Some projects uses HTML to display the formatted ftext in a web view
Is there any way possible way to change the color/size of a font?
I think some are including Java Script files but still not sure...
Any framework that rcan help for epub content reading and customiziing....
ePub uses XHTML & CSS for content, so most (if not all) ePub readers will use a UIWebView.
Changing the font color & size, then, is simply a matter of fiddling with said UIWebView's stylesheets, whether through JavaScript or altering the XHTML/CSS files directly.

Custom font doesn't work in interface builder!

I've downloaded a font that's called "aldo the apache (.tff) " from dafont.com.
I used it with different programms like adobe illustrator and it seemed to work just fine.
Recently i tried to use it in a game that i'm making to experement. It didn't work -_-.
IB was displaying the font as a slightly bigger version of arial.
How can i solve this problem and get the font to display correctly?
If you have any suggestions, please post them down below.
-DD
You have to edit your <appname>-Info.plist file and create a new UIAppFonts key with type array, where each element is a String with the name of your font file, in this case AldotheApache.ttf. Then use the name in IB or with UIFont as it shows in the application Font Book app of your Mac, in your case Aldo the Apache. Obviously the font should also be added as a resource of your project.

How to Show a GPL licence in iphone application bundle

i am making an app for iphone and for that i am using certain free libraries.My problem is that i want to show their complete license of nearly 4-5 pages in my application bundle so that a user can open settings in iphone and see that licensing page at one time but i am unable to do it.I have read these Specifiers for making an application bundle .
PSGroupSpecifier
PSTitleValueSpecifier
PSTextFieldSpecifier
PSSliderSpecifier
PSToggleSwitchSpecifier
PSMultiValueSpecifier
PSChildPaneSpecifier
but i want to show a page full of text like Settings->General->About->Leagl
just like in iphone through PSChildPaneSpecifier .Please help me how to do this>???
Thanks
You can create the same effect as used by Apple's iWorks apps for the license > section of the settings, without using any custom preference controller. Note this works for iOS 5 on the iPad, I have not tried it elsewhere. Use a PSChildPaneSpecifier for the initial control in the root plist. This points to the name of another plist file which will be the displayed child pane. You do not add .plist to the name within the root.plist file, it is implied. This plist file must be within the settings bundle. Next, use PSGroupSpecifiers in the child pane as the controls. For each paragraph use another PSGroupSpecifier - so the thing will scroll. Only use the Title section of the PSGroupSpecifier. The next gotcha that I found, was that by putting the strings in the plist file, the text was clipped in portrait orientation, so a placeholder string needs to go in the plist file and a StringTable used to point to a strings file. Text read from the strings file is properly kerned and displays without clipping.
The iPhone's "Legal" page is a custom preference controller which you can't use (not even with undocumented methods – you need to write a preference bundle in system locations which AppStore apps can't reach at all).
If you'd like to display the license, show it in the app.
I think you are going to need to use something like a UITextView, just make it non-editable. You can make in unobtrusive in your app but I think that is the only way to have 4-5 pages.
I don't think there is a nice way of displaying this in the preferences bundle. Personally I would either provide a series of url links or bring the preferences into the app itself. There is a good framework on github here that you may be able to modify.

how to use custom font in html pages for UIWebView?

I am having the "Futura.ttf" font file.
I am displaying a HTML page in the UIWebView, but my requirement is that i want to use the custom font in my css file.
so is there any way that i can use the custom font in my css file ???
All suggestions are welcomed.
Thanks.
It is possible to load custom fonts into your UIWebView in iOS3.2 and above. Add the font to your bundle (see here) then just reference the font in your UIWebView's stylesheet like you would any other font:
<style type='text/css'>font { font-family: DroidSerif; } </style>
You have Cufon and sIFR as your options.
Typeface.js is a pure JavaScript Replacement
Cufon is a pure JavaScript Replacement
sIFR is Flash and Java font implementation,
FLIR JavaScript and PHP implementation
Some Comparisons
http://thatguynamedandy.com/blog/text-replacement-comparison
http://thinkclay.com/technology/cufon-sifr-flir
http://aaronwinborn.com/blogs/aaron/cufón-alternative-sifr-image-replacement
Below is taken from this question Worth reading the whole thread, has greatdetails.
Typeface.js
Advantages:
User doesn’t have to have Flash
plugin installed on their browser
Easier to create with just a few
lines of Javascript
For page loading it just needs to
load the Javascript
Disadvantages:
Text is not selectable because it
outputs it like an image. I looked at
some examples, right clicked on a
word and had to view as an image.
Every single word had this behaviour.
Big thumbs down.
Usage for body copy will slow down
loading time, so it is recommended to
use only for headlines.
Cannot be read by screen readers
Visual looks blurry
Not all browser compliant and still
has a lot of development left to be
done
sIFR
Advantages:
Can be read by screen readers as a
normal headline because it is a
behaviour layer on top of the markup
and styling.
Text is selectable
SEO friendly
Displays text as is like any other
web font. Crisp and not blurry!
Has addons like jQuery sIFR Plugin!
Disadvantages:
Requires Javascript to be enabled
Flash plugin must be installed in the
browser
Need Adobe Flash Studio to create it
BUT there is a pretty nifty sIFR
generator that creates the file for
you!
For page loading, it has to request
for Flash, Javascript and CSS files
attached to it, which can potentially
get bogged down if you are using sIFR
in too many places.
Cannot display on an iPhone. Yet…
Cufón (similar to Typeface.js)
Enter Cufón, the Javascript-based font replacement solution which makes heavy use of canvas and VML. This offers a great alternative to other solutions out there - no Flash or images required.
There are some issues with using Cufón on a live site, the most notable being the inability to highlight and copy/paste text, which is really the biggest issue for your site's users.
Combine that with the EULA issues, which prevent you from being able to legally embed fonts in Javascript files for most fonts on the market today.
The other issue is knowing what fonts can be used with Cufón. For sIFR, most fonts are fair game, since the font is embedded in a Flash movie, which is typically an approved usage by most font foundries for most fonts. With Cufón, the Javascript files used for the font can be easily "stolen" and either used on another website or reverse engineered.