How to embed .ttf fonts in JavaFx 2.2?

Solution Approach I updated the sample from Javafx How to display custom font in webview? to demonstrate using a custom true-type font in JavaFX controls styled using CSS. Key points are: Place the font in the same location as your application class and ensure your build system places it in your binary build package (e.g. … Read more

How to embed a SWF file in an HTML page?

The best approach to embed a SWF into an HTML page is to use SWFObject. It is a simple open-source JavaScript library that is easy-to-use and standards-friendly method to embed Flash content. It also offers Flash player version detection. If the user does not have the version of Flash required or has JavaScript disabled, they … Read more

Embedding Image in Shiny App

I found another option that looks good for this app, so I’m sharing for others who want the image in the mainPanel. mainPanel( img(src=”https://stackoverflow.com/questions/21996887/myImage.png”, align = “right”), ### the rest of your code ) Save the file in a www directory in the shinyApp directory: | shinyApp/ | ui.R | server.R | www/ | myImage.png

How to embed fonts in HTML?

Things have changed since this question was originally asked and answered. There’s been a large amount of work done on getting cross-browser font embedding for body text to work using @font-face embedding. Paul Irish put together Bulletproof @font-face syntax combining attempts from multiple other people. If you actually go through the entire article (not just … Read more

How do I force files to open in the browser instead of downloading (PDF)?

To indicate to the browser that the file should be viewed in the browser, the HTTP response should include these headers: Content-Type: application/pdf Content-Disposition: inline; filename=”filename.pdf” To have the file downloaded rather than viewed: Content-Type: application/pdf Content-Disposition: attachment; filename=”filename.pdf” The quotes around the filename are required if the filename contains special characters such as filename[1].pdf … Read more