Creating font for a different dpi

Using Visual Studio 2008 for our project C++.. 
Trying to create/select a font at a different dot per inch (dpi) .
We calculate the font height with this line..    dot per mm * 25.4 = dpi.
m_pLF->lfHeight = (long)(-item.GetFontSize() * theMachine.GetDotsPerMm()) * 25.4 / 72;
The font is drawn on a bitmap and then viewed. The problem is that the font seems to come out too small ?
About 30% too small
Full font selection routine is here.
void CLibraryBase::SelectFont(CItem &item, CLabel &label)
//choose the font
m_pLF=(LOGFONT*)calloc(1,sizeof(LOGFONT));
CString szFontName = item.GetFontName();
wcsncpy(m_pLF->lfFaceName,szFontName,szFontName.GetLength());
m_pLF->lfHeight = (long)(-item.GetFontSize() * theMachine.GetDotsPerMm()) * 25.4 / 72;
m_pLF->lfWeight = FW_NORMAL;
if(item.GetBold())
m_pLF->lfWeight = FW_BOLD;
if((szFontName.MakeUpper() == "WINGDINGS")||(szFontName.MakeUpper() == "SYMBOL")||(szFontName.MakeUpper() == "WEBDINGS"))
m_pLF->lfCharSet = SYMBOL_CHARSET;
m_pLF->lfItalic = item.GetItalic();
m_pLF->lfUnderline = item.GetUnderline();
m_pLF->lfStrikeOut = item.GetStrikeout();
m_pLF->lfQuality = ANTIALIASED_QUALITY;
m_pLF->lfPitchAndFamily = VARIABLE_PITCH | FF_DONTCARE;
m_Font.CreateFontIndirect(m_pLF);

Please show the code of GetFontSize and GetDotsPerMm function.
Think about using GetTextMetrics() function, like this.
https://msdn.microsoft.com/en-us/library/dd144941(v=vs.85).aspx
GetTextMetrics(hdc, &tm); m_pLF->lfHeight= tm.tmHeight + tm.tmExternalLeading;
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How can I use create/createInsert for two different tables

    Hi All,
    I am showing different fields in the UI from different tables. I am able to fetch the data from all the tables and able to modify and save the data.
    Now, the problem when I want to create/insert some data into those columns(from different tables) I am facing issues.
    How can I proceed further??

    Hi Shay,
    Thank you very much for your quick response.
    Actually I am totally new in ADF world and I am trying to implement some applications in ADF.
    I created an UI based on some 3 tables(there is foreign key relation between them) and some other tables. I am able to modify and save my application if there is any data in all the tables.
    My Actual issues are
    1) I removed all the data from the tables. There is a submit(CreateInsert) button, what I expected is on click of the button I should see all the fields in editable mode. But I was able to see only few fields and also in readonly mode. So here my issue is how can i create and save these data.
    2) Consider on my landing page I have just CommandLink/CommandButton. After clicking that page I should get the above screen in create mode(I mean to say all fields in editable mode). How can achieve this?
    Thanks & Regards,
    Ravi.

  • T code for creating font for smartform

    Hi All,
      please give the transaction for creating <b>FONT</b> which is to be used in smartforms.
    Regards
    Anil Kumar K

    hi anil,
    goto transaction 'SMARTSTYLES' from the control bar .
    in here u an set the font family , font size ,font style like bold, italic etc.
    after setting the font use the same in smart forms .
    note: assign the same in the transport request of the smart form cause if the release status is gone wrong then the font will cause problems.like if u r familiar with scripts u will understand..
    vijay.

  • How can i set different font for different tabs/pages

    I want to set different fonts for different tabs/pages?
    is it possible to do the same? If yes how?
    I can change the fonts under tools>options>contents>advanced. but that changes global settings.
    tried some add ons too- but that too changes the global settings.
    some pages like tweetdeck do not display icons etc properly under custom fonts.
    when i check "allow pages to select their own font" tweetdeck shows up fine but a number of other pages show fonts that are too big or some non standard fonts.
    Is there a way where i can select site default fonts for some sites/tabs, and custom fonts for other sites/tabs?
    otherwise i have to open different sites in different browsers- say i use my custom fonts- which apply globally, and open tweetdeck etc in Internet Explorer or Chrome etc. if i can have all tabs in one window/browser, that would be great.

    It's not a built-in feature to override a page's styles on a tab-by-tab or site-by-site basis, but perhaps someone has created an add-on for this?
    It also is possible to create style rules for particular sites and to apply them using either a userContent.css file or the Stylish extension. The Greasemonkey extension allows you to use JavaScript on a site-by-site basis, which provides further opportunity for customization. But these would take time and lots of testing to develop and perfect (and perfection might not be possible)...
    Regarding size, does the zoom feature help solve that part? In case you aren't familiar with the keyboard and mouse shortcuts for quickly changing the zoom level on a page, this article might be useful: [[Font size and zoom - increase the size of web pages]].

  • Different fonts for values

    Hi Gurus,
    Could some one help me to know how to create different fonts for values and characteristics.
    Please also let me know how to get totals for each column.
    Promise to assign points.
    Thanks in advance.
    Regards,
    Kiran

    > Hi Gurus,
    >
    > Could some one help me to know how to create
    > different fonts for values and characteristics.
    >
    > Please also let me know how to get totals for each
    > column.
    >
    > Promise to assign points.
    >
    > Thanks in advance.
    >
    > Regards,
    >
    > Kiran
    Hi  Kiran,
         1.If its is version 7.0 you can use Report designer and specify font for each column/ Row.If you are still in 3.5 you need to go ahead with Excel functionality.
        2.By default, totals for each column will be displayed in both the versions as result row. If you want to hide, you can go to the object properties from query designer and change it.
    Cheers,

  • This workflow cannot be imported because it was created in SharePoint Designer for a different Site

    Hello everyone.  I am getting this error when attempting to move minor workflow changes from mirror SharePoint development / production environments and hoping someone can help me.
    "This workflow cannot be imported because it was created in SharePoint Designer for a different site, or the original workflow has been moved or deleted.  To move a workflow between sites, use Save as Template (.wsp file) instead of a Visio workflow
    drawing."
    So basically I have taken an image of our single SharePoint server, Domain Controller, and a client and restored them to an OFFLINE development environment for the testing of workflow changes prior to production.  I've put quite a bit of time into one
    particularly and would like to export/import rather than re-created from scratch.
    I've successfully created the form template and imported.  This created the necessary list items nicely and the form appears to work as expected.  However, when attempting to import the .VWI file exported from dev SharePoint, I am getting the above
    error.  If I change the .VWI to .zip and remove the "workflow.xoml.wfconfig.xml" file, then re-zip and change the file extension back to .VWI I get a dialog that allows me to import, but I have to choose a new name and much of the related content
    is lost.  I need to be able to overwrite/merge the existing workflow with the import.  Any suggestions?
    One strange thing I ran into was during a test of an export/import from and to the exact same environment. If I simply export to .VWI, then import from .VWI with no changes, SAME everything I still get this error. Very weird. Hoping someone can shed some
    light on the subject. Thank you.
    Adam Tyler

    Hi Adam,
    Here is a blog talk about the same issue would be helpful:
    http://techiescode.blogspot.com/2014/09/copymove-sharepoint-2010-designer.html
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Creating Keyboard shortcut for two different actions with same menu name..

    Am using soundforge pro .. I have to process nearly 1000 audio files, and want to create shortcuts for "Smooth"
    The problem is there are two Menu names named "Smooth"
    Fade In > Smooth
    Fade Out > Smooth
    I want to assign different shortcuts for each one.. Is it possible ?
    Any help is appreciated

    Hi,
    I would use IP Address range boundaries instead which I normally do anyway instead for the AD site.
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • How to set different font for numbers in headings and TOCs

    Hi,
    I've noticed some people use a different font for numbers in headings and TOCs to get some extra magic. Is there any way to automate such use of fonts in the paragraph styles?
    Oh, and any suggestions on what fonts would be good for numbers?
    Thanks!

    I was merely continuing on the original theme -- any digit in any character style. It was only later revealed that (a) the OP needed old style figures, and (b) those were available in his font from the start.
    The negative lookahead is the answer to his question (copied in full now)
    Based on the above InDesignSecrets tutorial, does anyone know what to do if some of the numbers end with a dot or a comma?
    Like the Norwegian date format: 13. mai 2009
    Or the Norwegian way of pricing items: 2900,-
    and my example shows it can be done, but with an added caveat. If digits are to be set in red, using the exceptions the OP asks for, my example sentence will come out as
    "Think of a number between 1 to 10, but don't use 9."
    rather than the (here) intended
    "Think of a number between 1 to 10, but don't use 9."

  • How can I see the Query view created for a different user

    Hi All,
    How can a user see the View of a query created for a different user??
    I would like some info about how to give access ( if it is a access problem) or tell me the steps to do that.
    Regards, Federico

    Hi all,
    Maybe I didn't explain me as i should or maybe you dont know what is a Query View. Lets try again, showing you the steps to open a "Query view".
    This way is from Bex Analyzer (Excel)
    I open the Bex Analyzer and connect to the system -> Open query -> Under "Type" choose "Query View"...this is just a different view of the original query (more or least columns/rows).
    This way is from Bex Web:
    Once you open/execute the query, you have a ComboBox to choose the view (previously saved)
    The problem that we have is that the views created for a user, can NOT be found by other user. The only user who can is the owner.
    Could it be an authorization problem? or is ther any configuration possible to see it?
    Thanks in advance, Federico

  • System should create only one delivery for 100 different PO's in STO

    Hi All
    i need help
    Plant B raising 100 different po's daily for different materials to Plant A.(STO)
    Now Plant A will do Dilivery via VL10B.
    Here my requirement is system should create only one delivery for 100 different PO's and delivery should contain all the
    materials as line items bcause system should not create 100 deliveries( time consuming process).
    Here there is no manual transaction for VL10B.
    That is system is goining to excecute the VL10B automatically, there is no manual transation for VL10B
    How can we do this?
    Thanks
    MSK

    Hi
    We can able to do your requirement
    1. All the STO materials should have same sales view in materials for the *Unique)following field: Loading group, shipping Point, so on..
    2. In the config, hope we have do the combine delivery setting for VL10B
    Regards
    Prasanna
    Edited by: Prasanna Raju on Feb 17, 2010 1:52 PM

  • Urxvt - use different fonts for different instances of urxvt

    Hello. I use mcabber for IM which is a ncurses program. From what I understand, it is not possible to set font size for a ncurses program. Also urxvt uses .Xresources for configuration which sets the same font for every instance of urxvt.
    So I want to ask if it is possible to write a script to start urxvt with a different configuration file and then start mcabber in it.
    I understand that I can write a script to change font size in .Xresources and then use xrdb to merge the changes, but I do not understand how I can make that change local for only that instance of urxvt.
    Thanks

    Form man urxvt;
    -fn fontlist
    Select the fonts to be used. This is a comma separated list of font names that are checked in order when trying to find glyphs for characters. The first font defines the cell size for characters; other fonts might be smaller, but not (in general) larger. A (hopefully) reasonable default font list is always appended to it. See resource font for more details.
    In short, to specify an X11 core font, just specify its name or prefix it with "x:". To specify an XFT-font, you need to prefix it with "xft:", e.g.:
    urxvt -fn "xft:Bitstream Vera Sans Mono:pixelsize=15"
    urxvt -fn "9x15bold,xft:Bitstream Vera Sans Mono"
    I use it all the time.

  • Is it possible to have same file size for different dpi?

    I changed one.TIFF file (300dpi, 1024X1332)  to .jpg files of four different dpi. But when I checked the four result jpg files, I found out that they are all in same file size and quality.( I also have checked the property of the files in the Windows.)
    I think more DPI means more data and more file size. Am I wrong?
    I use Photoshop CS 5.1(64bit, WINDOWS) - which is part of my Adobe Master Collection CS5.5.
    TIFF(300dpi, 1024X1332) ->
    1. JPG(72dpi, 1024X1332) : 306KB
    2. JPG(108dpi, 1024X1332) : 306KB
    3. JPG(144dpi, 1024X1332) : 306KB
    4. JPG(600dpi, 1024X1332) : 306KB
    I tested a few times more with different files. and same result comes out.(same file size for different dpi)
    Thanks in advance.

    Yes absolutely. Great observation.  PPI does not control the number of pixels, just how big they are.
    Now, if you change the PPI in the Image Size dialog with Resample checked.. then, that is a different story. In that case you will be changing the pixel dimension of an image (i.e.,changing the total number of pixels making up the image) while keeping its print size.
    In your test files, you will notice all the print sizes are different, because all you were telling Photoshop to do was change the size of the pixels (if or when the image is ever printed), which is really just a bit of metadata of the file.

  • I want to create stock for particular material in r3 system to check different availabilty checks it triggers

    I want to create stock for particular material in r3 system to check different availabilty checks it triggers like one time delivery ,and delivery proposal (partial delivery) please help me to get these .

    you can use MB1C with movement type 501

  • HT2534 i have a half-filled form for my apple id account & in it there is no option as NONE for credit card payment method. Now when i try to create a new account it asks me for a different email/apple id as my actual id already exists???

    i have a half-filled form for my apple id account & in it there is no option as NONE for credit card payment method. Now when i try to create a new account it asks me for a different email/apple id as my actual id already exists???

    If you want to use the email address that you used on the first account then you will need to remove it from that first account before you can do so e.g. via the Store > View Account menu option on your computer's or via http://appleid.apple.com - you can create a new email address via http://gmail.com or http://hotmail.com to replace it with.

  • Unable to create delivery for STO between different stroage locations

    Hi,
    i created PO for STO between differen storage locations belonging to the same plant.
                 At the time creating PO iam getting warning message " Of material RM-999999, only 0 KG are available on desired     
                 date". what could be the reason?
    when iam doing vl10b, PO is displaying but when iam selecting the PO line and clicking on the background button it is not generating any delivery document number and it is not showing any errors?
    can any one help on this.

    Hi Praveen,
    While executing VL10B, you are actually planning to create outbound delivery for STO PO.
    The STO PO will be due for delivery on that date and hence PO is displayed in the transaction.
    The error message specified by you means on the due date of delivery, there is no material quantity exists at supplying storage location. This could be because no quantity exists in storage location or there could be some reservations available for available quantity or some other quantity is booked under some other outbound delivery document on or before that date.
    Check for stock on posting date via t-code MB5B and proceed accordingly.
    Hope this resolves your problem.
    -Ravi

Maybe you are looking for