Questions tagged [drawtext]
340 questions
4
votes
1 answer
Android drawText missing characters on Lollipop
I had an android app that displays a scale and it worked fine on all version until 5.0 (Lollipop) where the all the texts drawn with drawText method are somehow truncated.
Only the second letter of a tow letters text is displayed.
i.e. The first…

Luci
- 1,278
- 9
- 17
4
votes
2 answers
Canvas drawtext positioning
I am creating a drawing tool, where user add text to image. While making the text draw to bitmap via canvas position is not being set properly.
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.RED);
…

Binod Singh
- 682
- 4
- 11
- 22
4
votes
1 answer
Strange behaviour with DrawTextA, Courier New and Japanese locale
I found some strange behaviour when using DrawTextA in combination with the Courier New-font with a Japanese locale. Consider the following Delphi XE2 code:
procedure PaintTexts(aPaintBox: TPaintBox; aCharset: Byte);
var
A: AnsiString;
S:…

R. Beiboer
- 712
- 9
- 21
4
votes
2 answers
Android Canvas.drawText not rendering
I have a custom view that draws several different things on screen. Each one has its own paint object. Everything is drawing fine EXCEPT the text. It works just fine in Gingerbread, but ICS+ has no text.
Here is my on draw method:
protected void…

toadzky
- 261
- 3
- 12
4
votes
4 answers
How to draw text with a shadow like Windows XP does on Desktop icons?
Windows XP draws icon text with a nice shadow, which helps to read the text on various backgrounds. The font color is white and the shadow is black (if desktop background is white) or there is no shadow at all (if desktop background is black).
So…

Alex
- 363
- 1
- 6
- 18
3
votes
1 answer
Drawing text in Jetpack Compose with precision
I was trying to draw text inside circle and square in Jetpack Compose and I encounter this issue.
The text holder/container (I am not sure what we call it), the light red rectangle, which holds the actual text, doesn't center the text drawn.
I…

skafle
- 627
- 1
- 6
- 16
3
votes
1 answer
Delphi TextRect in Windows GDI
Is there an analogue of Delphi TextRect in GDI? I looked at DrawText, DrawTextEx, but I didn't find what I needed. I need to draw a percent text of a progress bar that is divided in two color parts, e.g. the left part of the text is black, the right…

maxfax
- 4,281
- 12
- 74
- 120
3
votes
2 answers
add text over a barcode
I'm trying to add a text over a barcode.
In the final stage I want to make the barcode height smaller, and put the text below the barcode, but I'm stuck to add the text.
I tried to play with the X, Y beginning, but no luck.
What am I missing?
…

arnoldino
- 1,969
- 2
- 13
- 15
3
votes
0 answers
Android text outline has significant gap for larger font sizes, but only on one of my devices
I have been using the method below (in various forms) for years, to render text with outlines on Android canvases, and it has never given me any issue until I tested an app on a Samsung Galaxy Tab recently. When using larger text, it becomes…

HomerPlata
- 1,687
- 5
- 22
- 39
3
votes
1 answer
How to get CString Width (For Unicode) in MFC?
I have an MFC application which is support multi-language. To support multi-language, I have developed an API that can calculate drawing width of a String(CString). It works perfectly for English language only. For other unicode language like…

yeasir007
- 2,110
- 2
- 28
- 43
3
votes
0 answers
Drawtext gives '?' for some Turkish characters
I used c# Graphics.DrawString method to draw text overlays on images. It can draw Turkish characters even if operating system does not have Turkish language package. However i am using directx-9 to draw now because of performance issues. If…

Ksilon
- 66
- 7
3
votes
1 answer
TimeStamp variable stopped working in bash script with avconv
The following script was working fine until I upgraded all my Raspberry Pis to Release 9:
#!/bin/bash
cd /home/pi/Videos/SecurityCam/
DToday=`date '+%Y%m%d-%H%M%S'`
fn="VID $DToday"
SubT="PP $PB $DToday"
avconv -f video4linux2 -i /dev/video0 -t…

Chiwda
- 1,233
- 7
- 30
- 52
3
votes
1 answer
What is the use of canvas' `drawTextRun`? How is it different from `drawText`?
I try to understand the use of drawTextRun, but can't find how they differ from the normal drawText in canvas
The below codes
canvas.drawTextRun(TEXT,
0, TEXT.length,
0, TEXT.length ,
x, y, false, paint)
…

Elye
- 53,639
- 54
- 212
- 474
3
votes
0 answers
delphi canvas drawtext does not clip the text
I am using Windows 10, Delphi 7. Trying to make Pdf document with SynPDF using it's canvas directly. I need to draw in the rectangle only that part of the text that corresponds to the length of the rectangle, the rest cut off. I am using DrawText…

Viktor
- 43
- 4
3
votes
1 answer
ffmpeg drawtext leading space characters in text are getting ignored
I am using the below arguments for drawtext in ffmpeg
ffmpeg -i input.gif -vf drawtext="fontfile='ariblk.ttf':text=' Hello World':x=10:y=10:fontsize=30:fontcolor=white" output.gif
notice the spaces before the text specified in argument, but in…

yoda89
- 53
- 8