{"id":15744793,"url":"https://github.com/meilcli/crossformattedtext","last_synced_at":"2025-07-09T09:38:19.798Z","repository":{"id":69256039,"uuid":"76937371","full_name":"MeilCli/CrossFormattedText","owner":"MeilCli","description":"CrossFormattedText Plugin for Xamarin and Windows","archived":false,"fork":false,"pushed_at":"2017-07-09T06:55:25.000Z","size":275,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T07:58:41.777Z","etag":null,"topics":["android","formatted-text","ios","spannable-string","uwp","xamarin","xamarin-library"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MeilCli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-20T08:18:04.000Z","updated_at":"2020-08-06T11:10:17.000Z","dependencies_parsed_at":"2023-06-03T02:15:36.150Z","dependency_job_id":null,"html_url":"https://github.com/MeilCli/CrossFormattedText","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MeilCli/CrossFormattedText","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2FCrossFormattedText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2FCrossFormattedText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2FCrossFormattedText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2FCrossFormattedText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeilCli","download_url":"https://codeload.github.com/MeilCli/CrossFormattedText/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeilCli%2FCrossFormattedText/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264432122,"owners_count":23607381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","formatted-text","ios","spannable-string","uwp","xamarin","xamarin-library"],"created_at":"2024-10-04T04:01:07.865Z","updated_at":"2025-07-09T09:38:19.445Z","avatar_url":"https://github.com/MeilCli.png","language":"C#","readme":"# CrossFormattedText\n[![NuGet version](https://badge.fury.io/nu/Plugin.CrossFormattedText.svg)](https://www.nuget.org/packages/Plugin.CrossFormattedText/)  \n      \n***version 2.0.0: Destructive changes!!***  \n**Document shortage, now**  \nThis library rapped some platform span class\n- Android: SpannableStringBuilder(to ICharSequence\n- iOS: NSMutableAttributedString(to NSAttributedString\n- UWP: List\\\u003cInline\\\u003e\n- Windows Phone 8: List\\\u003cInline\\\u003e\n- Windows Phone 8.1: List\\\u003cInline\\\u003e\n- Windows 8.1: List\\\u003cInline\\\u003e\n\n## Features\n\n| Platform | Supported | BackgroundColor | ForegroundColor | Bold/Italic | RelativeFontSize | Command |\n|:---|:---:|:---:|:---:|:--:|:--:|:--:|\n| Android | Yes | ✓ | ✓ | ✓ | ✓ | ✓ |\n| iOS | Yes | ✓ | ✓ | ✓ | | will support(please advice) |\n| UWP | Yes | | ✓ | ✓ | ✓ | ✓ |\n| Windows Phone 8| Yes | | ✓ | ✓ | ✓ | |\n| Windows Phone 8.1| Yes | | ✓ | ✓ | ✓ | ✓ |\n| Windows 8.1| Yes | | ✓ | ✓ | ✓ | ✓ |\n| Mac | No | | | | | |\n\n## Document\n### Span\nMutable text and mutable meta data\n\n### EditableSpan\nimmutable text and mutable meta data\n\n### FormattedStringBuilder\nAlike StringBuilder, mutable text and immutable meta data.  \nIf change meta data, build FormattedString to access EditableSpan \n\n### FormattedString\nAlike string, immutable text and mutable meta data.  \nTwo index type: text index or span index\n\n- text index operator\n  - string like operator\n- span index operator\n  - method name have suffix **Span\n  - EditableSpan indexer\n\n### FormattedStringConverter\nAlike html converter.  \nNot support Command, now.\n\nThe following syntax:\n```\n\u003cspan font-size=\"{enum name or value} font=\"{enum name}\" f-color=\"{value (format: a,r,g,b)} b-color=\"{value (format: a,r,g,b)}\"\u003etext\u003c/span\u003e\n```\n\nThe following enum name:\n- font-size\n  - ultra-big\n  - big\n  - normal\n  - small\n  - ultra-small\n- font\n  - none\n  - bold\n  - italic\n  - italic-bold\n\n## Usgae\n\nIn PCL: prepare FormattedString\n```csharp\nFormattedString HelloWorld = new FormattedString(new Span[] {\n  new Span() {\n    Text = \"Hello\",\n    ForegroundColor = new SpanColor(125,125,125)\n  },\n  new Span() {\n    Text = \"World\",\n    FontAttributes = FontAttributes.Bold | FontAttributes.Italic,\n    FontSize = FontSize.Small\n  }\n});\n```\n\nIn PCL or target Platform: make ISpaanableString\n```csharp\nISpannableString spannableString = HelloWorld.Build();\n```\n\nIn target Platform: put spanned string\n```csharp\n//for Android\ntextView.TextFormatted = spannableString.Span();\ntextView.SetTextWithCommandableSpan(spannableString); // for using Command\n//for iOS\nLabel.AttributedText = spannableString.Span();\n//for All Windows Platform\nspannableString.SetTo(TextBlock);\n```\n\nSpan Method is only cast ISpannableString→each platform`s SpannableString and take Text field  \nSetTo Method is for All Windows Platform, auto clear and add all span to TextBlock-Text.\n\n## License\nunder MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilcli%2Fcrossformattedtext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeilcli%2Fcrossformattedtext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilcli%2Fcrossformattedtext/lists"}