My image: enter image description here
I am starting with RibbonControl in Devexpress. My problem is
Change Font Size in sub-item, if the font size is bigger than 10, it ran out of the area.
I need it to read my character in Unicode font.
There is any way to make the font area auto size with the font size?
Related
I'm trying to scale a given text, e.g "123\nV.1-4", to fit the screen in mono.
I tried increasing the font size till the screen is not bigger.
My main problem is that I cannot retrieve the size of the label with a new font quickly?
(I'm retrieving with label.GetSizeRequest(out width, out height);)
So any solutions on how to scale the font/text?
Thanks
When the label is resized as you change the font size, the SizeRequest and SizeAllocated events will fire. What you could do is set the font size, then in the SizeAllocated event for the label, set the font size again. You will clearly have to stop the loop at some point, I assume you would cease increasing the font size when your label dimensions outstrip those of the window or screen etc.
However, have you considering using Pango and a drawing area instead?
i need a solution to draw string on an image inside of a rectangle and setting the font size according to the image size (resolution)?
SAMPLE IMAGE
as you can see i need to put some text (right-to-left text) inside of that blue rectangle with font size that change according to image sizes
Any Help Will Be Appreciated.
I am trying to make a document but my font is currently to big.
Currenty i am changing the font like this
t2.Rows[0].Cells[0].Paragraphs.First().Append("Data").FontSize(9);
Is there a way to change the font size for the whole document ?
ISSUE
I am dealing with a system where images have been scanned in at different vertical and horizontal resolutions. The resolutions range from 96dpi to 300dpi.
My users need the ability to draw text onto these images. Using GDI+ it is easy to draw text onto images.
QUESTION
What I am having difficulty understanding, is how the user can draw text onto an image and the text drawn appears the same size, regardless of the images vertical and horizontal resolutions.
What I am seeing now, if I draw text using a 28pt arial font onto a 96ppi image the text will be smaller then if I draw text using a 28pt arial font onto a 300ppi image.
How can I take the images resolution into consideration to scale the font size when drawing text onto images?
I am drawing using the TextRenderer class.
TextRenderer.DrawText(graphics, this.txtComments.Text, font, startPoint, Color.Black);
UPDATE #1
Here is the code i'm using to initialize the font
System.Drawing.Font font = new System.Drawing.Font("Comic Sans MS", 28, FontStyle.Bold, GraphicsUnit.Point)
I have tried using GraphicsUnit.Pixel and GraphicsUnit.Point, neither one make any difference for me.
UPDATE #2
I have tried using the Graphics.DrawString method and I get the same results.
Thanks,
How does the font size work in sprite fonts in C# XNA? For example maybe font size 10 is drawn from the top to bottom of a lowercase charecter by default 10 pixels tall when output with SpriteBatch's drawString. I've noted that some charecters are much wider or taller than most, extending a considrable distance downwards or to the right of a normal charecter.
I believe it depends on the font. You can use SpriteFont.MeasureString to determine the rendered dimensions of text.