Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to do line space??

Posted on 1998-07-22
10
Medium Priority
?
313 Views
Last Modified: 2013-11-20
I had an mfc application like paintbrush.In that I had one text object..It has got one property sheet and in which user can configure various properties of text like font,alignment ,charecter spacing,line spacing etc??
I had no idea about how to implement line spacing...Any help would be welcome..
0
Comment
Question by:sheeba021198
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 

Author Comment

by:sheeba021198
ID: 1319556
Edited text of question
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1319557
What exactly is your question? Are you unsure about what line spacing is? Or how to implement it?
0
 

Author Comment

by:sheeba021198
ID: 1319558
Edited text of question
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Expert Comment

by:rabbitears
ID: 1319559
here's some copy/paste's from a few recent threads on the vcpp list.  maybe you can get something out of them:

There's a sample somewhere in VC (I don't remember the name) that allows you
to do distortions to TrueType fonts.  It does it by using the BeginPath
function (and companions).  What it does is draw the text into a hidden
path, and then enumerate the points in that path, applying some calculations
to them.  This is probably all you need.  Otherwise, there are a set of
functions to get the geometry of individual TrueType glyphs (start by
looking at GetGlyphMetrics).



> Hello,

> I would like to decode a Windows Font and get the geometry of a letter (
> for example some points on the edge ) in order to create a 3D object.
> If somebody has an Idea.

> Thanks,
>                Stephane



>Is this an MFC bug?
>According to the online help for CListBox::MeasureItem(): "If the list box is
>created with the LBS_OWNERDRAWVARIABLE style, the framework calls this member
>function for each item in the list box. Otherwise, this member is called only
>once." However my CDerivedListBox::MeasureItem() is never called for a listbox
>created with LBS_OWNERDRAWFIXED.

ANGEL@soft-data.com said:
>...Looks like a MFC bug...

Bummer. I was hoping for a hilarious round of the usual flames
from Mr. Defensive.
Here's what I found out after testing the many good suggestions.

None of the handlers/overrides for ON_WM_MEASUREITEM_REFLECT,
ON_WM_CREATE, ON_WM_MEASUREITEM or PreCreateWindow is called.
Thanks to Trevor Russ for suggesting the method most compatible
with my goal of a reusable control:

void CMyOwnerDrawFixedListBox::PreSubclassWindow() {
        CClientDC dc(this);
        CFont* pOldFont = dc.SelectObject(GetFont());
        TEXTMETRIC tm;
        VERIFY(dc.GetTextMetrics(&tm));
        dc.SelectObject(pOldFont);
        SetItemHeight(0, tm.tmHeight);

        CListBox::PreSubclassWindow();
}

that last one was from mfc-l
0
 

Expert Comment

by:rabbitears
ID: 1319560
i also think there's a settextmetrics function.. probably useful.
0
 
LVL 8

Expert Comment

by:trestan
ID: 1319561
Pls try win32 function SOPutParaSpacing.
(A twip is 1/1440 inch, or 1/20 of a printer’s point).
0
 

Author Comment

by:sheeba021198
ID: 1319562
I think that is for spacing a paragraph..I have to provide spacing between lines..
0
 
LVL 8

Accepted Solution

by:
trestan earned 200 total points
ID: 1319563
Pls take a look at the answer before you reject it. The function can set the Baseline to baseline height, in twips.


0
 

Author Comment

by:sheeba021198
ID: 1319564
To use SOPutParaSpacing,which file I have to include??
I include windows.h,but compilation error,undeclared identifier
occurs..Any sample code would be welcome
0
 
LVL 8

Expert Comment

by:trestan
ID: 1319565
The head file is SODEFS.H that should be included. But it does not end there. You need to know features of the shell for the Windows operating system. I would like to provide you the following site for instruction:
http://www.microsoft.com/msdn/sdk/inetsdk/help/itt/shell/fileparser/fileparser.htm
There is also an example in the online help:
Visual C++ -> Visual C++ Samples -> SDK Samples -> Windows NT Samples -> Fparser: File Parser
And you should notice that there is no MFC function to do it. Maybe in the later version MS will provide it.
Good luck.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question