Log message: org.geotools.renderer.style: null input stream, could not load the font - geotools

Currently I am migrating a project to Java 11. In this project, we are using GeoTools to create a PDF file with geometries inside. For this PDF file we use a special font which is not available in the system. Since Java 11 we store this font in the resources and load it at runtime. Since the migration to Java 11, the following message appears in the log:
org.geotools.renderer.style: null input stream, could not load the font
However, the PDF file is created without any problems. The font is loaded via Spring Boot using #Value as resource. The font is created as follows:
PDFont fontSourceSansProBold = PDTrueTypeFont.load(doc, ressourceSourceSansProBold.getInputStream(), WinAnsiEncoding.INSTANCE);
Has anyone had similar problems before? What was the solution, if any?
Thank you!

Related

How can I open and display an html file that has been stored locally on the device in Flutter Dart?

I am writing an app in Flutter to run on Android and IOS Smart Phones. It will have a number of html files and .pngs that are stored locally (somewhere on the actual smartphone). When a text label is returned from an ML Image labeling capability in the app, I want it to open and display the html file that corresponds to the label. For example, if I photograph a car, the ML Image Labeller returns the label 'car', and the app then displays an html file called car.html (that is stored on the phone just in case of no internet access). The display of the .html file could be inside the app UI or launched as a separate webview.
I have played with url_launcher, inappwebview, and webview - but I do not know which is easiest for loading and opening a .html file stored locally on the device. Can anyone advise me, please?

Convert ttf to swf

I am using a online flash app and users can upload their own fonts to create a text of their own , I have tried lot of libraries to convert it to register the font in my application , i am hopeless , any help would be appreciated
You should try this library: FontReader. It seems to be an in-memory font parser that's supplied a ByteArray and parsed it according to TTF specification. Usage instructions are not provided, but still it's a start on how to get your fonts embedded. Note that it uses a SWF compiler to get the font into your SWF, so it should be available to receive a TTF file, process it and then receive a Font object to be used with your SWF.

Beginning with D3.js and parallel coordinates

I would like to use the parallel coordinate toolkit from syntagmatic.github.io/parallel-coordinates/#.
As I am new to the D3.js framework, I am encountering some trouble to begin and visualize data locally.
What I am trying to achieve is to use one of the standalone HTML examples (e.g. brushing.html) and edit the data table with my own data.
I stored locally (in a Windows folder):
the brushing.html example file
the cars.csv file
the D3.js library files from d3js.org (d3.min.js and d3.js)
When I load the HTML file in my browser, only the text displays, not the parallel coordinates themselves.
What am I missing/doing wrong? Should I be able to display locally the same result as what appears in brushing.html?
I checked out several tutorials for D3.js, but they generaly skip these preliminary requirements step. Thanks for any feedback.
Thanks to the straightforward comment to my question, I was able to identify the issues checking the browser's console.
It mainly came down to redefining paths to the different files, and eventually downloading the missing packages from the corresponding Github page https://github.com/syntagmatic/parallel-coordinates
I can now test the tool locally with custom data.

Unable to open json file as it exceeds the 5 MB limit for the JSON editor

For my Windows 8.1 universal app, my source data stored in JSon file exceeds the 5MB limit for the JSON editor and therefore my app fails to initialize. Now I cannot run both my Windows phone 8.1 and Windows 8.1 app. Also, now when I open my JSON file for editing, the VS 2013 JSON editor does not allow me to add more data to it. Anyone encountered this issue before? Any idea on how to increase the 5MB limit, or split the file into multiple files, and yet let the application use it as one big JSon file?
Added the feedback about this issue to Microsoft Connect feedback portal: https://connect.microsoft.com/VisualStudio/feedbackdetail/view/1465015/unable-to-open-json-file-as-it-exceeds-the-5-mb-limit-for-the-json-edito.
Looks like this is an VS issue. VS does have a 5MB limit on Json file size. See the related thread: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/c3ecf2b2-ab00-4983-8c81-cd33e35ee4c2/unable-to-open-json-file-as-it-exceeds-the-5-mb-limit-for-the-json-editor?forum=visualstudiogeneral

Downloading and replacing file in package

In my Visual Studio 2013 Solution, I added a folder "mAppData" with some static Content for the app.
One of the files is a Textfile ("imprint.txt").
On a phone page, I Display the content of this file. This works fine.
Is there a way to replace this file on runtime? I want to download new Content from web and replace this file with the downloaded content.
rather than downloading and replacing the "imprint.txt" you could simply download the imprint as text (from your imprint.txt - stored online) and display it:
var client = new System.Net.WebClient();
client.DownloadStringCompleted += (sender, args) => MessageBox.Show("downloaded imporint: " + args.Result);
client.DownloadStringAsync(new Uri("http://yourSite.ch/imprint.txt"));
My sample simply shows a MessageBox with the downloaded text. However, you can update a text control or similar.
If you want the content to be available even if you are temporary offline, you can store the file in the filestorage.
Consider adding multiple files for different languages in your build and load the file depending on the localization of your phone.
However - replacing a existing file for your Solution is not allowed on runtime. Consider this as a safety feature. If the Codebase of your app could change during runtime, your code would be injectable by an attacker.
You can't alter the package content at runtime, it is read-only.
The place where you can store data locally is the Isolated Storage. What you should do is create a file in the Isolated Storage at first launch that stores the original content of your file ("imprint.txt") and then you'll be able to change it any time you want.
Here is a tutorial that explains how to read and write text in the Isolated Storage: All about WP7 Isolated Storage - Read and Save Text files