Using pixels rather than points to specify the size of a font

The font constructor takes the size in points as its 3rd parameter like so:
new Font("Times New Roman", Font.PLAIN, 12);
Is there any way to use pixels to specify the size instead? The reason I ask is that point specified fonts differ in size from one platform to another (depending on the systems DPI - Windows typically has 96 while the Mac has 72). Obviously if we specify the size in pixels we don't get this problem.
Thanks in advance!
-Peter

Actually, that's the point of using points, to specify character size in a manner fairly independant of the pixel resolution.
However, what you probably could do is to get a FontRendererContext from the GraphicsContext you propose to use, then get the point-to-pixel transform from that, and use that to transform pixels into points.

Similar Messages

  • I want to open bookmarked pages in a new tab, like it used to, rather than having it replace the current page in the current tab. Ho do I do this?

    In earlier verisions of Firefox, when I opened bookmarked pages, they opened in a new tab. Now, in version 6.0.1, when I open a bookmark, it opens in the current tab and replaces the page I am reading. I want the bookmarks to open in a new tab just like links open in a new tab. How do I do that?

    Middle-click the bookmark with the mouse scroll wheel to open the link in a new tab.
    See also:
    *Open Bookmarks in New Tab: https://addons.mozilla.org/firefox/addon/open-bookmarks-in-new-tab/

  • What do I lose if I buy iPad mini rather than ipad 4 besides the size of screen

    What do I gain for upgrading my Ipad 3 retina display for ipad 4 or the mini ipad .

    If that's the case, then it makes lot more sense than simply buying the iPad 4 for the sake of having the latest and greatest new device.
    As for the iPad Mini, that would be a downgrade and would make no sense in terms of what the two devices have to offer. My opinon only ..... but I believe that Apple wanted to release a smaller and less expensive "entry level" tablet device to take away some of the luster of the Galaxy Tab, the Kindle Fire and the B&N Nook which are smaller, less expensive devices. The Mini is still a great device, but its a downgrade for the iPad 3, that's all.
    I have fooled around with the iPad 4 quite a few times at my local Best Buy Store and it is faster than the iPad 3. I cannot speak about the quality of the camera, I didn't try that, so I don't know anything more about it other than what the Apple iPad spec website claims. If you can get a good price for the iPad 3, and you really want to upgrade the device, then go ahead and do it. You would be as up to date with all of the Apple devices at that point as you could be. I personally would stay away from the Mini, that's all.

  • I would like to be able to enter my own page sizes to use in the Book Module, rather than choosing defaults from the drop-down. Is it possible to do this?

    I would like to be able to enter my own page sizes to use in the Book Module (to export to 3rd party printers), rather than choosing defaults from the drop-down. Is it possible to do this?

    No. You are limited to the choices within the Lightroom Book module.

  • [svn:fx-trunk] 5061: Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance .

    Revision: 5061
    Author: [email protected]
    Date: 2009-02-24 14:18:51 -0800 (Tue, 24 Feb 2009)
    Log Message:
    Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance. By doing this we save the overhead of calling describeType() and doing RTTI. Also updated the backgroundColor to be cast to uint until the getter/setter is updated to return that (currently it is object)
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Ryan F & Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml

    Revision: 5061
    Author: [email protected]
    Date: 2009-02-24 14:18:51 -0800 (Tue, 24 Feb 2009)
    Log Message:
    Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance. By doing this we save the overhead of calling describeType() and doing RTTI. Also updated the backgroundColor to be cast to uint until the getter/setter is updated to return that (currently it is object)
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Ryan F & Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml

  • How To Display Image Dimension in Pixels Rather Than Inches

    I am using Photoshop CS3, which I'm still learning to use.  I want to see an open image's dimension (W X H) in pixels in the image's window/workspace.
    Right now, when I open a file it displays the file's Document Sizes in the lower part of the workspace (sorry, don't know the proper terminology).  Selecting the arrow next to this currently displayed information, I can then select Show>Document Dimensions.  However, it always gives the image's width and height dimensions in inches.  But, I want is to see these dimensions in pixels.
    How do I get the document's dimensions to be displayed in pixels rather than inches?  Thanks in advance.

    Oops!  Sorry about putting this in the wrong forum.  I'm using PS to edit images that I'm using within DW.  Hence, my (temporary) confusion.
    Anyway, yes, that solved my problem.  I appreciate the quick response.  Thanks!

  • Clickable on a theme that contains lines, rather than points in Java API

    Hi,
    I am working on a Java thick client application using the MapViewer API.
    The use case I am trying to implement is to click on a line that has been rendered by MapViewer, and identify the object that this lines represents.
    I have been able to implement a click on a point (e.g. defined as MDSYS.SDO_GEOMETRY(2001,null,MDSYS.SDO_POINT_TYPE(3,3,null),null,null).
    However, I am having difficulty with a line. I have tried with a line defined as follows:
    MDSYS.SDO_GEOMETRY(2002, null, null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(3,3,4,4))
    and also using the entry in the INTERSTATES table from the mvdemo sample database:
    GEOM: MDSYS.SDO_GEOMETRY(2002,8307,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MDSYS.SDO_ORDINATE_ARRAY(-95.368599,29.77528,-95.366074,29.77133,-95.365822,29.771009,-95.365341,29.769661))
    HIGHWAY: I 10/I 45
    The approach I have taken is to use live features by making a JDBCTheme ("INTERSTATES_THEME") clickable.
    The following is the code I used:
    MapViewer map = new MapViewer("http://localhost:8888/mapviewer/omserver");
    map.setServiceURL("http://localhost:8888/mapviewer/omserver");
    map.setDataSourceName("mvdemo");
    map.setImageFormat(MapViewer.FORMAT_PNG_URL);
    map.addJDBCTheme(config.getDataSourceName(), "INTERSTATES_THEME",
    "select HIGHWAY, geom from INTERSTATES where HIGHWAY = 'I 10/I 45'", "geom", "8307",
    "L.DPH", null, null, true);
    map.setFullExtent();
    Then, I make a call to map.run(), map.getGeneratedMapImage() and render the generated image in a JPanel paintComponent method.
    This all works fine, and I can see the highway being rendered.
    However, if I add
    map.setClickable(true, "INTERSTATES_THEME");
    before the call to map.setFullExtent();
    I get the following stack trace when map.run() is invoked:
    java.lang.IllegalStateException: unread block data
         at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2377)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1361)
         at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at oracle.lbs.mapcommon.MapResponse.readObject(MapResponse.java:513)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at oracle.lbs.mapclient.MapViewer.processRawResponse(MapViewer.java:6706)
         at oracle.lbs.mapclient.MapViewer.run(MapViewer.java:6363)
    Does anyone know if it is possible to make lines (rather than points) clickable on a thick client?
    Any help is much appreciated.
    Thanks.

    Hi,
    I want to have click event on Point.
    I have written following code using Mapviewer API:
    String serverUrl = "http://ps3962:7101/mapviewer/omserver";
    mapClient = new MapViewer(serverUrl);
    mapClient.setDataSourceName("mvdemo");
    mapClient.setBaseMapName("demo_map");
    mapClient.setCenterAndSize(-122.40, 37.80, 2.5);
    mapClient.setDeviceSize(new java.awt.Dimension
    (1280,768));
    mapClient.setImageFormat(MapViewer.FORMAT_PNG_URL);
    I have added point feature to it by mapClient.addPointFeature(cx, cy, 8307, "M.CIRCLE", "Point1",null,null);
    After this I did mapClient.run()
    and mapClient.getGeneratedImage()
    The image returned is null.
    I am able to get Image Url only.
    And By using that URL if I rendered the image in jsf page, How can I make point feature clickable ?
    In your first post You mentioned that you have used MapViewer.FORMAT_PNG_URL and still You are getting generatedImage.
    Can you please tell me what can be the problem in my code?
    I referred Mapviewer API and it is mentioned that for getting generatedMapImage the format should be FORMAT_RAW_COMPRESSED.
    So could you please tell me how can you get Image by using FORMAT_PNG_URL ?
    And also how to make point feature clickable ?
    Its urgent. Your help will be greatly appreciated .
    Thanks

  • Wiki file attachments - can the wiki be configured to link to a file already on the server rather than uploading it into the page?

    Can the wiki be configured to link to a file already on the server rather than uploading it into the page? This would enable users to open (and edit) the original server hosted document rather than downloading a static copy that can't be edited and synced back into the wiki page.
    As a workaround I've tried attaching an alias to a file but it doesn't work - the wiki instead uploads the aliased file.
    From what I can work out, the default wiki behaviour is to upload a document to a wiki page, which creates a copy of the uploaded document in the wiki database. This copy has no connection to the original document. It can be downloaded and edited, but the edits are not saved back into the wiki hosted version of the document.
    I'd like to be able to upload a link or alias to a document (with preview please!) already on the server. A user could then preview the document or click to open and edit it.
    The only way I can do this at the moment is to create a link "afp://123.../doc.rtf" to the original. This is timeconsuming and confusing for non-technical users and doesn't offer the benefits of the attach function (ie document preview).
    Is there any way the wiki can be configured to link to documents already on the server using the attach functionality?

    An update for anyone in a similar situation.
    Patch 3944727 for 9.0.4.1 that solves this issue: "USER LOV IASM11SHIP EDIT USER LOV SHOULD SHOW THE NICKNAME ATTRIBUTE." However, the patch is mutually exclusive with the latest CPU's and there's no plan to merge the pacthes given the dwindling support for 9.0.4.1. So that patch is pretty much worthless.
    I've been told that this patch is included in newer portal versions, so the real solution is an upgrade.
    Trenton

  • Why won't Compressor let me submit? And why use compressor rather than FCP?

    Hey I'm using Compressor with Final Cut Hd and a Powermac g5.
    So from Final Cut I've gone to 'Export' using 'Using Compressor', for a piece of Quicktime that I want to convert to Mpeg 4. IN compressor, I've set a MPEG 4 conversion, and I've set a destination. But the 'submit' button hasn't come on, and I can't go ahead with the operation. Can anyone tell me the basic things that would prevent me going ahead with the conversion here - no matter how obvious? I'm a new user, and I don't know what I'm doing wrong... any hints?
    Secondly, why do I need to use compressor for this - what's the advantage of using Compressor rather than using the QTconversion panel export from Final Cut Pro?
    Thanks for your help with these issues - you guys rock!
    Best
    Richard

    You may not have enough free hard drive spacein your destination folder or your destination folder is Write protected. I've had that problem and compressor will not always tell you why its not giving you the ok to submit yu kind of have to figure it out. *** far as the benifit of useing it the only rel one is that you can continue to use final cut to do other work while compressor is working, ut that only works if you first export it as a fcp Quick time move and then open compressor and drag and drop the fcp full dv or hdv quick time movie into compressor for compression. affter that you can quite compressor without even saving it and it will continue to work in the background only using what ever cpu power you aren't using allowing you to continue to work on other parts or projects.

  • HT204406 Is there a way to down load specific, individual songs on my iphone 5 or ipad 2, through iTunes Match, rather than having to download the entire album in the Cloud?

    Is there a way to down load specific, individual songs on my iphone 5 or ipad 2, through iTunes Match, rather than having to download the entire album in the Cloud?

    Begin by tapping on the Settings app.
    Scroll to the Store menu and tap that.
    This is where you can manage your Automatic Download settings. You can control Music, Apps, and Books (if you have the iBooks app installed) here. Slide to On any of the kinds of files you want iCloud to automatically download to your device.

  • How do you create a pdf which is in a readable view, rather than having to rotate the document?

    How do you create a pdf which is in a readable view, rather than having to rotate the document?

    This cannot be done with Adobe Reader. Do you have Adobe Acrobat?

  • [svn:fx-3.x] 9493: Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects .

    Revision: 9493
    Author:   [email protected]
    Date:     2009-08-23 16:09:56 -0700 (Sun, 23 Aug 2009)
    Log Message:
    Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects.
    QE notes:  None
    Doc notes: None
    Bugs: SDK-13919
    Reviewer: N/A
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22435
        http://bugs.adobe.com/jira/browse/SDK-13919
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

  • [svn:osmf:] 14927: Refactor sample to use MediaPlayer rather than traits.

    Revision: 14927
    Revision: 14927
    Author:   [email protected]
    Date:     2010-03-22 17:12:29 -0700 (Mon, 22 Mar 2010)
    Log Message:
    Refactor sample to use MediaPlayer rather than traits.  Fix typo in another example.
    Modified Paths:
        osmf/trunk/apps/samples/framework/DynamicStreamingSample/src/DynamicStreamingSample.mxml
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/traceproxy/TraceListene rProxyElement.as

  • Specifying the size of a file when creating a new file

    How do I go about doing this? I specifically need to create different file sizes (2mb's all the way up to 10mb). I was poking around through the File class and there doesn't seem to be a way to do this. There is a way to get the size of it in bytes, but no way to create an empty file straight off the bat with the file size specified. Does anyone know how to do this?
    Thanks.

    the reason I want to do this is because I need to pass certain file sizes over a network and see if the system can handle the sizes of the file under load. the files dont necessarily have to be empty, they can be filled with a bunch of jibberish, but I figured it would be easier to be able to just specify the size of the file rather than have a loop that loops and places over 2 million characters into a file. because a 2mb file is going to be the smaller of the files that needs passed through and that will take too long to create.
    and thanks for the link to randomaccessfile. im probably going to use that, just specify the file size and be done with it. unless theres a better way to do it, but i cant find anything.

  • Can I use thumbnails rather than the {sitename} to load different galleries?

    Hi all-
    I'm new to Spry and all things Javascripting but I'm attempting to construct a image gallery using Spry in Dreamweaver CS3. I've used the "Original Photo Gallery" from the Spry Demo folder as a jumping off point and everything works correctly.
    I would like to know if it is possible to use representative thumbnails rather than the select dropdown to launch the different galleries? I'm sure it is, but I'm a total neophyte and have no idea what to do. I'd like to set up a AP Div with 9 thumbnails in a table that would each launch a different gallery. How do I do that?
    Jimmy

    Hello, because you're SELECTing tournament.tourtype in the SELECT list, the answer is not really. If you didn't need t.tourtype in the SELECT list, you could have:
    select m.memberid, m.lastname, m.firstname
    from member m
    where exists (select 1
            from entry e inner join tournament t on (e.tourid=t.tourid)
            where m.memberid=e.memberid
                and upper(t.tourtype)='OPEN');And you know the t.tourtype is 'OPEN' anyway, so you don't need to SELECT it. So you could have this, and the answer is yes:
    select m.memberid, m.lastname, m.firstname, 'OPEN' tourtype
    from member m
    where exists (select 1
            from entry e inner join tournament t on (e.tourid=t.tourid)
            where m.memberid=e.memberid
                and upper(t.tourtype)='OPEN');Edited by: SeánMacGC on May 7, 2009 2:09 AM

Maybe you are looking for

  • How to convert a word document to pdf

    How do I convert a word document to pdf

  • Macbook pro, bought on april and it came with lion

    so i bouth me my 1st and new macbook pro, but it came with lion 10.7, i bought it yesterday, i know that the free upgrade program ended on march 30, but do you know if there is any chance i can get the upgrade? since the macbook came with lion and it

  • Free app for Microsoft Word documents?

    Is there a free app that will allow me to upload and view Microsoft Word documents. Ability to work on these documents would be great, but it is not necessary. Thanks!

  • Wierd Error in Web Service Model

    Hi, I tried accessing a web service on net. I downloaded the WSDL file and imported the model into my Webdynpro Application. Next i wrote the reqd code and finally did execute(). I am getting the foll exception:      Service call exception; nested ex

  • Difference in play/pause display on ipod vs. iTunes

    I noticed the following WRT my iPod Classic vs. iTunes: When I hit play on the iPod, in the Now Playing info window the "Play" (the triangle thing) shows up, and on hitting pause, this turns to the two vertical parallel bars. But in iTunes, hitting P