How to force a new line in ng-zorro-mobile's TabPane [title] property - ng-zorro-mobile

I'm very new to frontend development.
TabPane from ng-zorro-mobile
Currently I'm exploring ng-zorro-mobile, it's nice and clear.
I would like to know if there is a symbol or quick way to break a line.
e.g. I want to show the first line in Chinese and the second line in English

Related

Missing Xcode features

I am new to iOS (Swift) development. I did a little research and found out that Xcode doesn't support basic features related to autocorrection or other handy staff such as
Add missing imports
Auto alignment + space correction
Remove the entire line (Ctrl-X)
According to the first point, I found this article https://developer.apple.com/forums/thread/79007 where developers complain about this missing feature, I would like to know if something changed today?
And about the second point, I see there is Ctrl-i command that can help to correct the lines in case if the line is too close to the boarders, BUT if there is redundant\missing space (eg:var material:SCNMaterial{get}) OR case like this
class Foo{
func update()}
nothing will be changed.
The last one is just a handy staff that I liked in other IDEs is Ctrl-Z cmd, when you need to remove a few lines you can just put a pointer on the line and click the combination as a result this line will be cut, BUT not in Xcode, here it is necessary to mark exactly the text you are going to cut (sometimes it is annoying).
Let me know if I am wrong?

Visual Studio - Automatically convert new lines in code when pasting

Due to Unity's newer version not supporting MonoDevelop any longer, I've just made the switch to Microsoft Visual Studio. Now, on my current project I'm working with a lot of texts, which I have to copy from a word-document and save them in my code as strings.
In MonoDevelop there was this nice formatting feature where it would automatically format this:
This is a title
This is some text after a forced new line
into this string: "This is a title\nThis is some text after a forced new line"
This was very handy when working with texts and Visual Studio is just pasting it with the new line into my code, which then destroys the syntax like so:
public string Example =
"This is a title
This is some text after a forced new line" (Syntax error)
Any way to control the formatting and make it translate the new line from the copied text into code automatically?
You could use verbatim strings that will allow you to continue the string on to a new line:
public string Example =
#"This is a title
This is some text after a forced new line";
This will allow you to keep any new-lines within the copied text.
This won't automatically escape double quotes within the copied text though which would need to be escaped by another double quote i.e. This is some "quoted" text should be
var s = #"This is some ""quoted"" text";
Another Way
You could also put all this text into a resource file. This would have the added benefit of keeping the code clean too.
For more info, check out the docs

Support "styled text" in a scriptable Mac application (Cocoa Scripting)

My app supports being scripted with Applescript.
I am trying to make styled text content, stored in NSAttributedString objects, available to an Applescript user.
I thought I could simply deliver styled text with the NSAttributedString class, just like I deliver plain text with the NSString class, but that does not work - Cocoa Scripting then reports that it cannot convert or coerce the data.
I wonder if I'm missing something or if this is just plain impossible with the standard classes supported by Cocoa Scripting?
AppleScript does know the "styled text" type, as seen in this example:
set stxt to "foo" as styled text
So, if AppleScript knows this type by default, shouldn't the Cocoa Scripting engine support it as well somehow?
As always there are many choices for solving an AS problem.
In my scriptable text editor (Ted), I implemented the Text Suite, which is based on rich text (NSTextStorage, a subclass of NSMutableAttributedString). I wanted to be able to script tabs in my paragraphs, so I added a style record, which contains all the paragraph style information. This lets me write scripts like this:
tell application "Ted"
set doc1 to make new document at beginning with properties {name:"Document One"}
tell doc1
set p1 to make new paragraph at end with data "Paragraph One" with properties {size:24, color:maraschino}
set p2 to make new paragraph at end with data "Paragraph Two" with properties {style:style of paragraph 1}
set color of paragraph 1 to blue
end tell
set doc2 to make new document at beginning with properties {name:"Document Two"}
copy p1 to beginning of doc2
properties of paragraph 1 of doc2
end tell
Since p1 is rich text, the second document ends up with both the text and formatting of the first paragraph of the first document.
You can also ask for the properties of a piece of text, where I have implemented the usual Text Suite properties, as well as a "style" property for paragraph style (backed by NSParagraphStyle, since I wanted to be able to script the tab stops):
properties of paragraph 1 of doc2
Result:
{height:60.0, italic:false, size:24, style:{paragraph spacing after:0.0, head indent:0.0, line break mode:0, alignment:4, line spacing:0.0, minimum line height:0.0, first line head indent:0.0, paragraph spacing before:0.0, tabs:{"28L", "56L", "84L", "112L", "140L", "168L", "196L", "224L", "252L", "280L", "308L", "336L"}, tail indent:0.0, maximum line height:0.0, line height multiple:0.0, default tab interval:0.0}, color:blue, width:164.109375, font:"Helvetica", bold:false, class:attribute run}
This works well for passing rich text within my application, but may not be as useful for passing styled text to other applications, which may be what you wanted to do. I think adding a "style" property (of type record) is probably the best way to convey style info for use in other scriptable apps. Then in the second app, the scripter can make use of any properties in the style record that the second app understands.
It looks like there is no implicit support for styled text in AppleScript. And there is also no common interchange record type for passing styled text.
AppleScript was developed in the pre-OSX days when styled text was often represented by a combination of a plain text (in System or MacRoman encoding) and a styl resource. With Unicode came an alternative format of a ustl style format. These are still used with the Carbon Pasteboard API (PasteboardCreate etc.) today. Yet, none of these seem to have made it into the use with AppleScript.
The fact that AppleScript knows of a styled text type has no special meaning. Even its class is just text.
Update
I just found that Matt Neuburg's book "AppleScript The Definitive Guide" mentions styled text and gives an example where it's indeed showing a record containing both the plain text (class ktxt) and style data (class ksty) with data of type styl, just as I had expected above. He also points out that most applications don't use that format, though.
So, it appears using a record with style resource data is indeed the intended way, only that hardly anyone knows about it. Go figure.

How do you make a bullet point with a double bullet character in InDesign?

I have a bulleted list in InDesign but I want the bullet character to be shown twice.
I'm using the / character, so I want it to appear like // like a comment. I can't figure it out. I have the bullet a different colour/style as the text following it, so I don't want to "hard-code" it in either.
Sorry for the trolls fellow. Your question isn't a programming question, which is why you got a downvote.
However, to help you out, try using a font for your bullet point that has a glyph that you like - you can use any character for the bullets, you know.
Or, if you create a new paragraph style, you can go into the Paragraph Style Options under Bullets and Numbering. Now, where it says Text After you can enter another bullet character there. But you'll have to also create a character style to set it to the right font to show your bullet character.

NSTextView paragraph style of newline

I've been playing around with NSTextView and have applied some paragraph styles to certain lines. However, when I type enter and get a new line, the attributes that I applied to one line are bleeding into the next.
I want to be able to apply a paragraph style to one line and have the next line be formatted in the default way. You can see what I mean from the screenshots.
When I add some spacing between paragraphs via NSParagraphStyle, the same spacing applies to the newline, which makes the whole thing look pretty shotty. Basically, I am looking for a way to reset the paragraph style for an empty line.
I have tried [MyTextView resetTypingAttributes:theAttributes] to no avail, since you first have to start typing for the new attributes to apply. Just to be clear, the line below the text in the screenshot is the cursor, which is really far down there as a result of the paragraph spacing.
Screenshot:
It seems that you have to use setTypingAttributes on the textview.

Resources