Tag Archives: strings

Flow words around drop caps in C#

The example Flow blocks around obstacles for document layout in C# implements a document layout algorithm that flows blocks around obstacles. Moving from there to flowing words around obstacles is relatively simple. The following sections describe the main places where … Continue reading

Posted in algorithms, fonts, graphics, strings | Tagged , , , , , , , , , , , , | Leave a comment

Flow words around obstacles for document layout in C#

The example Flow blocks around obstacles for document layout in C# implements a document layout algorithm that flows blocks around obstacles. Moving from there to flowing words around obstacles is relatively simple. The following sections describe the two main places … Continue reading

Posted in algorithms, fonts, graphics, strings | Tagged , , , , , , , , , , , , | Leave a comment

Flow blocks around obstacles for document layout in C#

The following two document layout examples draw “illuminated” text by using an initial or drop cap. Draw different styles of “illuminated” text in C# Draw “illuminated” text in C# Martin asked how we could do something similar when the text … Continue reading

Posted in algorithms, fonts, graphics, strings | Tagged , , , , , , , , , , , , | 2 Comments

Convert camel case into underscore case in C#

Lately I’ve been doing a lot of C#-to-python conversion. The style in C# is to use camel case where you capitalize the first letter each each word after the first one in a variable’s name as in thisIsAVariableName. The style … Continue reading

Posted in programs, strings | Tagged , , , , , , , , | 2 Comments

Copy ListView data into an array in C#

This example uses the following ListView extension method to copy ListView data into a two-dimensional array of strings. // Return the ListBox’s contents in a string[,]. public static string[,] GetListViewData(this ListView lvw) { // Get the number of rows and … Continue reading

Posted in arrays, controls, strings | Tagged , , , , , , , , , , | Leave a comment

Add LINQ to autocomplete in C#

This example adds LINQ to the example Improve autocomplete suggestion in C#. It adds LINQ in two places: when it loads the list of words and when the program searches for the best matches that begin with a particular letter. … Continue reading

Posted in algorithms, LINQ, strings | Tagged , , , , , , , , , , , , , , | Leave a comment

Improve autocomplete suggestion in C#

This example improves on the example Suggest autocomplete words in C#. The previous example loads all of its words into a big array. Then, to find the words that start with a particular letter, the program uses a binary search … Continue reading

Posted in algorithms, strings | Tagged , , , , , , , , , , , , , , | 1 Comment

Suggest autocomplete words in C#

This example shows one way that a program can suggest words for the user. When I type something on my phone, it displays a list of possible words for autocomplete below the editing area. For example, if I type “gping” … Continue reading

Posted in algorithms, strings | Tagged , , , , , , , , , , , , , , | 5 Comments

Draw different styles of “illuminated” text in C#

My previous post Draw “illuminated” text in C# showed how to draw “illuminated” text. It drew each paragraph’s initial letter in a large font with a box around it. Real illuminated manuscripts typically make the initial letter much more elaborate. … Continue reading

Posted in fonts, graphics, strings | Tagged , , , , , , , , , | 1 Comment

Draw “illuminated” text in C#

This example lets you draw “illuminated text” where each paragraph begins with an oversized letter. In some illuminated manuscripts, the first letter of a paragraph is drawn in a larger font than the remaining text. This example does something similar. … Continue reading

Posted in fonts, graphics, strings | Tagged , , , , , , , , , | 7 Comments