EzDevInfo.com

roboto

CSS/SASS codes and woff files for google's roboto webfont

Error With Google Webfont Not Loading Characters

On my site I am using the Google Font Roboto. I noticed in several places the following:� or what I call a question mark in a black diamond. (Does this symbol have a name?)

I typically see this when a font doesn't have a character it can render, however, this doesn't appear to be the case in this instance. It happens in a few instance. One of them is when there is an extra space the other I have seen is when I use the § symbol.

I tested Roboto using the § symbol with a type tester and it works just fine.

Why doesn't it work on my site? What is going wrong?


Source: (StackOverflow)

When using font Roboto in Android project, should I give attribution for it? [closed]

I would like to import font Roboto into my Android project. Do I have to give attribution for this font? Should I write some lines to credit someone for using it?

Download Link


Source: (StackOverflow)

Advertisements

Issues with Roboto library

Hey guys I'm having issues using this library:

https://github.com/johnkil/Android-RobotoTextView

in one of my projects (it works perfectly fine in my other projects) and I was wondering if you could make sense of this error log I'm getting:

Caused by: java.lang.NumberFormatException: Invalid int: "res/drawable-xhdpi/scrollbar_handle_holo_light.9.png"
            at java.lang.Integer.invalidInt(Integer.java:137)
            at java.lang.Integer.parse(Integer.java:374)
            at java.lang.Integer.parseInt(Integer.java:365)
            at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:122)
            at android.content.res.TypedArray.getInt(TypedArray.java:255)
            at com.devspark.robototextview.util.RobotoTextViewUtils.initTypeface(RobotoTextViewUtils.java:57)
            at com.devspark.robototextview.widget.RobotoTextView.<init>(RobotoTextView.java:62)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at android.view.LayoutInflater.createView(LayoutInflater.java:594)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
            at android.app.Activity.setContentView(Activity.java:1937)
            at com.MY.PACKAGE.NAME.OnboardingActivity.onCreate(OnboardingActivity.java:14)
            at android.app.Activity.performCreate(Activity.java:5248)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
            at android.app.ActivityThread.access$800(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5086)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)

I'm quite positive my grade is set up correctly (its the same config as my other projects for this library) but here's the line that compiles it:

compile 'com.github.johnkil.android-robototextview:robototextview:2.2.0'

and here is my use of it:

<com.devspark.robototextview.widget.RobotoTextView
        android:id="@+id/TV_onboarding_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="@dimen/large_text_size"
        android:text="Welcome"
        android:layout_marginTop="@dimen/margin_medium"
        android:gravity="center"
        android:textColor="@color/grey_darker"
        android:layout_below="@+id/IV_onboarding_logo"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        />

This code runs perfectly fine in a separate project so I'm really confused why I'm getting the error I am in this one. I even tried using a robototextview class in my project and it wouldn't work. I feel as though the error is in the layout.

All that my activity is doing is:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_onboarding);
    }

and the moment I delete all of the robotoviews the layout launches fine. Its also worth noting that the views render fine in the xml layout designer.


Source: (StackOverflow)

Does Roboto come standard in android studio?

Does the Roboto font family come standard in Android Studio? Or do I have to add it the way I would for eclipse?


Source: (StackOverflow)

Random characters when using the "Roboto Condensed" font in Chrome

Does anyone know why doesn't the "Roboto Condensed" font display correctly in Chrome 42 ?

chrome 42

The text at the top is supposed to display "Template: whatever" and "Change". Instead I get some random characters.

If I switch the font to anything else it renders correctly. FF is ok too.


Source: (StackOverflow)

Font-variant: small-caps rendered wrong for Roboto Condensed in Firefox only

I am trying to force small-caps effect on my company's website and everything works great except in Firefox (nevermind version).

Firefox renders Roboto and any other font properly - no problems with language-specific characters as long as font includes the charset, but as soon as I use Roboto Condensed - Firefox renders all chars as if they were small - even big are turned into small-caps, language specific chars are messed - no transform, or transforming small to big...

Website itself is not a problem, any live HTML/CSS tester gives the same effect:

<body> <p>Lorem Ipsum dołor sił Łamet</p> <p class="workingInFF">Lorem Ipsum dołor sił Łamet</p> <p class="notWorking">Lorem Ipsum dołor sił Łamet</p> </body>

https://jsfiddle.net/12ks6xd8/

Chrome does the job properly, as well as many IEs.


Source: (StackOverflow)

Spans don't work with RobotoTextView

I'm trying to apply 2 Spans to a RobotoTextView using:

private void setActionText(FacetCategory category) {
    String cat = category.getDescriptor();
    String sub = getContext().getString(R.string.filter_by_all_category_with_selected);
    final String source = cat + "\n" + sub;

    RobotoTypefaceSpan robotoTypefaceSpan = new RobotoTypefaceSpan(getContext(),
            RobotoTypefaceManager.Typeface.ROBOTO_BLACK);
    Spannable spannable = new SpannableString(source);
    spannable.setSpan(robotoTypefaceSpan, 0, cat.length() - 1,
            Spannable.SPAN_INCLUSIVE_INCLUSIVE);
    spannable.setSpan(new RelativeSizeSpan(1.5f), 0, cat.length() - 1,
            Spannable.SPAN_INCLUSIVE_INCLUSIVE);
    actionButton.setText(spannable, TextView.BufferType.SPANNABLE);
}

This is the view in xml:

<com.devspark.robototextview.widget.RobotoTextView 
    android:id="@+id/facet_action"
    style="@style/list_action"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:minHeight="48dp"
    android:padding="8dp"/>

And lastly the list_action style:

<style name="list_action" parent="body_1">
    <item name="android:textColor">@color/white</item>
    <item name="android:textSize">14sp</item>
    <item name="android:textAllCaps">true</item>
    <item name="typeface">roboto_condensed_italic</item>
</style>

The problem is neither RobotoTypefaceSpan nor RelativeSizeSpan work on the RobotoTextView, which remains with roboto_condensed_italic and a relative size of 1.


Source: (StackOverflow)

Modal Issue - Text keeps copying on open / close / open etc

I have an issue with a modal showing text.

The issue firstly is that for some reason my modal refuses to use the font i specify (Roboto Slab).

When i use the following, the modal all works ok EXCEPT the Roboto Slab font issue;

<a id="modal_a" class="modal" 
rel='nofollow' href="index.php?option=com_content&amp;view=article&amp;id=68&amp;Itemid=319&amp;tmpl=component"
rel="{handler: 'iframe', size: {x: 600, y: 450}}">read here</a>

However, when i use the following, all style issues are gone, i.e. Roboto Slab works ok. The only issue is each time you click on the modal, the modal opens and a copy of all text appears. Close and click again, a third copy of all text appears! etc.etc. I cannot see why it copies continually???

<a id="modal_a" class="modal" 
rel='nofollow' href="index.php?option=com_content&amp;view=article&amp;id=68&amp;Itemid=319&amp;tmpl=component">read here</a>

Is anyone aware why? All i want is a modal that displays text BUT retains my style sheet thus fonts match the rest of my website.

I also added this to my component.php file before template.css as i noted in firebug, the 'Roboto Slab' font was not uploading.

<link rel='nofollow' href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' 
rel='stylesheet' type='text/css'>

This still did not work.... Very FRUSTRATING!

Your support is welcomed and appreciated.

Tony


Source: (StackOverflow)

Android Black Roboto font style

I would like to apply Black Roboto on a specific TextView. I defined a style, but I don't know how to set Black Roboto ?

In styles.xml file, I have this style:

<style name="IntroTitle">
    <item name="android:textSize">48sp</item>
    <item name="android:textStyle">normal</item>
    <item name="android:textAllCaps">true</item>
</style>

in my layout.xml:

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/title"
    style="@style/IntroTitle"
    android:textColor="@android:color/white"
    android:text="@string/intro_title_screen_1"/>

Thanks by advance


Source: (StackOverflow)

Android TextView custom typeset causes gravity to stop working

Update

This only appears to be happening with Roboto-Italic.ttf. If you're running into this issue, try another font family.


I'm running into an odd issue when applying a typeset to a TextView. The app name, "Contact" is in a LinearLayout with android:gravity="center" set, which causes it to be centered nicely as seen in the "Before" image below. When I set the typeface, it causes the gravity to stop working for some reason. This is how I'm setting the typeface:

tvAppName.setTypeface(
  Typeface.createFromAsset(getActivity().getAssets(),"fonts/Roboto-Italic.ttf"));

Any idea why this might be happening? I've tried setting the gravity programmatically, but that didn't help. Commenting this one line causes the text to go back to being centered.

Before

Imgur

After

Imgur


Source: (StackOverflow)

Use Roboto font in IE 11 / Edge

I want to use the google Roboto font, but it looks like very ugly in IE11 / Edge. Here is my example code:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel='nofollow' href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
    <title></title>
</head>
<body>
<div style="font-family: 'Roboto'">
    közötti műveleteire.
</div>

The upper text shows in IE/Edge, the lower is the Chrome version. (The letter ű is very ugly) How can I use Roboto correctly in IE?


Source: (StackOverflow)

As the Roboto font family is updated, do its metrics ever change?

As pointed out here and here, Google updates the Roboto font periodically to respond to criticism, add glyphs, improve legibility, and so on. Are the metrics locked? Do any of these changes cause text to flow differently?

In other words, can an Android app that's compatible with ICS (API 14) and up use Roboto for its text and trust that the labels will take the same amount of space on ICS and Lollipop? Provided, of course, that the screens have the same properties (dpi, dimensions, resolution, etc.)

A system font is effectively part of a windowing system's public API. If the metrics change, then an app which is coded to expect a piece of text to fit within a certain box may break.

The Roboto font is as fundamental to Android as Arial and Verdana are to Windows. As Microsoft puts it,

Note that some values associated with UI fonts and default fonts used in Microsoft apps are locked. UI fonts are used to render UI elements like captions, dialogs, and menus. Very few changes are made to these fonts, given their high visibility and frequent use.


Source: (StackOverflow)

Using different weights of Roboto in modern Android Studio

I believe having read or heard that Roboto now comes standard with Android Studio and that I no longer need to download the font. So how might I use it in my xml layouts presently? I am particularly interested in using many different weights such as bold, light, thin, etc. So, how might I go about doing that presently? The entire app will use Roboto only. But different TextViews, etc, will have use different weights. Thanks.


Source: (StackOverflow)

Firefox - Google fonts, greek won't work with Roboto

you can check the following snippet, the issue is that Roboto will not show properly on firefox on greek characters.

body {
  font-family: Roboto, sans-serif;
}
<link rel='nofollow' href="http://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">


<h1>This is a test</h1>
<h1>Αυτό είναι ένα τεστ</h1>


Source: (StackOverflow)

google font Roboto, difference between Firefox and Chrome, ONLY MY PC

Using a Windows operating system, ONLY ON MY PC you see the difference? (see photo) Google Chrome is the same character on Roboto Roboto Condensed. Why? I do not understand. ONLY PROBLEM ON MY PC FIXED ONLY ON CHROME http://i.stack.imgur.com/QWO2Q.jpg


Source: (StackOverflow)