mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-04-19 04:36:09 +08:00
Sync changes from upstream repository
Co-authored-by: Andrew Le Bihan <andy@mcneel.com> Co-authored-by: Dale Fugier <dale@mcneel.com> Co-authored-by: Dale Lear <dalelear@mcneel.com> Co-authored-by: Greg Arden <greg@mcneel.com> Co-authored-by: Jussi <jussi@mcneel.com> Co-authored-by: Lowell <lowell@mcneel.com> Co-authored-by: Rajaa Issa <rajaa@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com> Co-authored-by: alain <alain@mcneel.com> Co-authored-by: chuck <chuck@mcneel.com> Co-authored-by: piac <giulio@mcneel.com>
This commit is contained in:
@@ -540,13 +540,24 @@ void ON_TextRun::Init(
|
||||
managed_font = &ON_Font::Default;
|
||||
if (
|
||||
false == managed_font->IsManagedFont()
|
||||
|| managed_font->IsBold() != bold
|
||||
|| managed_font->IsItalic() != italic
|
||||
|| managed_font->IsBoldInQuartet() != bold // NEVER call IsBold() - it doesn't work with light, heavy, black, ... fonts!
|
||||
|| managed_font->IsItalicInQuartet() != italic
|
||||
|| managed_font->IsUnderlined() != underlined
|
||||
|| managed_font->IsStrikethrough() != strikethrough
|
||||
)
|
||||
{
|
||||
managed_font = ON_Font::ManagedFontFromRichTextProperties(
|
||||
// Dale Lear - March 2021 - RH-62974
|
||||
// There are multiple places in the text run, rich text parsing, and Rhino UI code
|
||||
// that need find a font from rich text properties.
|
||||
// They must all do it the same way. If for some reason, you must change this call,
|
||||
// please take the time to create a single function that replaces this call, search
|
||||
// for all the places ON_Font::FontFromRichTextProperties is called in
|
||||
// src4/rhino/...
|
||||
// opennurbs_textrun.cpp
|
||||
// opennurbs_textiterator.cpp
|
||||
// and replace every call to ON_Font::FontFromRichTextProperties with a call to
|
||||
// your new function.
|
||||
managed_font = ON_Font::FontFromRichTextProperties(
|
||||
ON_Font::RichTextFontName(managed_font, true),
|
||||
bold,
|
||||
italic,
|
||||
|
||||
Reference in New Issue
Block a user