fonts

Change Font based on screen size change

痴心易碎 提交于 2020-01-07 02:33:22
问题 In my Java Swing application, I have buttons. If the screen size is changed, I want to change the font of my button text also. How do I implement it? 回答1: I believe that you need a JFrame window listener and simply change the button attributes there: //global JButton button1 defined earlier button1.setFont(new Font("<FONT NAME>", <FONT STYLE>, <FONT SIZE>)) 回答2: GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds() ? 回答3: Thanks to all, Based on listeners and frame size,

Custom Font on a Android Widget

女生的网名这么多〃 提交于 2020-01-06 21:06:49
问题 I'm trying to create a digital clock widget with custom typeface font. I got clues from here Solution was by extending TextView and put new attribute for custom font typeface. This is a good solution compared to drawing Canvas and Bitmap solution then pass it to RemoteViews. I followed every step, 1. create custom class CustomFont.java 2. define style in attrs.xml 3. then put it in main.xml but I got the following errors WARN/AppWidgetHostView(18681): updateAppWidget couldn't find any view,

Fonts not working on other Computers

走远了吗. 提交于 2020-01-06 21:03:56
问题 I just hosted my first website http://ianwinson.net and have the fonts customised in the html, but they are not showing up on other people's computers, just showing up as default text. This is what it looks like on my end: By the way, the way I am defining fonts is using font face and the <font> tag in html before the text. For the buttons I use font: face, but that's not working either:/. The fonts are Garamond, and Open Sans. 回答1: I have taken a look at your code. You're problem is that you

create image from character

心不动则不痛 提交于 2020-01-06 20:01:28
问题 I'm using standard styles for my Metro app. Most of these styles contains an Image and I wanna use Segoe UI Symbol s as these images. how can I achieve this? 回答1: You can insert the "character" in any text content that is using the Segoe UI Symbol as the font. If I wanted a Favorite's Star in a TextBlock, it would look like this... <TextBox x:Name="textBox" HorizontalAlignment="Left" Margin="372,375,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontFamily="Segoe UI Symbol"/> If I

how to set underline and color to partly text at one time on TextView?

我的梦境 提交于 2020-01-06 19:46:52
问题 I have a string in my EditText, and threre is an URL link in this string. So I want to set this link have underline and blue color as common sense. Now I can add underline by using "u" tag and Html.fromHtml(), but can't set color, this is my code: String text = "some string <u><font color=\"#0000FF\">some link</font></u>"; editText.setText(Html.fromHtml(text), TextView.BufferType.SPANNABLE); Can someone help me? Thanks! 回答1: I tried this on an emulator running Android 2.2, another emulator

Is is possible to overwrite the browser's default font-size in media queries using EMs?

眉间皱痕 提交于 2020-01-06 19:27:56
问题 A lot of people think that 1em = 16px . This is not true , 1em = value of your browser font-size which is most of the time 16px . While it is not common to change browser default font-size, it is still an easy to change setting. Given this situation, it is still easy to overwrite the em value from an HTML element perspective since it uses the top element's font-size. For example: html { font-size: 20px; } This simple style would cascade down to the rest of the document and 1em would

Are Android monospace fonts actually fixed size?

依然范特西╮ 提交于 2020-01-06 15:25:15
问题 I am using the Android Monospace font for my game and have found that the font does not behave as expected. The game relies on the top characters and the underscores below being lined up with each other as clues to solve the cryptogram. However when the word is very close to the edge of the TextView as can be seen on the 5th line shown in the image the blue line of text goes onto the next line causing the clues and answers to be out of sync. I'm using TextView.setTypeface(Typeface.MONOSPACE)

css font family issue, what if the font is not available on client side

倖福魔咒の 提交于 2020-01-06 14:10:27
问题 I have two website hosted on different server, there are elements that i have set the same font-family as 'TheSans', I am sure they both are not overwritten, the 'theSans' is the real and final value in css, but the font of these 2 pages just look differently with same browser. I checked on my pc and found that I don't have this 'theSans' font installed, so what actually happened there? if the browser does not find the font, what font it will use? why the behavior is different in same browser

fonts issue in productions envirnment rails

做~自己de王妃 提交于 2020-01-06 13:28:26
问题 I made an rails (4.2.4) app which work fine in development environment but when I deployed it on digital ocean it doesn't get fonts, with an error like Failed to load resource: the server responded with a status of 404 (Not Found) with path like http://Server-IP/assets/raleway-bold.woff2 I tried many combinations to provide path but all in vain except one, which works in development but not in production. I have little different structure for assets assets - fonts - javascripts - stylesheets

Android, how to display font awesome icons in layout edit mode?

牧云@^-^@ 提交于 2020-01-06 12:56:48
问题 I'm trying to add font awesome icons into my Android App, i found a solution here: https://stackoverflow.com/a/15762875/535556 But it display icons only after compilation of app and run on device. After that i found this plugin: https://github.com/bperin/FontAwesomeAndroid But it does not work for me.. I would like to display font awesome icons directly in layout because is it much faster that compile application to check that is displayed correctly. Many thanks for any advice. 回答1: Make sure