How to draw text on a single line?
Hello
Is there a way to draw a string so that it fits on the screen?
I'm working on a MIDlet application that has a class that extends the canvas. I want to paint a line of text, but the text is a bit too long so that it cannot be seen entirely on some devices.
I put the police to be "Font.getFont (Font.FACE_MONOSPACE, Font.STYLE_PLAIN, Font.SIZE_SMALL);"
As a more general question, how do the even smaller than SIZE_SMALL police?
Many thanks for any help!
Does the work with image. Thank you very much!
Tags: BlackBerry Developers
Similar Questions
-
How to draw text bordered on Bitmap usgin class Graphics?
Hi guys.
I'm drawing text on a line graph.
The text color is black. Border is white (edge of letters).
How to draw like this?
Thanks in advance.
If you are interested in a vaguely similar effect, but without all the subtle shadows, I have a suggestion. Draw the white text, several times, gap between the nominal position of a pixel or two in different directions and then draw the text in black at the nominal position. The idea is that white copies create an enlargement of each letter which becomes an overview when you draw the black letter on it. You may need to do this a letter at a time, allowing more space between the letters, rather than draw the entire chain at the same time.
-
How to draw text above a picture
Hello
How do I draw text above an image. It will work - substitution of the paint the field and using drawText (0, -10) method.
-10 means that the text will be drawn 10 pixels above the image.
It depends on the method you are using:
If you decide to drawText in the charts (the hard), you would be better to check the length of the text before drawing it (getFont () .getAdvance (text), is what you will use for this), in the positioning of your custom field. This can become quite complicated, especially if you are concerned about the return to the line and other things.
If you go to VerticalFieldManager approach and want the text field to wrap text properly, use, say, RichTextField for this BitmapField for your image and ensure that they have the style flags you can (for example, say, FIELD_HCENTER for centering them vertically; there are a of others, but you do not have to worry with them now) IMHO). In this way, that everything will be done automatically for you. And, as I said before, VerticalFieldManager respect the margins of fields.
-
INTERFACE with the waterfall design: how 2 controls arranged in a single line?
Hi all
Cascade using I can easily drag and drop the control in the definition of qml and can preview visually. But it seems to draw the controls row-by-row. How do control the position absolutely on one line?
In this case, you must use the DispositionAbsolue as the layout for this container, but note that you must specify the coordinates for each control. See the example below to place two buttons on the same line:
import bb.cascades 1.0 import bb.system 1.0 Page { Container { layout: AbsoluteLayout {} Button { id: btnConn objectName: "btnConn" text: "Connect" preferredWidth: 330 layoutProperties: AbsoluteLayoutProperties { positionX: 44 positionY: 260 } } Button { id: btnDisc objectName: "btnDisc" text: "Disconnect" preferredWidth: 330 layoutProperties: AbsoluteLayoutProperties { positionX: 394 positionY: 260 } } } }
I hope this helps.
-
How to draw a measurement tool Info line?
Hi, I need to draw a line with a specific mathematical accuracy and believe that I have defined it in the measurement tool:
It's to-60 degrees by 203,0 (whatever)
How could I draw this line (in width of 1 pixel)?
I could define my pencil to 1 pixel and shift + click to close with trial and error, but I really need an accurate measure if possible because I have 12 lines to draw to varying degrees... I'm building a graphic high resolution of pie style for industrial use and accuracy is important.
Thanks in advance...
Well, the pencil tool is not anti-aliasees, so it will look like jagged. But whatever, if you want any line to look less "irregulars" of work and more high resloution you can.
BUT... while testing pencil drawing, I think that a bug appeared. Scott (or anyone else) might want to check drawing with the pencil tool to see if they see problems of rendering (display).
BUG:
So far - create a new file of 2000 X 1000 px. RGB (size seems to watch). Select the pencil tool 7 px. View zoom set at 33% (I have Open GL on) draw once with a pencil. It is visible. Successive strokes are not made until you change the zoom percentage.
-
Captioning text on a single line
For some reason, I have only 1 line of text by subtitling. Nothing else does not appear.
Ooops nevermind it is not automatically the return.
-
Draw text on the graphic waveform Plot
I need to understand how to draw text on a waveform graph during execution. This could be a text box, a picture of the text, a label and an additional plot with text... etc.
Yes, I know a graph would be better than this, but need to use a graphic for my application.
The graph is updated every second, and new data are added to the history of the ranking. (Which means that the chart bigger every second) So if I draw the text above or behind the table, I'll have to update their location every second. I'll have to use card to XY Coords in an event, (mousedown or mouseup) to place the text (or image of the text) in the field where the user clicked.
Step 1 to resolve this problem is to find first class, learn how to draw or text on the plot of the graph area.
Does anyone have ideas of how this could be accomplished, or some ideas of a sneaky work around to make this work?
Example:
Unfortunately, graphics (graphic and graphic waveform XY) have support Annotation and slider, exposed programmatically through properties, but the array of waveform is not.
What you could do is to place an indicator of 2D image that corresponds to the size of the chart above. Make the value of the image that you draw be transparent and just print the text with transparent backgrounds. However, I do not know the considerations on the performance of it - many times user interface elements, overlap (portions of even transparent) can cause problems of performance due to forcing redesigns... then again maybe a graph is always be redrawn in any case.
-
HP laserjet 5610 but his training and prints all text on the last line
LaserJet 5610 his training and prints all lines of text on a single line at the bottom of the page, thus, it comes as a big black line... Help!
I uninstalled and reinstalled the printer (which is an officejet - laserjet not) and that fixed my problem...
-
converting and application of single line
Greetings,
The data tables and release date are on the bottom.
Tables of process contains the id of the base of different dealing with the fabric. 1 single command will have (at most) 2 or 1 process different store (s). Need to create a query list all order no as well as names of processes, work shop. It also requires to convert each numeric field to 0 if the value is null. I was able to create a query as follows but stuck on do not know how the order number listed as single line more this conversion of numeric field when there are 2 different process no.. Can you help me? I know there are a lot of gurus here who can give me a lift. Thank you.
Select
B.porderno,
Decode(pprocessno,1,A.Name,null) as '1 storename. "
Decode(pprocessno,2,A.Name,null) as '2nd storename.
Decode (pprocessno, 1, NVL(B.PLength,0), null) as "1 length."
Decode (pprocessno, 2, NVL(B.PLength,0), null) as '2nd length.
of test_store2 A, test_process B
where A.storeid = B.pstoreid...
CREATE TABLE test_store2
(storeid NUMBER (3.0) not null,)
(20) is not name VARCHAR2 null,
addr VARCHAR2 (30) not null
)
/
CREATE TABLE test_process
(porderno NUMBER (10,0) not null,)
pstoreid number (3.0) not null,
pprocessno number (3.0) not null,
PLength number (3.0).
pwork VARCHAR2 (30)
)
/
INSERT INTO test_store2 (storeid, name, address)
VALUES (001, 'papas, 123 route1')
INSERT INTO test_store2 (storeid, name, address)
VALUES (002, "tcbi" ', ' st 652 sky ")
INSERT INTO test_store2 (storeid, name, address)
VALUES (003, 'tutu club' ', ' 888 grand ave ")
INSERT INTO test_store2 (storeid, name, address)
VALUES (004, "stinkys', ' 432 bobo st")
/
INSERT INTO test_process (porderno, pstoreid, pprocessno, plength, pwork)
VALUES (811, 2, 1, null, "prepNdye")
INSERT INTO test_process (porderno, pstoreid, pprocessno, plength, pwork)
VALUES (811, 1,2,30, "cutting")
INSERT INTO test_process (porderno, pstoreid, pprocessno, plength, pwork)
VALUES (812, 1,1,10, 'dye')
INSERT INTO test_process (porderno, pstoreid, pprocessno, plength, pwork)
VALUES (813, 3,1,40, 'preparation')
INSERT INTO test_process (porderno, pstoreid, pprocessno, plength, pwork)
VALUES (813, 4.2, null, 'dye')
/
Search result page layout
order 1st storename 2nd storename 1st length 2ndlength 1stwork 2nd work 811 tcbi papas 0 30 prepNdye trimming 812 papas 10 0 dye 813 tutu club stinks 40 0 prep dye
Hello
I wanted to answer the OP, not Florian. I'm sorry.
In your [last thread | http://forums.oracle.com/forums/message.jspa?messageID=3514404#3514404], we have treated the two stores as if they were in the two tables, using two copies of the test_store2 table.
We can do the same thing with the process: the two process, as if they were in the two tables, using two copies of the process table.
Since it may not be a 2nd treatment, the 2nd copy of the table of alternation (and the second copy of the table test_store2, which is distal in relation to it) must be attached to an outside.SELECT p1.porderno , s1.name AS "1st storename" , s2.name AS "2nd storename" , NVL (p1.plength, 0) AS "1st length" , NVL (p2.plength, 0) AS "2nd length" , p1.pwork AS "1st work" , p2.pwork AS "2nd work" FROM test_process p1 JOIN test_store2 s1 ON p1.pstoreid = s1.storeid AND p1.pprocessno = 1 LEFT OUTER JOIN test_process p2 ON p1.porderno = p2.porderno AND p2.pprocessno = 2 LEFT OUTER JOIN test_store2 s2 ON p2.pstoreid = s2.storeid ORDER BY p1.porderno ;
Another approach, since you want to exit with a line by porderno, would be to start by creating a version of the process table that has one line per processid, using GROUP BY, as Florian, and then join two copies of the table of test_sorte2 this result set.
Published by: Frank Kulash, June 9, 2009 10:45
-
Graphics.drawText: How to draw a line of text with words in different colors?
BB OS 5.0.0
I'm watching the documentation of the API for graphics and I can't determine how can I use Graphics.drawText to draw a single line in two colors.
I get the content from the server and in my class that extends the field, layout and painting methods. In the paint method, I need to use drawText to paint the contents from the server in two colors, such as:
New coffee blends available at the counter & - 1 hour ago
I thought that the following drawText could be useful, but I don't see how I can use it with two colors. Ideas, samples or advice would be greatly appreciated.
public int drawText(StringBuffer aText, int aOffset, int aLength, int aX, int aY, int aFlags, int aWidth)
You will need two calls drawText, each following a call setColor for the font you want for this particular piece color.
In order to calculate the offset x from the second drawText compared to the first, use font.getAdvance (firstString) (where the police is your graphic police present, accessible via graphics.getFont ()).
Use simple methods and you will get your results faster.
-
I have Adobe Acrobat XI and can not know how to draw a line. I need to redline some documents but can not. Does version XI even not this feature?
Yes, Acrobat Pro XI and standard have this ability.
There is the comment > Annotations > online tool.
There is the comment > Annotations > tool bar.In the Properties dialog box for one, you can select a desired color (i.e. red).
So, in properties, you can check a choice to make this the default value of the tool.Basically, all versions of Acrobat (including the new "DC") offer this feature.
If you work with a scanned image that has been placed in the PDF don't forget to use the OCR to get an output of a 'real' text - Acrobat provides a feature of OCR.
Be well...
-
Just title/text effects to a single line?
Hello!
As far as I understand the effects of title/text PE11 work only for a single line of text.
(1) how can I produce several lines-text effects with PE11 (and more complex, like the 3D animations)?
(2) If this is not possible, you know a beginners/free software to do this?
I can't wait to read your answers!
Best wishesRonald
Ronald,
You are right. The title preset animations only works on a single line of text.
However, there are several ways around this limitation.
I like to create just the title, that I need and then Keyframe the fixed effects > Motion > Position, make the animations/conduct. Like most of the added value effects such as blur and many others, can also be animated with keyframes, it is limited only by their imagination. These effects of alterations will apply to the title, regardless of however many lines of text or other objects is on the title.
Good luck and hope that helps.
Hunt
-
How do to "BOLD" in the first line of text on a number of sections of text at a time
CS5 using (but we have CS5
.5 available) we will create a business directory. Each page has columns of type
business listings with the company name on top, under this address under this phone, etc. Each ad is separated
by a single line. There are thousands of ads, and we need to "BOLD" in the top line of each. How can do us
without making them individually?
Each line a paragraph, or each list a paragraph with soft returns (forced line breaks)?
It's very simple and basic in both cases an operation. It is especially easy if each ad has the same number of lines, so we will focus first with this case.
Each line should be a separate paragraph. If you have 4 lines, as your example, you might want to mention their name, street, city, and phone. You can and should, all the styles that will be similar in appearance on the same basic model and change only the atrributes that are different, so, for example, if all lines use the same font, many use the same size and weight and only the top line is different and only by being "BOLD" and or larger size start by defining the street, then city and phone based Street and you don't need to define something more than the next Style, I'll get to in a second.
For topics, set name based as well on the street, but change the font characters. Now all the features of the basic fonts can be changed in one place, the definition of the style Stree.
Since you have the same number of lines in each list, you can set up a loop "next style". For name, style next street is, the street is the city, for the city it is the phone and is name for the phone. You will also need to toe after the add space in the name, or space on the phone to book spaces registration and you probably also consider to assign everything except phone keep with the next line to prevent a list from breaking across a page or column break. If currently you have blank lines as separators (empty paragraphs), get rid of them. There are change queries find already registered in ID that will do that.
Once the text is in place and the styles are defined, you can select all, then right click on the style name in the paragraph Styles Panel and choose apply following Style and name. Reformatted your entire list. IT IS CRITICAL in this method that the structure of each list is identical, and if there are no empty lines between the lists.
If each line is a paragraph, but there is line different counts, you will probably reach with just two styles, one for the headings oand one for everything else, but the beat of following style will not work. If there is something unique that appears in all the headings you can use find/replace to make search and reformat in shape, but I suspect that this will not be the case on in the real world, there will be a manual work involved.
Where a lisitn is a single paragraph, line break forced (which is better suited to the case of an uneven lines by registration number) you can define a character style nested to be applied by means of a line break forced to make the first line "BOLD", red or any other thing you want.
At this point, you are probbly, noting that a bit before planningn is a good idea when you do a directory so that your ads have some sort of coherent structure that allows for automation. I have no idea whre that your text is coming from or how it is done in the code. If it can be established as a .csv or a tab-delimited text file, you can use data merge to fill a file based on a model of merge (i.e., how to build directories for my clients who need). You can set styles in the model to each field or paragraph that contains several fields, and merge data will remove empty lines if all row fields are null and there is no punctuation or whitespace on the line.
A multiple records per page fusion will give you individual blocks of text for each record, and you can, if you wish, thread them using the script text point of Rorohiko.com.
-
Problem with creating a container with the single line of text
Hi ~
I'm overwhelmed with a following problem.
Problem: I need to create a container with a single line of text. As I learn from the TLF API, there is no way to do that so he left only in a way that looks like this:
Assuming that textFlow object is to create
var container: Sprite = new Sprite();
var width: Number = 500; It has specified the value
var height: Number = 300; just estimate is sufficient for a normal line height
var controller: DisplayObjectContainerController = new DisplayObjectContainerController (container, width, height);
controller.verticalScrollPolicy = ScrollPolicy.OFF;
textFlow.flowComposer.addController (controller); textFlow.flowComposer.composeContainer (textFlow.flowComposer.getControllerIndex (controlled r));
find the first line of the top in the created container
var textFlowLine:TextFlowLine = textFlow.flowComposer.findLineAtPosition (controller.absoluteStart, false);
var calLineHeight:Number = textFlowLine.textHeight + 8; 8 this is just a test value
controller.setCompositionSize (width, calLineHeight);
textFlow.flowComposer.updateContainer (_textFlow.flowComposer.getControllerIndex (Controller));
In this way, she first calculate first line height giving enough space for the controller
and cope, after that there adjust the height of the container again and then updates.
It's so fresh generals I guess
If anyone has more simple or just how?
In regards to a single line. I think you can set the lineBreak on the TextFlow to "explicit". In this case lines only break to return to the line and the point ends.
If you want to be changed, take a look at the TextLineFactory APIs. NaN set in the width/height of the limit and it gets filled. It is a more lightweight way to create TextLines.
Take a look at the properties DisplayObjectContainerControllers compositionWidth and compositionHeight full TextFlows as in your code using. You still want to use explicit line breaks.
Hope that helps!
Richard -
SELECT SQL to merge the text of different lines into a single line
Hello
I need to create a Select statement to merge multiple lines in a single text. I have a table with the following data:
I need to create a query on the table to show a result like this:SQL> DESC doc_comments Name Null? Type ----------------------------------------------------- -------- ------------------------------------ DOC NUMBER COMMENTS VARCHAR2(30) SQL> SELECT * FROM doc_comments 2 / DOC COMMENTS ---------- ---------- 1 Note A 1 Note B 2 Note C 2 Note D 2 Note E 3 Note F 6 rows selected.
A possible solution would be to create a function to merge the text of the various lines and then use it in the query, but I'm not allowed to create any function in the database, I can use a simple SELECT statement.DOC COMMENTS ------------ -------------------------- 1 Note A, Note B 2 Note C, Note D, Note E 3 Note F
Any ideas on how I can do?Assuming that comments contain no vertical bar (|) character:
with doc_comments as ( select 1 doc,'Note A' comments from dual union all select 1,'Note B' from dual union all select 2,'Note C' from dual union all select 2,'Note D' from dual union all select 2,'Note E' from dual union all select 3,'Note F' from dual ) select doc, replace(ltrim(sys_connect_by_path(comments,'|'),'|'),'|',', ') comments from ( select doc, comments, row_number() over(partition by doc order by comments) rn from doc_comments ) where connect_by_isleaf = 1 start with rn = 1 connect by doc = prior doc and rn = prior rn + 1 order by doc / DOC COMMENTS ---------- ---------------------------------------- 1 Note A, Note B 2 Note C, Note D, Note E 3 Note F SQL>
And if the comments may contain the vertical bar (|), then replace the hose in the code above with a character that is not used in the comments.
SY.
Maybe you are looking for
-
Yahoo mail gives unreliable connection error
When I log into Yahoo mail on Firefox 40.0.3 (on Windows 7) on my laptop provided by company, I get this message:"You asked Firefox to connect safely to we - mg5.mail.yahoo.com, but we cannot confirm that your connection is secure." I can't create an
-
We have three computers to check the same email account (IMAP) and when more than one is not working and try to send a message is displayed:. 'Server offline [email protected] that the server may have dropped or there may be a network problem.Right nex
-
HP Solution Center: my HP Solution Center does not work
My Center solutions HP for HP Photosmart Wireless e-All-in-one printer - B110a does not work. It worked perfectly until a few days ago... The message says: "HP Solution Center cannot work because your device installation is not complete. Please conne
-
OneKey Rescue is not compatible with Windows 7
Hello Recently, I installed my free upgrade to Windows 7.0. I was invited during installation that the OneKey Rescue 6.0 is not compatible with Windows 7.0. Is there a program I can download and use? Thank you!
-
HP Pavilion dv7-6004ea: new SSD not recognized in the BIOS
Hi I have a want dv7 and is currently using a 700 GB drive HARD However im upgrading to an SSD I bought a Sandisc SSD PLUS 120 GB, I cloned the HDD to the SSD, I see partitions in windows Explorer when im running HDD, but when I try to boot from SSD