Font measurement points in JavaFX.

I ran on one problem.
When I set the font size of any node with CSS, no matter what measurement unit I choose (I tried both pt and px), font size is still set in pixels. I also tried to set font for “Text” with the method “setFont”, which accepts parameter of type “Font”.
It is said in JavaFX2 documentation, that:
The size of a Font is described as being specified in points which are a real world measurement of approximately 1/72 inch.
But the font size was still set in pixels.
For an experiment I added “WebView” to the scene and loaded a page in it, on which I displayed two div tags. Within the first div the font size was in pt, and within the second one – in px. As I had suggested, the font sizes were different, and the font size in the last div was identical to the font size in the nodes I referred to at the beginning.
Why is this happening? How do I set the font size in pt? At this moment to solve this problem I convert pt to px using this formula: px=pt/0.75 (dpi of my screen is 96).
example:
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontSmoothingType;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import java.net.URL;
public class TestFont extends Application {
    @Override
    public void start(Stage stage) throws Exception {
        final Group root = new Group();
        Scene s = new Scene(root, 500, 500);
        Text t = new Text(100, 250, "1) - abcdeABCDE12");
        t.setFontSmoothingType(FontSmoothingType.LCD);
        t.setStyle("-fx-font-size: 36pt; -fx-font-family: Calibri;");
        Text t2 = new Text(100, 300, "2) - abcdeABCDE12");
        t2.setFont(javafx.scene.text.Font.font("Calibri", FontWeight.NORMAL, FontPosture.REGULAR, 36));
        t2.setFontSmoothingType(FontSmoothingType.GRAY);
        Text t3 = new Text(100, 350, "3) - abcdeABCDE12");
        t3.setStyle("-fx-font-size: 36px; -fx-font-family: Calibri;");;
        t3.setFontSmoothingType(FontSmoothingType.GRAY);
        WebView wv = new WebView();
        wv.setLayoutX(100);
        wv.setLayoutY(360);
        URL urlWebViewCell = this.getClass().getResource("/testFont.html");
        wv.getEngine().load(urlWebViewCell.toExternalForm());
        root.getChildren().addAll(wv, t, t2, t3);
        stage.setScene(s);
        stage.show();
    public static void main(String[] args) {
        launch(args);
}testFont.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
</head>
<body>
<div style="font-size: 36pt; font-family: Calibri;">4) - abcdeABCDE12</div>
<div style="font-size: 36px; font-family: Calibri;">5) - abcdeABCDE12</div>
</body>
</html>

I don't know exactly how JavaFX is doing it, but standard Java on Windows just assumes a screen resolution of 72 dpi and thus effectively maps points to pixels as one to one. You would see a difference when you print your text (if JavaFX would support printing).

Similar Messages

  • Function Modules for creation of characteristics and Measurement Points

    Hello everybody
    I'm new in ABAP (trainee) and especially the use of characteristics. I'd be very happy if somebody could help me :).
    Can anybody out there with some experience in creating characteristics and measurement points tell me how to create them with function-modules or by changing database tables?
    I'm happy about every hint and ready to give some reward points.
    Best Regards,
    Steffen

    FM and TABLES
    http://72.14.235.104/search?q=cache:71IXBMWcX_8J:reflexcontracts.co.uk/SAP_R3_QUICK_REF.xlsupdatetable+tse05&hl=en&ct=clnk&cd=1&gl=in
    FUNCTION MODULES
    http://www.erpgenie.com/abap/functions.htm
    http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
    http://www.erpgenie.com/abap/index.htm
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Rewards if useful..........................
    Minal

  • Triggering of Preventive Maintenance based on Measuring Point

    Hi,
    I have set measuring point & defined upper range limit and lower range limit. Now I want to trigger preventive maintenance, based on reading enter against measuring point specifically if measuring point reading is above or below defined upper range limit or lower range limit.
    Letu2019s say example, If 10 and 5 is upper range limit and lower range limit, now in this case creation of notification / main order if user has enter measuring point value more than 10 or less than 5.
    Regards,
    Dipen Shroff

    Hi,
        You can do it via Condition Based Maintenance ..
    IMRC0001- U can use this User exit
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/a7/fa4c988f6611d29e8a0000e8323350/frameset.htm
    regards
    pushpa

  • Auto Update of measuring point/document

    Dear all,
    I have one issue over here.Measuring point/document is not updating automatically after productiuon order confirmation . I tried with following steps
    1) Created the equipment as test equipment -->created measuring point as a counter ---> maintain the usage value formula SAPF02 in the PRT tab . Unit of measurement for the characteristics and base unit of measure of material are same
    2) Then i have assigned this eqipment as a PRT in the routing of material .
    Which steps i am missing
    Thanks

    Hi
    I had faced the same problem  when I used SAPF02 then I did following changes.
    Created formula like SAP_09 * PRTSTD / SAP_08
    SAP_09 : Operation Qty
    PRTSTD : PRT Standard Value
    SAP_08:   Base Qty.
    Also make sure the measuring point category should me T in IK02( PRT life counter)
    Regards,
    Raj

  • Maintenance Order through Measuring Point

    Dear all,
    I want to know whether it is possible to create the maintenance order on the basis measuring point .
    I know how to create the order on the basis of measuring counter.
    Is there any procedure to create the maintenance Order through measuring point as done in case of counter?
    kindly provide the solution for Creation of Maintenance Order using Measuring Point..

    Really very thanks for the solution.
    I have one more query, we can create the measuring point using the t.code IK01.As you told we have to create the measuring point with upper and lower range.
    Is that we have to create 2 measuring point for upper as well as lower range or in one measuring point it is possible to accumulate both the upper and lower range.
    If it is possible to accumulate both the upper and lower range in one measuring point then kindly provide the procedure.
    Thanks in advance.

  • Measuring Point Status.

    Dear All Consultants,
    I have scenario for warranty services, so I define master warranty with to conditions “years - kilometer reading”.
    The problem is while assigning master warranty to equipment master system gives me this error {could not determine the status for measuring point 000000000212 at date 11.06.2007      
    Message no. BG212   } 
    Why this message appears and how to solve it.
    It is only warning message but it assume that the warranty expired.
    Waiting your kindly replay.
    yasser.

    Hi,
    Please refer the link below
    http://help.sap.com/saphelp_46c/helpdata/en/5a/3efb377409bd5ae10000009b38f889/frameset.htm
    as you might have not defined first counter.
    Enjoy SAP…
    Don’t forget to give points if its useful ans.
    Namskar
    Ketan Dave

  • Cannot create "Digital" measuring points on Work Manager 6.0

    Hi All,
    I am attempting to create "digital" i.e. Pass/Fail measuring points in Work Manager 6.0. I can enter readings as shown below but when I execute a sync, the error message below is shown:
    I can use the same measuring point in SAP via IK11 as shown below to create a measuring document using valuation code only. However, the Work Manager requires a numeric characteristic to be added and the "no reading" checkbox to be ticked.
    Any help would be greatly appreciated.
    Thanks,
    Jonathan

    Hi Michael,
    I tried setting it up with just the two values (0-fail and 1-Pass) and I'm still running into errors. If you could take a look I'd be grateful.
    Set up code group with two values:
    IK11 allows just the valuation code to be used:
    On the device:
    As far as I can see this should work but it still creates the same error as previously. Ideally it should work as IK11 and allow the user to select from multiple valuation codes but it appears to still require a characteristic.
    One option I tried is to assign a characteristic in addition to the the valuation code and use a 0 reading. This works but is a "workaround" solution in comparison to IK11.
    Any help would be really appreciated.
    Thanks,
    Jonathan

  • Screen enhancement in display measuring point (ik07) and ik02

    Hi experts,
    Can anybody please help in determining userexits for screen enhancement of ik02 transaction. I need to add block to measuring point details.
    and also i need selection screen input parameters to display at the bottom of ik07 tcode.i had inserted the selection screen parameters at the top of screen in ik07 but i need it at last. how can it be inserted there.
    PLZ HELP!!
    screen shot of ie02 for referenece....

    Hello Jared,
    Have a look to this :
    http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm.
    Regards,
    Frédéric

  • How to  make Measuring Point Description Field scrollable on the Detail Read Screen

    In the Measuring Point Read Detail Screen (Rounds Manager), the description field does not have a scroll bar like it does on the Point Read Counter Detail Screen.  This means that the end-user has to arrow-over to the right on the handheld device to see the entire description.  We changed the transaction property to be the same as that on the measuring point field on the Counter screen but that did not resolve the issue.  We are assuming that the field width is defined in columns but are not sure if columns is the same as pixels.  It seems like there is some type of behind the sceens calculation based on the number of pixels used by the characters in the description.  The transaction property does have word wrap activated but it seems to make no difference. Does anyone have any suggestions on what can be done to make the measuring point description have a scrollbar and have the description wrap?  The Rounds Server is version 2.3.
    Tags edited by: Michael Appleby

    1. wall of unformatted code. Use \ tags when posting code.
    2. you're not even asking a question. You're just saying "it doesn't work" and then you dump the code. What do you expect? That people now go to debug it for you?                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Measuring Points are Not displaying in mobile devices(SAP WM 6.1)

    Hi Experts,
    In mobile devices the measuring pints for work order not displaying. When we select the "record point" option for particular work order it should display the measuring points for that WO. But it displaying '0 measuring points'. As shown in screen shot below.
    But in SAP Bach end Measuring Documents are defined for Work Order.
    can any one explain :To display measuring points in mobile devices, need any extra configuration in back end? or
    What functionality need to activate? How to enable this?
    Thanks
    Chigari

    Hi Chigari
    Measuring Points assigned as PRT's in backend application (SAP ECC) should be displayed in Agentry Work Manager 6.1 by standard, if their corresponding technical objects are assigned to either the Work Order header or one of the operations.
    Please check if this requirement is fulfilled in your case.
    There is no need to modify anything in the Configuration Portal (as far as I know).
    The modification we have made is only regarding Measuring Points belonging to other Technical Objects (and still assigned as PRTs).
    Søren Hansen

  • Making system settings for measurement documents and measuring point

    What is the significance of making system settings for measurement documents and measuring point in spro?
    Edited by: Pallavi Kakoti on Jul 14, 2011 1:23 PM

    Hi,
    << Moderator message - Cut and paste response from http://www.consolut.com/en/s/sap-ides-access/d/s/doc/YY-OLI0IMRCCUST removed. Plagiarism is not allowed in SCN >>
    Regrds
    Jitender
    Edited by: Rob Burbank on Jun 6, 2011 10:53 AM

  • Function Module to get usage by supplying measuring point and equipment no

    Hi,
    I want to know what is the function module to get the usage on giving the measuring point,equipment number and month.Thanks in advance.
    Regards,
    SGR

    Try this Function Module : ALM_ME_EQUIPMENT_GETDETAIL

  • Relation between notification no and measuring point no or document

    Dear Expert's
    I want to link between notification no (qmnum) and measuring point no or measuring point document.
    I want to search measuring point number thorough notification no.
    plz suggest me ABAP purpose.
    thanks.
    regards:
    Neelesh Sonkar

    Hi,
    1. Get the EQUNR from the table "QMIH" using QMNUM.
    2. Get the MOVING_OBJECT from the table "IEQT_WL_MP" using EQUNR.
    3. Get the MDOCM (Measurement Document) POINT (Measuring Point) from the table "IMRG"
        using MOVING_OBJECT ( which is MDOCM ).
    Hope this will help you.
    Regards,
    Smart Varghese

  • Update Measurement Points on Functional Locations

    Hello Experts,
    I need create a custom program to update (add/delete/change) the measurement point's POSITIONS on functional locations. Basically the users want to clean up the functional locations which have some wrong data in them. Since I am very new to this functionality area, Can anybody please let me know - Is there a FM/Bapi to update the Measurement Point Positions on Functional Locations?
    I appreciate your help.
    Thanks.
    Edited by: sey ni on Mar 7, 2011 4:49 PM

    I think I will have to write a BDC on IK01/IK02 transactions. Not sure, if we have a better solution.

  • Copy Measuring Point from 1 FL to other FL

    Hi,
    I need to copy the Measuring Point( General Data, Counter Data & Classfication) from 1 Func Location to another Func Location.
    Please suggest me...
    regards,
    Venkatesan Anandan

    HI,
       As suggest Pete, Plese go to IL01 and enter the referece functional location, then press enter
    once you press enter pop will appear  , where you select measuringpoint, class etc as required by you
    then automatically data will transfer to new functionallocation which u creted.
    regards
    Krishna

Maybe you are looking for

  • In PL26 its not printing

    Hi Experts, We are facing the issue regarding printing which is not printing 5 at a time. Print Setup had assigned in: PLD-> Document Properties-> Number of copies 5. In PL26 only its not printing .. Can any one give the solution regarding this issue

  • DMM-DMS on 5.0 and 4310G DMP Compatibility

    I just bought 2 new 4310G DMP's and when they come up, they show as up for a short period of time and then show down.  I ensured that the passwords are the same on the DMP's and the DMM.  Is there an compatibility issue with the firmware, by chance? 

  • How export permisions of a file system repository

    Hi Forum How can i export the permissons and more properties of a file system repository that i had exported with WebDav ? Thnks

  • How to replace hard drive hp pavillon 15-n037ez

    is there a manual where i can see what to remove to replace the hard disk of my new hp pavillon 15-n037ez? I don't wanna kill the plastic... This question was solved. View Solution.

  • Generate .PDF file from BlackBerry application

    Hai, Can anyone explain or give me some idea on generating pdf file in blackberry application programatically... Thanks in advance. Regards Ratheesh R Kurup