Search Results

Search found 55 results on 3 pages for 'typeface'.

Page 1/3 | 1 2 3  | Next Page >

  • Using Typeface.js within a GWT app

    - by dindeman
    I am looking for some sample Java code demonstrating how to get AJAX content displayed into a custom font using Typeface.js within a GWT app. I have tried a little bit by calling the following native function native void Typeface_renderDocument() /*-{ $wnd._typeface_js.renderDocument(); }-*/; after having filled the relevant widget with the AJAX content, and after calling the following function on the widget : void applyTypeface(Widget widget) { widget.addStyleName("typeface-js"); widget.getElement().getStyle().setProperty("fontFamily", "Helvetiker"); Typeface_renderDocument(); } ...where Helvetiker is a custom font (actually available from Typeface.js fonts page (http://typeface.neocracy.org/fonts.html). But that didn't work. I am looking forward to any suggestions since I am bit stuck here. Alternatively I would be interested in an example using cufón within GWT, although I am not so keen about the replacement by images that cufón does (which is the main reason why I was trying to use Typeface.js.)

    Read the article

  • SIFR vs Cufon vs Typeface.js

    - by Abi Noda
    With browser support / licensing issues of @font-face (a feature of CSS3), which intermediate option do you prefer? Cufon,Typeface.js, or SIFR? Cufon is new but has been getting a lot of praise from the web design community, how does it differ from Typeface.js ?

    Read the article

  • Android : Typeface is changed when i apply password Type on EditText

    - by wawanopoulos
    I use FloatLabel library (https://github.com/weddingparty/AndroidFloatLabel) to add a little animation when user begin to write something in an EditText Android. My problem is that the typeface seems to be changed when i apply the password type to my EditText. I would like to keep the same typeface as normal. (see picture 1) But when i add the following line to apply password type, the typeface of hint seems to be changed ! pass.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);

    Read the article

  • Gujarati Font Rendering

    - by Vishal Khakhkhar
    I am having sqlite database containing gujarati words.. The sql query for the database is... BEGIN TRANSACTION; CREATE TABLE eng_guj (_id INTEGER PRIMARY KEY, eng_word , guj_word ); INSERT INTO eng_guj VALUES(1,'aardvark','??? ??????? ?????????? ?? ?????? ????? ??????.'); COMMIT; I want to display the text in textview.. but its not rendering properly.. meant Its displaying the word in gujarati like "???????" will be displayed as "??????". I already have used Typeface and different ttf fonts.

    Read the article

  • What font does Google Chrome address bar use?

    - by eSKay
    If it matters, here are the specifications of what I am using: Google Chrome 5.0.322.2 (Official Build 38810) unknown WebKit 533.1 V8 2.1.0.1 User Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Chrome/5.0.322.2 Safari/533.1 thanks!

    Read the article

  • AndEngine GLES2 - getting Black screen on emulator 4.1

    - by dizworld.com
    I'm new in andengine . I create following code public class MainActivity extends BaseGameActivity { static final int CAMERA_WIDTH = 800; static final int CAMERA_HEIGHT = 480; public Font mFont; public Camera mCamera; //A reference to the current scene public Scene mCurrentScene; public static BaseActivity instance; public EngineOptions onCreateEngineOptions() { instance = this; mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera); } @Override public void onCreateResources(OnCreateResourcesCallback arg0) throws Exception { mFont = FontFactory.create(this.getFontManager(),this.getTextureManager(), 256, 256,Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 32); mFont.load(); } @Override public void onCreateScene(OnCreateSceneCallback arg0) throws Exception { mEngine.registerUpdateHandler(new FPSLogger()); mCurrentScene = new Scene(); Log.v("Scene","enter"); mCurrentScene.setBackground(new Background(0.09804f, 0.7274f, 0.8f)); // return mCurrentScene; } @Override public void onPopulateScene(Scene arg0, OnPopulateSceneCallback arg1) throws Exception { // TODO Auto-generated method stub } } I got code on sites there is returning scene but in AndEngine GLES2 in method onCreateScene() there is no return scene ... so my First run is BLACK .. any suggestion :)

    Read the article

  • Setting WPF RichTextBox width and height according to the size of a monospace font

    - by oxeb
    I am trying to fit a WPF RichTextBox to exactly accommodate a grid of characters in a particular monospace font. I am currently using FormattedText to determine the width and height of my RichTextBox, but the measurements it is providing me with are too small--specifically two characters in width too small. Is there a better way to perform this task? This does not seem to be an appropriate way to determine the size of my control. RichTextBox rtb; rtb = new RichTextBox(); FontFamily fontFamily = new FontFamily("Consolas"); double fontSize = 16; char standardizationCharacter = 'X'; String standardizationLine = ""; for(long loop = 0; loop < columns; loop ++) { standardizationLine += standardizationCharacter; } standardizationLine += Environment.NewLine; String standardizationString = ""; for(long loop = 0; loop < rows; loop ++) { standardizationString += standardizationLine; } Typeface typeface = new Typeface(fontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal); FormattedText formattedText = new FormattedText(standardizationString, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, fontSize, Brushes.Black); rtb.Width = formattedText.Width; rtb.Height = formattedText.Height;

    Read the article

  • To make the drawn text clear

    - by user1758835
    I have written the code to draw text on the image and to save the image,But the text which I am drawing is looking blur on the image.What modifications need to do to make it clear,Or if there is any other way to draw text on image in android Canvas canvas = new Canvas(photo); Typeface tf = Typeface.create(topaste, Typeface.BOLD); Paint paint = new Paint(); paint.setStyle(Style.FILL); paint.setTypeface(tf); paint.setColor(Color.WHITE); paint.setStrokeWidth(12); canvas.drawBitmap(photo, 0, 0, paint); canvas.drawText(topaste, 15, 120, paint); image.setImageBitmap(photo);

    Read the article

  • Android programming. Application stopped unexpectedly.

    - by user277704
    I've just created a prototype of interface for my android app and tried to run it. Unfortunately I get an error that my app has stopped unexpectedly (my reputation doesn't allow me to post images so follow my links): screenshot of error message This is layout mode of editing. Everything looks as I want so there shouldn't be errors: mobileka.freehostia.com/3.png (I can post only one hyperlink...) This is my main.xml code: <code> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" android:background="@drawable/back" > <TextView android:id="@+id/score" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text = "@string/scoreT" android:textColor="@string/scoreColor" android:gravity = "left" android:typeface="serif" android:textStyle="bold|italic" android:textSize="16sp" android:paddingLeft = "10px" android:paddingTop="4px"/ <TextView android:id = "@+id/scoreTxt" android:layout_toRightOf="@+id/score" android:textSize="16sp" android:paddingTop = "5px" android:paddingLeft="4px" android:typeface="serif" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 0" android:textColor="@string/scoreTextColor" android:gravity = "left"/> <TextView android:id = "@+id/scoreSeparator" android:layout_toRightOf="@+id/scoreTxt" android:textSize="16sp" android:paddingTop = "3px" android:paddingLeft="4px" android:typeface="serif" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="|" android:textColor="@string/scoreColor" android:gravity = "left"/> <TextView android:id = "@+id/timerTxt" android:layout_alignParentRight="true" android:textSize="16sp" android:paddingRight="10px" android:paddingTop="4px" android:typeface="serif" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@string/scoreTextColor" android:gravity = "right" android:text="00:00" /> <TextView android:id = "@+id/timer" android:layout_toLeftOf="@+id/timerTxt" android:textColor="@string/scoreColor" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16sp" android:padding = "3px" android:typeface="serif" android:textStyle="bold|italic" android:text="@string/timerT" android:gravity = "left"/> <TextView android:id = "@+id/timerSeparator" android:layout_toLeftOf="@+id/timer" android:textSize="16sp" android:paddingTop = "3px" android:paddingLeft="4px" android:typeface="serif" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="|" android:textColor="@string/scoreColor" android:gravity = "left"/> <ImageButton android:id="@+id/buttonOne" android:layout_below="@+id/score" android:layout_marginTop="40px" android:layout_marginLeft="14px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/inactive"/> <ImageButton android:id="@+id/buttonTwo" android:layout_toRightOf="@+id/buttonOne" android:layout_marginTop="63px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonThree" android:layout_toRightOf="@+id/buttonTwo" android:layout_marginTop="63px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonFour" android:layout_toRightOf="@+id/buttonThree" android:layout_marginTop="63px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonFive" android:layout_below="@+id/buttonOne" android:layout_marginTop="40px" android:layout_marginLeft="14px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonSix" android:layout_toRightOf="@+id/buttonFive" android:layout_marginTop="164px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonSeven" android:layout_toRightOf="@+id/buttonSix" android:layout_marginTop="164px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonEight" android:layout_toRightOf="@+id/buttonSeven" android:layout_marginTop="164px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonNine" android:layout_below="@+id/buttonEight" android:layout_marginTop="40px" android:layout_marginLeft="14px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonTen" android:layout_toRightOf="@+id/buttonNine" android:layout_marginTop="264px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonEleven" android:layout_toRightOf="@+id/buttonTen" android:layout_marginTop="264px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> <ImageButton android:id="@+id/buttonTwelve" android:layout_toRightOf="@+id/buttonEleven" android:layout_marginTop="264px" android:layout_marginLeft="10px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inactive" /> And this is my logcat errors (p.s. line #12 is the first TextView in main.xml): 03-26 22:59:31.670: WARN/dalvikvm(185): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 03-26 22:59:31.727: ERROR/AndroidRuntime(185): Uncaught handler: thread main exiting due to uncaught exception 03-26 22:59:31.784: ERROR/AndroidRuntime(185): java.lang.RuntimeException: Unable to start activity ComponentInfo{kz.androidmarket.www.randomtest1/kz.androidmarket.www.randomtest1.randomTest1}: android.view.InflateException: Binary XML file line #12: Error inflating class 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.os.Handler.dispatchMessage(Handler.java:99) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.os.Looper.loop(Looper.java:123) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.main(ActivityThread.java:4363) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Method.invokeNative(Native Method) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Method.invoke(Method.java:521) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at dalvik.system.NativeStart.main(Native Method) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.Activity.setContentView(Activity.java:1622) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at kz.androidmarket.www.randomtest1.randomTest1.onCreate(randomTest1.java:11) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): ... 11 more 03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: java.lang.reflect.InvocationTargetException 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.widget.TextView.(TextView.java:320) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Constructor.constructNative(Native Method) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.view.LayoutInflater.createView(LayoutInflater.java:500) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): ... 22 more 03-26 22:59:31.784: ERROR/AndroidRuntime(185): Caused by: android.content.res.Resources$NotFoundException: File #ffff9900 from drawable resource ID #0x7f040002: .xml extension required 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.content.res.Resources.loadColorStateList(Resources.java:1820) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.content.res.TypedArray.getColorStateList(TypedArray.java:289) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): at android.widget.TextView.(TextView.java:627) 03-26 22:59:31.784: ERROR/AndroidRuntime(185): ... 26 more Could anybody help me?

    Read the article

  • Defining where on the page the flowdocument I am printing will 'start' and 'end'

    - by Sagi1981
    Dear community. I am almost done with implementing a printing functionality, but I am having trouble getting the last hurdle done with. My problem is, that I am printing some reports, consisting of a header (with information about the person the report is about), a footer (with a page number) and the content in the middle, which is a FlowDocument. Since the flowdocuments can be fairly long, It is very possible that they will span multiple pages. My approach is to make a custom FlowDocumentPaginator which derives from DocumentPaginator. In there i define my header and my footer. However, when I print my page, the flowdocument and my header and footer are on top of eachother. So my question is plain and simple - how do I define from where and to where the flowdocument part on the pages will be placed? here is the code from my custommade Paginator: public class HeaderedFlowDocumentPaginator : DocumentPaginator { private DocumentPaginator flowDocumentpaginator; public HeaderedFlowDocumentPaginator(FlowDocument document) { flowDocumentpaginator = ((IDocumentPaginatorSource) document).DocumentPaginator; } public override bool IsPageCountValid { get { return flowDocumentpaginator.IsPageCountValid; } } public override int PageCount { get { return flowDocumentpaginator.PageCount; } } public override Size PageSize { get { return flowDocumentpaginator.PageSize; } set { flowDocumentpaginator.PageSize = value; } } public override IDocumentPaginatorSource Source { get { return flowDocumentpaginator.Source; } } public override DocumentPage GetPage(int pageNumber) { DocumentPage page = flowDocumentpaginator.GetPage(pageNumber); ContainerVisual newVisual = new ContainerVisual(); newVisual.Children.Add(page.Visual); DrawingVisual header = new DrawingVisual(); using (DrawingContext dc = header.RenderOpen()) { //Header data } newVisual.Children.Add(header); DrawingVisual footer = new DrawingVisual(); using (DrawingContext dc = footer.RenderOpen()) { Typeface typeface = new Typeface("Trebuchet MS"); FormattedText text = new FormattedText("Page " + (pageNumber + 1).ToString(), CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, 14, Brushes.Black); dc.DrawText(text, new Point(page.Size.Width - 100, page.Size.Height-30)); } newVisual.Children.Add(footer); DocumentPage newPage = new DocumentPage(newVisual); return newPage; } } And here is the printdialogue call: private void btnPrint_Click(object sender, RoutedEventArgs e) { try { PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == true) { FlowDocument fd = new FlowDocument(); MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(<My string of text - RTF formatted>)); TextRange tr = new TextRange(fd.ContentStart, fd.ContentEnd); tr.Load(stream, DataFormats.Rtf); stream.Close(); fd.ColumnWidth = printDialog.PrintableAreaWidth; HeaderedFlowDocumentPaginator paginator = new HeaderedFlowDocumentPaginator(fd); printDialog.PrintDocument(paginator, "myReport"); } } catch (Exception ex) { //Handle } }

    Read the article

  • Conditionally styling @font-face

    - by Gnee
    I'm using @font-face for some headers. The replaced typeface is different in dimension and overall character. When the switch happens, the old typeface's rules don't look so good. Other than writing a conditional Javascript script, is there a way to have a set of CSS rules for @font-face fonts (if the browsers supports it) and CSS rules for the unreplaced default fonts?

    Read the article

  • Using custom fonts on Android

    - by karse23
    Hi there, I'm trying to load a custom font as follows: private Paint customFont18; customFont18 = new Paint(); customFont18.setTextSize(18); Typeface fontFace = Typeface.createFromAsset(getAssets(), "FONT.TTF"); customFont18.setTypeface(fontFace); The getAssets fails, thows this: -The method getAssets() is undefined for the type MyClass -assetManager cannot be resolved to a variable What is my problem? I've seen several examples like this but none works in my case. Thanks in advance.

    Read the article

  • custom type face class by dinesh?

    - by dineshpeiris
    package typeface{ import flash.display.*; import flash.events.Event; import flash.filters.BitmapFilter; import flash.filters.BitmapFilterQuality; import flash.filters.BlurFilter; public class Main extends Sprite { private var typeSet:String="SEE > THINK > CREATE"; private var collectionSet:MovieClip; private var w:int = 1; public function Main():void { trace("start typeface application"); collectionSet = new MovieClip(); for (var n:int = 0; n < typeSet.length; n++) { var _x:int = 0 + (40 * n); var _y:int = 0; var Type:TypeCollector = new TypeCollector(_x, _y, stringToCharacter(typeSet, n), collectionSet); Type.addEventListener("action", actionHandler); } collectionSet.x = 100; collectionSet.y = (stage.stageHeight / 2) - 80; addChild(collectionSet); } private function actionHandler(event:Event):void { if (w == 16) { collectionSet.filters = [new BlurFilter(30, 30, BitmapFilterQuality.HIGH)]; removeChild(collectionSet); } w++; } public function stringToCharacter(str:String, n:int):String { if (str.length == 1) { return str; } return str.slice(n, n+1); } } } package typeface { import flash.display.*; import flash.events.Event; import flash.utils.Timer; import flash.events.TimerEvent; import flash.filters.BitmapFilter; import flash.filters.BitmapFilterQuality; import flash.filters.BlurFilter; import flash.events.EventDispatcher; public class TypeCollector extends EventDispatcher { private var TYPE_MC:typeMC; private var typeArray:Array = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">"); private var character:String; private var num:int = 0; private var TypeTimer:Timer; private var _xNum:int; private var _yNum:int; private var movieClip:MovieClip; public function TypeCollector(_x:int, _y:int, char:String, movie:MovieClip) { var totalNum:int = typeArray.length; _xNum = _x; _yNum = _y; movieClip = movie; character = char; TypeTimer = new Timer(100, totalNum); TypeTimer.addEventListener("timer", TypeRoutTimer); TypeTimer.start(); } public function TypeRoutTimer(event:TimerEvent):void { CreateTypeFace(num, _xNum, _yNum, character); num++; } public function CreateTypeFace(num:int, _x:int, _y:int, character:String) { if (character == " ") { } else { if (TYPE_MC != null) { TYPE_MC.filters = [new BlurFilter(30, 30, BitmapFilterQuality.HIGH)]; movieClip.removeChild(TYPE_MC); } if (typeArray[num] == character) { TYPE_MC = new typeMC(); TYPE_MC.x = _x; TYPE_MC.y = _y; TYPE_MC.typeTF.text = typeArray[num]; TYPE_MC.filters = [new BlurFilter(5, 5, BitmapFilterQuality.HIGH)]; movieClip.addChild(TYPE_MC); dispatchEvent(new Event("action")); TypeTimer.stop(); } else { TYPE_MC = new typeMC(); TYPE_MC.x = _x; TYPE_MC.y = _y; TYPE_MC.typeTF.text = typeArray[num]; TYPE_MC.filters = [new BlurFilter(10, 10, BitmapFilterQuality.HIGH)]; movieClip.addChild(TYPE_MC); } } } } }

    Read the article

  • Google, typography, and cognitive fluency for persuasion

    - by Roger Hart
    Cognitive fluency is - roughly - how easy it is to think about something. Mere Exposure (or familiarity) effects are basically about reacting more favourably to things you see a lot. Which is part of why marketers in generic spaces like insipid mass-market lager will spend quite so much money on getting their logo daubed about the place; or that guy at the bus stop starts to look like a dating prospect after a month or two. Recent thinking suggests that exposure effects likely spin off cognitive fluency. We react favourably to things that are easier to think about. I had to give tech support to an older relative recently, and suggested they Google the problem. They were confused. They could not, apparently, Google the problem, because part of it was that their Google toolbar had mysteriously vanished. Once I'd finished trying not to laugh, I started thinking about typography. This is going somewhere, I promise. Google is a ubiquitous brand. Heck, it's a verb, and their recent, jaw-droppingly well constructed Paris advert is more or less about that ubiquity. It trades on Google's integration into any information-seeking behaviour. But, as my tech support encounter suggests, people settle into comfortable patterns of thinking about things. They build schemas, and altering them can take work. Maybe the ubiquity even works to cement that. Alongside their online effort, Google is running billboard campaigns to advertise Chrome, a free product in a crowded space. They are running these ads in some kind of kooky Calibri / Comic Sans hybrid. Now, at first it seems odd that one of the world's more ubiquitous brands needs to run a big print campaign in public places - surely they have all the fluency they need? Well, not so much. Chrome, after all, is not the same as their core product, so there's some basic awareness work to do, and maybe a whole new batch of exposure effect to try and grab. But why the typeface? It's heavily foregrounded, and the ads are extremely textual. Plus, don't we all know that jovial, off-beat fonts look unprofessional, or something? There's a whole bunch of people who want (often rightly) to ban Comic Sans I wonder, though. Are Google trying to subtly disrupt cognitive fluency? There's an interesting paper (pdf) about - among other things - the effects of typography on they way people answer survey questions. Participants given the slightly harder to read question gave more abstract answers. The paper references other work suggesting that generally speaking, less-fluent question framing elicits more considered answers. The Chrome ad typeface is less fluent for print. Reactions may therefore be more considered, abstract, and disruptive. Is that, in fact, what Google need? They have brand ubiquity, but they want here to change accustomed behaviour, to get people to think about changing their browser. Is this actually a very elegant piece of persuasive information design? If you think about their "what is a browser?" vox pop research video, there's certainly a perceptual barrier they're going to have to tackle somehow.

    Read the article

  • TextBox Inside TabHost isn't clickable

    - by agam360
    Here is my code:(main.xml -layout) <TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" > </TabWidget> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <MultiAutoCompleteTextView android:id="@+id/txtCode" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.25" android:capitalize="none" android:focusable="true" android:focusableInTouchMode="false" android:gravity="top|left" android:text="@string/strtxtCode" android:textSize="26dp" android:textStyle="bold" android:typeface="normal" /> <MultiAutoCompleteTextView android:id="@+id/txtCodeHTML" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.25" android:capitalize="none" android:focusable="true" android:focusableInTouchMode="false" android:gravity="top|left" android:text="@string/strtxtCode2" android:textSize="26dp" android:textStyle="bold" android:typeface="normal" /> </FrameLayout> </LinearLayout> </TabHost> When I try to click(touch) the text-box, it does nothing. What should I do in order to fix this?

    Read the article

  • Android how to make button text bold when pressed or focussed

    - by stealthcopter
    I want to change the text inside a button to be bold when the button is highlighted or pressed. I currently use a xml file to define the button and use the XML to change how it looks when pressed but I would like to do this without using an image. <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/reset_hover" /> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/reset_hover" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/reset_hover" /> <item android:drawable="@drawable/reset" /> </selector> I tried using something like the following, but it doesn't seem to ever get called. final Button btn_reset = (Button) findViewById(R.id.btn_reset); btn_reset.setOnClickListener(this); btn_reset.setOn(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus){btn_reset.setTypeface(null, Typeface.BOLD);} else{btn_reset.setTypeface(null, Typeface.NORMAL);} } });

    Read the article

  • Android: Is it possible to have multiple styles inside a TextView?

    - by Legend
    I was wondering if its possible to set multiple styles for different pieces of text inside a TextView. For instance, I am setting the text as follows: descbox.setText(line1 + "\n" + line2 + "\n" + word1 + "\t" + word2 + "\t" + word3); Now, is it possible to have a different style for each text element? I mean bold for line1, normal for word1 and so on... I found this http://developer.android.com/guide/appendix/faq/commontasks.html#selectingtext: // Get our EditText object. EditText vw = (EditText)findViewById(R.id.text); // Set the EditText's text. vw.setText("Italic, highlighted, bold."); // If this were just a TextView, we could do: // vw.setText("Italic, highlighted, bold.", TextView.BufferType.SPANNABLE); // to force it to use Spannable storage so styles can be attached. // Or we could specify that in the XML. // Get the EditText's internal text storage Spannable str = vw.getText(); // Create our span sections, and assign a format to each. str.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); str.setSpan(new BackgroundColorSpan(0xFFFFFF00), 8, 19, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); str.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 21, str.length() - 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); But it uses position numbers inside the text. Is there a cleaner way to do this?

    Read the article

  • Androids ExpandableListView - where to put the button listener for buttons that are children

    - by CommonKnowledge
    I have been playing around a lot with the ExpandableListView and I cannot figure out where to add the button listeners for the button that will be the children in the view. I did manage to get a button listener working that uses getChildView() below, but it seems to be the same listener for all the buttons. The best case scenario is that I would be able to implement the button listeners in the class that instantiates the ExpandableListAdapter class, and not have to put the listeners in the actual ExpandableListAdapter class. At this point I don't even know if that is possible I have been experimenting with this tutorial/code: HERE getChildView() @Override public View getChildView(int set_new, int child_position, boolean view, View view1, ViewGroup view_group1) { ChildHolder childHolder; if (view1 == null) { view1 = LayoutInflater.from(info_context).inflate(R.layout.list_group_item_lv, null); childHolder = new ChildHolder(); childHolder.section_btn = (Button)view1.findViewById(R.id.item_title); view1.setTag(childHolder); childHolder.section_btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Toast.makeText(info_context, "button pushed", Toast.LENGTH_SHORT).show(); } }); }else { childHolder = (ChildHolder) view1.getTag(); } childHolder.section_btn.setText(children_collection.get(set_new).GroupItemCollection.get(child_position).section); Typeface tf = Typeface.createFromAsset(info_context.getAssets(), "fonts/AGENCYR.TTF"); childHolder.section_btn.setTypeface(tf); return view1; } Any help would be much appreciated. Thank you and I will be standing by.

    Read the article

  • What is the fastest way to type an en dash in Windows 7?

    - by Geoff Olynyk
    Simple question: What's the quickest way to get an en dash (–, Unicode U+2013 EN DASH) in Windows? Note that this question is for all programs, not just Microsoft Word. Even better if it can be copied to the clipboard as a pure Unicode character, with no formatting information (typeface, etc.) so that when I paste it into Word or Excel or other rich text editors, it doesn't carry its format with it.

    Read the article

  • how to display bitmaps in listview?

    - by mary
    hi i want to show images downloaded in listview.images downloaded with function DownloadImage and are as bitmap.how to show in listview . name photoes with book_id in tabel book are aqual.i want each book has its own image. i can show in listview book_name and book_price just the problem with image book please help me class: package bookstore.category; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.apache.http.NameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Typeface; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; import bookstore.pack.JSONParser; import bookstore.pack.R; import android.app.Activity; import android.app.ProgressDialog; public class Computer extends Activity { Bitmap bm = null; // progress dialog private ProgressDialog pDialog; // Creating JSON Parser object JSONParser jParser = new JSONParser(); ArrayList<HashMap<String, String>> computerBookList; private static String url_books = "http://10.0.2.2/project/computer.php"; // JSON Node names private static final String TAG_SUCCESS = "success"; private static final String TAG_BOOK = "book"; private static final String TAG_BOOK_NAME = "book_name"; private static final String TAG_BOOK_PRICE = "book_price"; private static final String TAG_BOOK_ID = "book_id"; private static final String TAG_MESSAGE = "massage"; // category JSONArray JSONArray book = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.category); Typeface font1 = Typeface.createFromAsset(getAssets(), "font/bnazanin.TTF"); // Hashmap for ListView computerBookList = new ArrayList<HashMap<String, String>>(); new LoadBook().execute(); } class LoadBook extends AsyncTask<String, String, String> { /** * Before starting background thread Show Progress Dialog * */ @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(Computer.this); pDialog.setMessage("Please wait..."); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.show(); } protected String doInBackground(String... args) { // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL JSONObject json = jParser.makeHttpRequest(url_books, "GET", params); // Check your log cat for JSON reponse Log.d("book:", json.toString()); try { // Checking for SUCCESS TAG int success = json.getInt(TAG_SUCCESS); if (success == 1) { DownloadImage("10.0.2.2/project/images/100.png"); DownloadImage("10.0.2.2/project/images/101.png"); DownloadImage("10.0.2.2/project/images/102.png"); DownloadImage("10.0.2.2/project/images/103.png"); DownloadImage("10.0.2.2/project/images/104.png"); DownloadImage("10.0.2.2/project/images/105.png"); DownloadImage("10.0.2.2/project/images/106.png"); DownloadImage("10.0.2.2/project/images/107.png"); DownloadImage("10.0.2.2/project/images/108.png"); DownloadImage("10.0.2.2/project/images/109.png"); DownloadImage("10.0.2.2/project/images/110.png"); // books found book = json.getJSONArray(TAG_BOOK); for (int i = 0; i < book.length(); i++) { JSONObject c = book.getJSONObject(i); // Storing each json item in variable String book_name = c.getString(TAG_BOOK_NAME); String book_price = c.getString(TAG_BOOK_PRICE); String book_id = c.getString(TAG_BOOK_ID); // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); // adding each child node to HashMap key => value map.put(TAG_BOOK_NAME, book_name); map.put(TAG_BOOK_PRICE, book_price); // map.put(TAG_AUTHOR_NAME, author_name); // adding HashList to ArrayList computerBookList.add(map); } return json.getString(TAG_MESSAGE); } else { System.out.println("no book found"); } } catch (JSONException e) { e.printStackTrace(); } return null; } /** * After completing background task Dismiss the progress dialog * **/ protected void onPostExecute(String file_url) { pDialog.dismiss(); // updating UI from Background Thread runOnUiThread(new Runnable() { ListView view1 = (ListView) findViewById(R.id.list_view); public void run() { ImageView iv = (ImageView) findViewById(R.id.list_image); // bm=BitmapFactory.decodeResource(getResources(), resId); //bm=BitmapFactory.decodeResource(null,R.id.list_image); // iv.setImageBitmap(bm); /* * */ /** * Updating parsed JSON data into ListView * */ ListAdapter adapter = new SimpleAdapter(Computer.this, computerBookList, R.layout.search_item, new String[] { TAG_BOOK_NAME, TAG_BOOK_PRICE }, new int[] { R.id.book_name, R.id.book_price }); view1.setAdapter(adapter); } }); } } private Bitmap DownloadImage(String URL) { Bitmap bitmap = null; InputStream in = null; try { in = OpenHttpConnection(URL); bitmap = BitmapFactory.decodeStream(in); in.close(); } catch (IOException e1) { e1.printStackTrace(); } return bitmap; } private InputStream OpenHttpConnection(String urlString) throws IOException { InputStream in = null; int response = -1; URL url = new URL(urlString); URLConnection conn = url.openConnection(); if (!(conn instanceof HttpURLConnection)) throw new IOException("Not an HTTP connection"); try { HttpURLConnection httpConn = (HttpURLConnection) conn; httpConn.setAllowUserInteraction(false); httpConn.setInstanceFollowRedirects(true); httpConn.setRequestMethod("GET"); httpConn.connect(); response = httpConn.getResponseCode(); if (response == HttpURLConnection.HTTP_OK) { in = httpConn.getInputStream(); } } catch (Exception ex) { throw new IOException("Error connecting"); } return in; } }

    Read the article

  • Installing Helvetica on Windows

    - by Marek D
    I've installed Helvetica Neue fonts on my Windows. The problem is when websites use Helvetica or Helvetica Neue typeface, they almost exclusively do it simply using "Helvetica" or "Helvetica Neue" font-family. But In my windows, the Helvetica fonts are installed as a "HelveticaNeueLT Com 45 Lt" or "Helvetica LT Std" or similar extended name. I've tried to create my test page, and the browser renders the font properly only if I use the full font name. I'd like to know, how to make windows/browser display Helvetica properly?

    Read the article

1 2 3  | Next Page >