This relates to the Change Font In Table Cell question - which had a relatively easy solution.
Now I would like to add the option to change the text in each table cell to the same BASE (typeface and any font effects - e.g. Arial, bold) but retain the rest of the 'font effects' relating to each text item in the cell. So if the item in the cell was Times New Roman, Underlined, red and 20 point, the resulting item would be Arial,bold,underlined,red and 20 point.
This would seem to require the creation of new styles as we step through the items. This was my approach to the previous question, but seemed to have problems whenever there was a mix of Unicode and non-unicode fonts and styles.
I know how to step through each item and check its style and how to check the base style. What I don't know is what steps to do to the item I'm processing so that for ARBITRARY styles and text I can achieve the desired result.
Dick
Change Font FACE In Table Cell
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
You can use TrvActionFontEx.
This code applies 'Arial', bold to the selection:
This code applies 'Arial', bold to the selection:
Code: Select all
rvActionFontEx1.UserInterface := False;
rvActionFontEx1.Font.Name := 'Arial';
rvActionFontEx1.Font.Style := [fsBold];
rvActionFontEx1.ValidProperties := [rvfimFontName, rvfimBold];
rvActionFontEx1.ExecuteTarget(RichViewEdit1);
rvActionFontEx1.UserInterface := True;
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
Just a question to make sure I'm not doing something wrong. When I do the conversion on my test file to force its current 26 text styles to be one of three styles by using
FMain.RichViewEdit1.ApplyTextStyle([0,1 or 2]) on the selected columns the result seems fine and the number of styles after doing DeleteUnusedStyles does equal 3 - but the size of the file grows from 929,481 to 1,762,260.
Is this to be expected? I had rather thought the file size would decrease slightly because of the reduction in different text styles.
FMain.RichViewEdit1.ApplyTextStyle([0,1 or 2]) on the selected columns the result seems fine and the number of styles after doing DeleteUnusedStyles does equal 3 - but the size of the file grows from 929,481 to 1,762,260.
Is this to be expected? I had rather thought the file size would decrease slightly because of the reduction in different text styles.
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact: